3

I'd like to draw a diagram with tikz-cd for a composition of natural transformations between functors that looked like the following

enter image description here

The best I could do so far is given by the following code:

\documentclass{article}
\usepackage{amsmath,amsfonts}
\usepackage{tikz-cd}
\begin{document}
    \[
        \begin{tikzcd}[row sep=huge]
            \mathcal{A} \arrow[r, bend left=65, "F"]\arrow[r, "G", swap]\arrow[r, bend right=65, "H", swap] &   \mathcal{B}.
        \end{tikzcd} 
    \]
\end{document}

I'm wondering how to put G over the middle arrow and how to draw the vertical arrows \alpha and \beta.

4

Here is one option:

enter image description here

\documentclass{article}
\usepackage{amsmath,amsfonts}
\usepackage{tikz-cd}
\begin{document}
\[
\begin{tikzcd}[row sep=huge]
    \mathcal{A}
     \arrow[r, bend left=65, "F"{name=F}]
     \arrow[r, "G"{inner sep=0,fill=white,anchor=center,name=G}]
     \arrow[r, bend right=65, "H"{name=H, swap}]
     \arrow[from=F.south-|G,to=G,Rightarrow,shorten=2pt,"\alpha"] 
     \arrow[from=G,to=H.north-|G,Rightarrow,shorten=2pt,"\beta"] &
   \mathcal{B}.
\end{tikzcd} 
\]
\end{document}
  • It looks perfect! But I get an error message: "I do not know the key to which you passed '2pt'..." and then "I think the culprit is a tikzcd arrow in 1-1". – Vladimir Feb 11 at 21:30
  • @Vladimir Do you get that with the exact code in my answer? – Torbjørn T. Feb 11 at 21:35
  • Yes, with that exact code and nothing else. – Vladimir Feb 11 at 21:44
  • @Vladimir Hm, don't really know why that would be. My only wild guess would be that you have an older version of tikz-cd. I have v0.9f. If you compile \listfiles \documentclass{article} \usepackage{tikz-cd} \begin{document} a \end{document} you'll get a list of packages with their version numbers near the end of the .log file. – Torbjørn T. Feb 11 at 21:47
1

This is my option. Now there is the vertical alignment.

enter image description here

\documentclass{article}
\usepackage{amsmath,amsfonts}
\usepackage{tikz-cd}
\usepackage{mathrsfs} 
\usepackage{graphicx}

\begin{document}
\[
\begin{tikzcd}[row sep=huge]
\mathscr{A} \arrow[r, "F"{sloped,above},"\hspace{0.15cm}\scalebox{1.5}{$\Downarrow$} \alpha"{sloped,below}, bend left=70] \arrow[r, "\hspace{0.15cm}\scalebox{1.5}{$\Downarrow$} \beta", "H"{sloped,below}, bend right=70] \arrow[r, "G" description] & \mathscr{B}
\end{tikzcd}
\]
\end{document}

Or with another package \usepackage{scalerel}.

enter image description here

\documentclass{article}
\usepackage{amsmath,amsfonts}
\usepackage{tikz-cd}
\usepackage{mathrsfs} 
\usepackage{scalerel}

\begin{document}
\[
\begin{tikzcd}[row sep=huge]
\mathscr{A} \arrow[r, "F"{sloped,above},"\hspace{0.15cm}\mathrel{\stretchto{\Downarrow}{2.6ex}} \alpha"{sloped,below}, bend left=65] \arrow[r, "\hspace{0.15cm}\mathrel{\stretchto{\Downarrow}{3ex}} \beta", "H"{sloped,below}, bend right=65] \arrow[r, "G" description] & \mathscr{B}
\end{tikzcd}
\]
\end{document}

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.