2

I wanted it to look like \rightlefttarrows (as in one arrow in top of the other)

 \begin{tikzcd}
 X \ar{r} & \ar[l] B
 \end{tikzcd}

The above code does not have that effect and instead fuses both arrows.

2
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Dec 19, 2021 at 17:15
  • @Community What is not clear about my question? I want an arrow to be on the top of the other, as in the \rightleftarrows symbol, and the code i provided does not do that. Dec 19, 2021 at 17:20

1 Answer 1

2

This can be done using the shift left key (or shift right in the second example). Both produce the same output:

enter image description here

The direction of the shift is from the perspective of "walking along the arrow". So if the arrow is drawn from B to X, the left side is below. But if the arrow is drawn from X to B, then left is above, even if the arrow is pointing "backwards". You can adjust the spacing between the arrows to your liking.

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}

\begin{tikzcd}
X \arrow[r, shift left=2pt] &  B \arrow[l, shift left=2pt]
\end{tikzcd}

\begin{tikzcd}
X \arrow[r, shift left=2pt] \arrow[r, <-, shift right=2pt]&  B 
\end{tikzcd}

\end{document}

You must log in to answer this question.

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