6

I want to draw a triangular 2-cell diagram in tikz. The obvious attempt is the following.

\[\begin{tikzcd}[row sep=3em]
a  \arrow{dr} &
\\ b \arrow{u} \arrow[""{name=foo}]{r} & c
\arrow[Rightarrow, from=foo, to=1-1]  \end{tikzcd}\]

However, the Rightarrow comes far too close to the object a for my liking. I tried shortening it by adding , shorten=2ex but got an error. How can I shorten the Rightarrow but maintain its direction?

1 Answer 1

9

The key to shorten the > end of an arrow is shorten >.

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\[\begin{tikzcd}[row sep=3em]
a  \arrow{dr} &
\\ b \arrow{u} \arrow[""{name=foo}]{r} & c
\arrow[Rightarrow, from=foo, to=1-1,shorten >=1.5ex]  
\end{tikzcd}
\]
\end{document}

enter image description here

I'd probably go for a more symmetric version, though.

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\[\begin{tikzcd}[row sep=3em]
&a  \arrow{dr} & \\ 
b \arrow{ur}  \arrow[""{name=foo}]{rr} && c
\arrow[Rightarrow, from=foo, to=1-2,shorten >=0.5ex]  
\end{tikzcd}
\]
\end{document}

enter image description here

The other end can be shortened with shorten <, and it might be useful to keep in mind that one can make arrows longer by shortening them by a negative distance, e.g. shorten >=-1ex.

1
  • I tried the very same thing but had a syntax error. Ah well. Thanks!
    – Arrow
    Apr 17, 2020 at 20:58

You must log in to answer this question.

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