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 Answers2

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}
Jake
  • 232,450
  • Yours answers rock! – juliohm Jun 26 '13 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 Jun 26 '13 at 22:25
15

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

Moriambar
  • 11,466
Qrrbrbirlbel
  • 119,821