[Tex/LaTex] How to create left arrow in tikzcd

arrowstikz-cd

I want to make the arrows in the following code left, but it gives an error.

 \begin{tikzcd}
1 \arrow[rr,shift left,"\lambda"]
  \arrow[rr,shift right,swap,"\mu"]
&&
3 
\end{tikzcd}

Best Answer

When you do \arrow[rr], that means to draw an arrow from the cell the \arrow is placed in, to the cell that is two columns right. r stands for "right", two rs mean two columns to the right. Similarly, l means left, u means up and d down. I'm assuming you tried something like

\begin{tikzcd}
1 \arrow[ll,shift left,"\lambda"]
  \arrow[ll,shift right,swap,"\mu"]
&&
3 
\end{tikzcd}

but that cannot work because the two arrows are placed in the first column, so there are no columns to the left. To use ll you have to move the arrows to the last column, i.e.

\begin{tikzcd}
1 && 3 
  \arrow[ll,shift left,"\lambda"]
  \arrow[ll,shift right,swap,"\mu"]
\end{tikzcd}

Another option is to add the leftarrow option to the arrows while keeping rr. This will move the arrow tip to the start of the line, instead of the end.

Unrelated note: As egreg mentioned in his comment below, using empty columns to add space is probably not the best approach, it would be better to modify the column sep. You can give a specific length (e.g. column sep=1cm) or use one of the predefined keys (tiny, small, scriptsize normal, large, huge) to set the separation between columns.

Complete example with both options for the arrows, and column sep=huge instead of the empty column:

enter image description here

\documentclass[border=5mm]{standalone}
\usepackage{tikz-cd}

\begin{document}
 \begin{tikzcd}[column sep=huge]
1 &
 \arrow[l,shift right,swap,"\lambda"]
 \arrow[l,shift left,"\mu"]
3  \\
1 
 \arrow[r,leftarrow,shift left,"\lambda"]
 \arrow[r,leftarrow,shift right,swap,"\mu"]
&
3 
\end{tikzcd}
\end{document}
Related Question