TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sorry for the basic question. I am trying to get commutative diagrams like

$$\begin{tikzpicture}[description/.style={fill=white,inner sep=2pt}]
\matrix (m) [matrix of math nodes, row sep=3em,
column sep=2.5em, text height=1.5ex, text depth=0.25ex]
{A & B \\
C& D \\ };
(m-1-1) edge node[auto] {$\widetilde {f} $} (m-1-2)
(m-2-1) edge node[auto] {$ f $} (m-2-2);
\draw[double equal sign distance,shorten <=5pt,shorten >=5pt] (m-1-2) -- (m-2-2);
\draw[double equal sign distance,shorten <=5pt,shorten >=5pt] (m-1-1) -- (m-2-1);

My question is: How do I replace the vertical equal sign connecting $A$ to $C$ with a vertical isomorphism sign, a vertical version of $\simeq$ or $\approx $?

share|improve this question
Sort of vaguely related: tex.stackexchange.com/q/15830/86 – Loop Space Feb 13 '12 at 17:31
up vote 6 down vote accepted

I tried to modifiy your code, but it only resulted in weird shifting and not the desired result at all. As an OCD like control freak, I always position "by hand", so tell me if this works for you:



\node (A) at (0,0) {A};
\node (B) at (2,0) {B};
\node (C) at (0,-2) {C};
\node (D) at (2,-2) {D};
\draw (A) edge node[above] {$\widetilde {f} $} (B);
\draw (C) edge node[above] {$f$} (D);
\draw (A) edge node[above,rotate=90] {$\simeq$} (C);
\draw (B) edge node[above,rotate=90] {$\approx$} (D);


enter image description here

Edit 1: With some "cheated" changes as wh1te proposed:

\draw[white] (A) edge node[rotate=90,black] {$\simeq$} (C);
\draw[white] (B) edge node[rotate=90,black] {$\approx$} (D);

enter image description here

Edit 2: Of cause, one would still see the lines on a non-white background, so this should be better:

\draw[transparent] (A) edge node[rotate=90,opacity=1] {$\simeq$} (C);
\draw[transparent] (B) edge node[rotate=90,opacity=1] {$\approx$} (D);

Edit 3: I could not think of any automated way right now, but you could use a \resizebox:

\draw[transparent] (A) edge node[rotate=90,opacity=1] {\resizebox{1.5cm}{0.3cm}{$\simeq$}} (C);
\draw[transparent] (B) edge node[rotate=90,opacity=1] {\resizebox{1.5cm}{0.3cm}{$\approx$}} (D);

enter image description here

share|improve this answer
My understanding was that he wanted the actual line connecting the two nodes to be like that symbol, not just label the existing line. So a snake decoration could probably be used to do the job. – Roelof Spijker Feb 13 '12 at 16:06
Thank you for the response Tom. I am happy to learn of how to do this too. But I was preferring as whlt3 suggested, to be able to make the whole line connecting the two nodes as the isomorphism sign – clh Feb 13 '12 at 16:12
This is almost what I had in mind, but can you make the isomorphism signs fill the space between the nodes more, like the double equals sign does in my example. – clh Feb 13 '12 at 16:17
Great, thank you! – clh Feb 13 '12 at 19:06
Possible instead of resizebox : ` \path (C) -- node[sloped,transform shape,inner sep=0pt,xscale=6] {$\simeq$} (A) ; ` – Alain Matthes Feb 13 '12 at 21:52

I like to use tikz-cd for commutative diagrams. Here is how I am indicating isomorphisms. enter image description here

0 \arrow{r} & A \arrow{r} \isoarrow{d} & B \arrow{r} \isoarrow{d} & C \arrow{r} \isoarrow{d} & 0 \\ 
0 \arrow{r} & A' \arrow{r} & B' \arrow{r} & C'  \arrow{r} & 0 
share|improve this answer
It doesn't work for horizontal or diagonal isomorphisms. I hope someone will figure out a better way. – Benjamin McKay Apr 26 '15 at 12:22

I took this from a style for Subseteq to be vertical or horizontal.

\tikzset{cong/.style={draw=none,edge node={node [sloped, allow upside down, auto=false]{$\cong$}}},
         Isom/.style={draw=none,every to/.append style={edge node={node [sloped, allow upside down, auto=false]{$\cong$}}}}}

Load the code in the preamble, then in tikzcd


It seems to work well for me.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.