Can we rotate symbols in LaTeX? How should we make this diagram?
Two solutions, one with “standard” tools, one with tikz-cd
and code by LaRiFaRi.
\documentclass{article}
\usepackage{amsmath,amssymb} % for both solutions
\usepackage{graphicx} % for the first solution
\usepackage{tikz-cd} % for the second solution
% for the first solution
\newcommand{\overiso}[2]{%
\overset{\substack{\textstyle #1\\[0.5ex]\rotcong\\[0.5ex]}}{#2}%
}
\newcommand{\rotcong}{\rotatebox[origin=c]{90}{$\cong$}}
% ===
% for the second solution, see https://tex.stackexchange.com/a/216042/4427
\tikzset{
symbol/.style={
draw=none,
every to/.append style={
edge node={node [sloped, allow upside down, auto=false]{$#1$}}}
}
}
% ===
% general commands
\newcommand{\numberset}[1]{\mathbb{#1}}
\newcommand{\Z}{\numberset{Z}}
\begin{document}
\[
\dots
\xrightarrow{\cong}
\overiso{\Z}{C_3(*)}
\xrightarrow{0}
\overiso{\Z}{C_2(*)}
\xrightarrow{\cong}
\overiso{\Z}{C_1(*)}
\xrightarrow{0}
\overiso{\Z}{C_0(*)}
\rightarrow
0
\]
\[
\begin{tikzcd}[row sep=1em]
& \Z & \Z & \Z & \Z \\
\dotsb \arrow[r,"\cong"] &
C_3(*) \arrow[r,"0"] \arrow[u,symbol=\cong] &
C_2(*) \arrow[r,"\cong"] \arrow[u,symbol=\cong] &
C_1(*) \arrow[r,"0"] \arrow[u,symbol=\cong] &
C_0(*) \arrow[r] \arrow[u,symbol=\cong] &
0
\end{tikzcd}
\]
\end{document}
A solution with stackengine
:
\documentclass{article}
\usepackage{amsmath, amssymb, graphicx}
\usepackage[usestackEOL]{stackengine}
\begin{document}
\[ \stackMath
\dotsm
\xrightarrow{\enspace\cong\enspace}
\Shortstack{\mathbb{Z} \\ \rotatebox[origin=c]{90}{$\cong$} \\ C_3(*)}
\xrightarrow{\enspace 0\enspace}
\Shortstack{\mathbb{Z} \\ \rotatebox[origin=c]{90}{$\cong$} \\ C_2(*)}
\xrightarrow{\enspace\cong\enspace}
\Shortstack{\mathbb{Z} \\ \rotatebox[origin=c]{90}{$\cong$} \\ C_1(*)}
\xrightarrow{\enspace 0\enspace}
\Shortstack{\mathbb{Z} \\ \rotatebox[origin=c]{90}{$\cong$} \\ C_0(*)}
\xrightarrow{\hspace{1.25em}}0
\]
\end{document}
A solution using TikZ (with manual placements):
\documentclass[border=3.14,tikz]{standalone}
\usetikzlibrary{positioning}
\usepackage{amssymb}
\begin{document}
\begin{tikzpicture}
\node at (0,0) (d) {\ldots};
\node[right=of d] (c3) {$C_3(*)$};
\node[right=of c3] (c2) {$C_2(*)$};
\node[right=of c2] (c1) {$C_1(*)$};
\node[right=of c1] (c0) {$C_0(*)$};
\node[right=of c0] (0) {$0$};
\draw[->] (d) --node[above]{$\cong$} (c3);
\draw[->] (c3) --node[above]{$0$} (c2);
\draw[->] (c2) --node[above]{$\cong$} (c1);
\draw[->] (c1) --node[above]{$0$} (c0);
\draw[->] (c0) -- (0);
\foreach\x in {0,...,3}
{
\node[node distance=0.5cm,above=of c\x] (z\x) {$\mathbb{Z}$};
\path (c\x) --node[rotate=90]{$\cong$} (z\x);
}
\end{tikzpicture}
\end{document}
TikZ using the graphs
and quotes
syntax:
\documentclass[border=3.14,tikz]{standalone}
\usetikzlibrary{graphs,quotes,positioning}
\usepackage{amssymb}
\begin{document}
\begin{tikzpicture}
\graph[grow right=2cm]
{
d [as=\ldots] ->["$\cong$"]
c3 [as=$C_3(*)$] ->["$0$"]
c2 [as=$C_2(*)$] ->["$\cong$"]
c1 [as=$C_1(*)$] ->["$0$"]
c0 [as=$C_0(*)$] ->
0 [as=$0$]
};
\foreach\x in {3,...,0}
{
\node[node distance=0.5cm,above=of c\x] (z\x) {$\mathbb{Z}$};
\path (c\x) --node[rotate=90]{$\cong$} (z\x);
}
\end{tikzpicture}
\end{document}