How can I enumerate diagrams made with tikz-cd?
I mean, not only enumerate them but enumerate in order to quote them later in the document.
How can I enumerate diagrams made with tikz-cd?
I mean, not only enumerate them but enumerate in order to quote them later in the document.
You just use the standard equation environment:
\documentclass{article}
\usepackage{amsmath,tikz-cd}
\usepackage{lipsum}% just to have some text
\begin{document}
\lipsum*[2]
\begin{equation}\label{diagram}
\begin{tikzcd}
A\arrow[r,"f"] \arrow[d,"\alpha"] & B \arrow[d,"\beta"] \\
A' \arrow[r,"f'"] & B'
\end{tikzcd}
\end{equation}
\lipsum*[3]
\begin{equation}\label{equation}
A+B+C=D
\end{equation}
some text after the equation just to see the spacing and
for printing the references to diagram~\eqref{diagram}
and to equation~\eqref{equation}.
\end{document}

I can see excess spacing nowhere.
equation and not align. Using align causes all sorts of alignment issues.
– Umang
Dec 12 '15 at 17:54
align only for multiline displays. If you have an actual problem with diagrams in align, please ask a new question.
– egreg
Dec 12 '15 at 17:59
equation is more semantically correct that align for single line equations. I posted my comment just as a warning for anyone who (like me) uses align for all equations. Apparently I've been doing this wrong.
– Umang
Dec 12 '15 at 18:07
equationenvironment. – Sigur Jan 13 '15 at 23:32cleverefpackage. – Bernard Jan 13 '15 at 23:52equation) or do you want something more elaborate as a caption (name+number+separator+description)? – Gonzalo Medina Jan 13 '15 at 23:56