4

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

\documentclass{scrartcl}
\usepackage{tikz-cd}
\begin{document}
    \begin{equation}
        \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
        \end{tikzcd}
    \end{equation}
\end{document}

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?

Bubaya
  • 2,279
  • 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 '20 at 09: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 '20 at 09: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 '20 at 09:46
  • @Rmano Sorry; changed. – Bubaya Mar 29 '20 at 11:55
  • 2
    Maybe you can start from here. –  Mar 29 '20 at 12:18
  • @Schrödinger'scat Indeed, that looks like a good starting point. Sorry for not having found this by myself! – Bubaya Mar 30 '20 at 13:07

0 Answers0