3

I'm having two issues in Tikz-cd in trying to make the following picture: enter image description here

which appears in Categories for the Working Mathematician by Saunders Mac Lane. I've looked at the documentation for Tikz-cd, and their example isn't very helpful.

My code so far:

    \begin{tikzcd}[row sep = 1.4cm, column sep = 1.4cm]
        F(c)
        \arrow[lddr, to path= { --
        ([xshift=-1ex]\tikztostart.west)
        -| ([xshift=-2ex]\tikztotarget.west)
        |- (\tikztotarget)}]
        \arrow[d, swap, "\sigma(c)"]
        \arrow[r, "F(f)"] 
        & F(c')
        \arrow[d, "\sigma(c')"]
        \arrow[rddl, to path= { --
        ([xshift=1ex]\tikztostart.east) 
        -| ([xshift=2ex]\tikztotarget.east)
        -- (\tikztotarget)}, "\sigma \circ \tau(c')"]
        \\
        G(c)
        \arrow[d, swap, "\tau(c)"] 
        \arrow[r, "G(f)"] & G(c')
        \arrow[d, "\tau(c')"] \\
        H(c) 
        \arrow[r, "H(f)"] & H(c')
    \end{tikzcd}    

which generates: enter image description here

My problem: In my diagram, the outside arrows (i.e., the one starting at F(c) and ending at H(c) and the other at F(c') and ending at H(c')) are too close to the diagram. Is it possible to horizontally shift them?

It's okay if it's not, but I'd at least like to add some nodes to the outside arrows. I can't seem to do that. I can do this the hard way by putting the diagram in a Tikzpicture node and positioning the desired labels around the diagram, but I'd like to learn the Tikz-cd way. I know it's possible, since the documentation says so, it just barely says how.

Documentation I'm referring to (page 12): http://ctan.math.washington.edu/tex-archive/graphics/pgf/contrib/tikz-cd/tikz-cd-doc.pdf

0

1 Answer 1

5

Basically, I added node[near end, left]{} and node[near end, right]{} to insert the labels and fixed the values of xshift to be symetric, eg, +/- 3ex.

enter image description here

\documentclass[border=1mm]{standalone}
\usepackage{amsthm,amsmath,amssymb,amsfonts}
\usepackage{tikz-cd}

\begin{document}
\begin{tikzcd}[row sep = 1.4cm, column sep = 1.4cm]
    F(c)
    \arrow[lddr, to path= {%
     -|  ([xshift=-3ex]\tikztotarget.west)node[near end,left]{$\tau\cdot\sigma(c)$}
      |- (\tikztotarget)}]
    \arrow[d, swap, "\sigma(c)"]
    \arrow[r, "F(f)"] 
  & F(c')
    \arrow[d, "\sigma(c')"]
    \arrow[rddl, to path= {%
     -| ([xshift=3ex]\tikztotarget.east)node[near end,right]{$\tau\cdot\sigma(c')$}
     -- (\tikztotarget)}]
  \\
    G(c)
    \arrow[d, swap, "\tau(c)"] 
    \arrow[r, "G(f)"] 
  & G(c')
    \arrow[d, "\tau(c')"]
  \\
    H(c) 
    \arrow[r, "H(f)"]
  & H(c')
\end{tikzcd} 
\end{document}
2
  • @Schrödinger'scat, hello!! Let me see and test.
    – Sigur
    Commented Aug 22, 2019 at 21:51
  • @Schrödinger'scat, edited. Thanks.
    – Sigur
    Commented Aug 22, 2019 at 21:55

You must log in to answer this question.

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