2

I'm having trouble with something that should be simple in tikz-cd. I want to make a diagram for commutative logic that looks like this:

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd} 
a \arrow[r] \arrow[bend left]{r} & b 
\end{tikzcd}
\end{document}

EXCEPT that I want the arrow on top to point the other direction, right to left. I've read all of the documentation, and neither of the following options work: Option 1 (yields an error):

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd} 
a \arrow[r] \leftarrow[bend left]{r} & b 
\end{tikzcd}
\end{document}

Option 2 (yields something that looks like "a <- [bendlef t]r-> b"):

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd} 
a \arrow[r] \arrow[bend left]{l} & b 
\end{tikzcd}
\end{document}

What am I doing wrong?

Thank you, and happy holidays to all!

2 Answers 2

3

Left arrow is an option, not a command. use it like this:

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd} 
a \arrow[r] \arrow[leftarrow,bend left]{r} & b 
\end{tikzcd}
\end{document}

Result:

enter image description here

1
  • THANK YOU! That works, too, and the documentation I read didn't make it clear that left arrow would be an option within the brackets, not a replacement for \arrow. Dec 27, 2017 at 2:50
3

Why not this way?

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

\begin{document}

\begin{tikzcd}
a \arrow[r] & b\arrow[bend right]{l}
\end{tikzcd}

\end{document} 

You also can use the shorter syntax:

begin{tikzcd}
a \rar & b \lar[bend right]%
\end{tikzcd}

enter image description here

2
  • THANK YOU! That worked! The documentation and examples I read weren't clear, and it's weird that the [r] is in brackets, but the {l} is in curly braces. Dec 27, 2017 at 2:48
  • It also can be put in the brackets: bothwork. You also can use the short notation, see my completed answer.
    – Bernard
    Dec 27, 2017 at 10:46

You must log in to answer this question.

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