4

I want all arrows in my tikzcd diagrams to have labels over them, as in the example below.

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}
\begin{tikzcd}[sep = large]
T
\arrow[drr, bend left, "x" description]
\arrow[ddr, bend right, "y" description] 
\arrow[dr, dotted, "{(x,y)}" description] & & \\
& X \times_Z Y \arrow[r, "p" description] \arrow[d, "q" description] & X 
\arrow[d, "f" description] \\ 
& Y \arrow[r, "g" description] & Z 
\end{tikzcd}
\end{document}

But I don't want to write all those ‘description’s. Is it possible to set an option to the tikzcd environment that makes it default? Is it also possible to have an option for \arrow that restores the usual behaviour for that arrow?

3

Use labels=description:

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}
\begin{tikzcd}[sep = large,labels=description]
T
\arrow[drr, bend left, "x"]
\arrow[ddr, bend right, "y"]
\arrow[dr, dotted, "{(x,y)}"] & & \\
& X \times_Z Y \arrow[r, "p"] \arrow[d, "q"] & X
\arrow[d, "f"] \\
& Y \arrow[r, "g"] & Z
\end{tikzcd}
\end{document}

enter image description here

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.