11

How could I proceed to make an "equal" arrow in a diagram in tikz? To be clearer, what I would like to obtain is the equivalent of the following command in xy:

\ar@{=}[direction]

Two examples of what I want (done in tikz):

and

Thank you for your help.

2
  • 1
    I guess \draw (a1) edge[bend left,double distance=2pt] (a2); should work, assuming nodes be named... Commented Jun 26, 2013 at 10:51
  • "double distance" works for the equal sign :) Do you know by any chance if there is a way to use something like "to [out = 45, in = -45]" instead of "bend left"? Commented Jun 26, 2013 at 10:56

2 Answers 2

18

You can use double equal sign distance in your \draw options to set the distance between the double lines to match that of an equal sign.

The double lines work with any path specification, including things like bend left or to [out=45]:

\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw [double equal sign distance] (0,0) to [out=45, in=180] (3,0) node [anchor=mid west] {$= A$};
\end{tikzpicture}
\end{document}
2
  • Yours answers rock!
    – juliohm
    Commented Jun 26, 2013 at 13:16
  • 6
    Although this is right, I want to gripe pointlessly that the double distance option always produces a faint dark edge across the "gap" at the ends of the path. Presumably this is because the path is drawn first in black and then overdrawn in white (as the manual explains) but it would be nice if they would line up correctly...
    – Ryan Reich
    Commented Jun 26, 2013 at 22:25
16

The great tikz-cd package (, manual) includes the option equal for arrows.

Code

\documentclass[tikz,convert=false]{standalone}
\usepackage{tikz-cd}
\usetikzlibrary{arrows}
\tikzset{commutative diagrams/.cd,arrow style=tikz,diagrams={>=latex'}}
\begin{document}
\begin{tikzcd}[swap,bend angle=45]
A \dar{f} \rar{a} \ar[bend left,equal]{rr}
  & X \dar{g} \rar{r}
      & A \dar[swap]{f} \\
B \rar[swap]{i}   \ar[bend right,equal]{rr}
      & Y \rar[swap]{\beta}
          & B
\end{tikzcd}
\end{document}

Output

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .