5

I've tried looking for solutions but didn't find any.

I have the following commutative diagram (mwe)

\documentclass{article} \usepackage{tikz-cd} \begin{document} \begin{tikzcd} 0 \arrow[hookrightarrow]{r} & A\arrow[hookrightarrow]{r}{\varphi}\arrow[hookrightarrow]{d}{\eta_1} & B\arrow{r}{\psi}\arrow{d}{\eta_2} & C\arrow{r}\arrow{d}{\eta_3} & 0 \\ 0 \arrow[hookrightarrow]{r} & A'\arrow[hookrightarrow]{r}[swap]{\varphi'} & B'\arrow{r}[swap]{\psi'} & C'\arrow{r} & 0 \end{tikzcd} \end{document} 

But the commutative diagram looks like this:

enter image description here

As you can see, the hook of the first vertical arrow is oddly reversed. I have tried using

\arrow[d, hook']{d} 

instead, but this just flips the entire inclusion arrow -- in this case the hook is at least facing the correct direction, but the entire arrow does not.

What causes this issue?

1
  • 2
    Update the package and recompile Commented Feb 9 at 7:32

1 Answer 1

4

I tried your code with TeX Live distributions from 2012 to 2024, but never obtained the output you show in the image.

You're likely using an outdated version of the packages. Update your TeX systems. You should also use a friendlier syntax for the arrows, where you don't need to remember the order of arguments. This has been possible (at least) with tikz-cd 2014/03/08 v0.9b or later (and tikz 2013/12/13 v3.0.0).

\documentclass{article} \usepackage{tikz-cd} \begin{document} \begin{tikzcd} 0 \arrow[hook,r] & A\arrow[hook,r,"\varphi"] \arrow[hook,d,"\eta_1"] & B\arrow[r,"\psi"] \arrow[d,"\eta_2"] & C\arrow[r] \arrow[d,"\eta_3"] & 0 \\ 0 \arrow[hook,r] & A'\arrow[hook,r,"\varphi'"'] & B'\arrow[r,"\psi'"'] & C'\arrow[r] & 0 \end{tikzcd} \end{document} 

You use ' after the label to mean swap. Similarly, hook' would reflect the position of the hook around the arrow stem.

output

1
  • 1
    Thanks egreg, as Stephen mentioned, it seems to be indeed caused by an outdated Tex Live distribution from 2021. Unfortunately, I was unable to update it (failed to follow the suggested steps to do so via terminal commands) and I have no idea how to do this via Texifier (formerly TexPad). But this is a different matter. Thanks for your help! Commented Feb 9 at 11:00

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.