I use tikz-cd to draw my commutative diagrams, like the following:

        \begin{tikzcd}[row sep=scriptsize]
            0 \rar & X \dar["\tilde p", hook, dashed] \rar["x", hook]\ar["\scriptscriptstyle(*)", phantom, dr] & Y \dar["p", two heads]\rar["y", two heads] & Z \dar[equal]\rar & 0\\
            0 \rar & U \rar["u"', hook] & V \rar["v"', two heads] & W \rar & 0

enter image description here

I want to draw the picture for the dual diagram, which is obtained by the following transformations:

  • hooks and double headed tips are exchanged.
  • labels of dashed arrows obtain a prime, unless:
  • they have a bar or a tilde. In this case, bars and tildes are exchanged.
  • $x$- and $y$-coordinates are inverted.

Is it possible to just write down the primal diagram and let TikZ build the dual one automatically?

  • Maybe it's possible, but you employ (waste?) more time in trying to do it than to retype the diagram. Side note: I believe that \arrow[r,<other options>] is clearer than \rar \dar and similar.
    – egreg
    Mar 29, 2020 at 9:07
  • @egreg That's probably true; I just have to wonder how to best write the diagrams in such a way that if I change one, it's easy to find the necessary elements to change in the other.
    – Bubaya
    Mar 29, 2020 at 9:09
  • 2
    Can you please enhance the example so that's is compilable? Starting with \documentclass... and ending with \end{document}. That well make it easier to experiment with your code, without having to guess the packages loaded and so on... Thanks!
    – Rmano
    Mar 29, 2020 at 9:46
  • @Rmano Sorry; changed.
    – Bubaya
    Mar 29, 2020 at 11:55
  • 2
    Maybe you can start from here.
    – user194703
    Mar 29, 2020 at 12:18


You must log in to answer this question.

Browse other questions tagged .