0

I want to draw the following graph using tikzcd.

enter image description here How should I modify the following?

\begin{tikzcd}
X\ar[Rightarrow, d] \\
Y\ar[d, bend left, "g"]\ar[d, bend right, "f"swap]\\
Z
\end{tikzcd}

Thank you in advance.

5
  • As always in the site, please provide a full but minimal self contained example that others can copy and test as is. Here you have only provided a sniplet and thus others have to add document and class in order to even test the code. The code gives the correct image after I edited the formatting and fixed the \\
    – daleif
    Jan 19, 2021 at 13:47
  • @daleif Thank you.
    – Jian
    Jan 19, 2021 at 13:50
  • See the edit of my comment, your code works just fine
    – daleif
    Jan 19, 2021 at 13:51
  • I would probably add ,pos=0.51 to both of the bendy arrows to move the f and g a bit
    – daleif
    Jan 19, 2021 at 13:52
  • @daleif Sure and thanks. It looks good now.
    – Jian
    Jan 19, 2021 at 13:53

1 Answer 1

1

You only need to add dashed option:

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

\begin{document}
    \begin{tikzcd}[labels={font=\scriptsize, pos=0.51}]
X \ar[d, Rightarrow, dashed]     \\ % <---
Y \ar[d, bend  left, "g"]
  \ar[d, bend right, "f" ']     \\
Z 
    \end{tikzcd}
\end{document}

enter image description here

3
  • @daleif This is not necessary. The code is great.
    – Jian
    Jan 19, 2021 at 13:56
  • @daleif, you are right! Corrected.
    – Zarko
    Jan 19, 2021 at 13:56
  • @Jian you did ask for a dashed arrow, which I did not provide in my comments but Zarko did in this answer
    – daleif
    Jan 19, 2021 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.