# Several problems in labeling commutative diagram

I am just trying to put some labels on the right side of some commutative diagrams in order to later reference them. Since I am not labeling all diagrams, as I only need to reference two of them, I would prefer symbols rather than numbers. Anyway, the closest I can get is by typing

$$\label{tre} \begin{center} \begin{tikzcd} S^n(X'') \arrow{d}{S^n(h'')} \arrow{r}{\delta^n_E} & S^{n+1}(X') \arrow{d}{S^{n+1}(h')} \\ S^n(Y'') \arrow{r}{\delta^n_F} & S^{n+1}(Y') \end{tikzcd} \end{center} \tag{\bullet}$$



Now, besides the fact that I get several warnings such as "Package amsmath Error: \tag not allowed here", this only displays the tag "(1.1)" in this left lower corner of my diagram (while I would prefer any label to be on the right and not on a lower line). Even weirder, if I remove the "center" environment, then Overleaf doesn't compile.

I am really confused. Can someone please help me?

• Please add a MWE that we can copy and paste: documentclass and used packages as well as \begin{document} and \end{document}. May 26 at 23:08
• Why are you using center inside an equation in the first place? Plus blank lines are not allowed in math mode. May 26 at 23:17

## 2 Answers

This is not a problem of commutative diagrams or anything related to tikz. This is just a labeling issue that can be solved with amsmath or mathtools. The later provides a command to keep the tag as in the equation. Here is an example:

\documentclass{article}
\usepackage{mathtools}
\usepackage{tikz-cd}
\begin{document}
\begin{equation*}
xyz \label{blah}\tag*{$\bullet$}
\end{equation*}
The equation~\refeq{blah} is easy
\begin{equation*}
\begin{tikzcd}
A\ar{r}{f}\ar{d}[swap]{g} & B\ar{d}{h}\\
C\ar{r}[swap]{k} & D
\end{tikzcd}
\label{foo}\tag*{\&}
\end{equation*}
\textit{The diagram~\ref{foo} is commutative} vs. \textit{The diagram~\refeq{foo} is commutative}
\end{document}


which results in:

First off: blank lines are not allowed inside equation and center is also disallowed. The argument to \tag is typeset as text, so \bullet will lead to an error.

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

\begin{document}

$$\label{tre} \begin{tikzcd} S^n(X'') \arrow[d,"S^n(h'')"] \arrow[r,"\delta^n_E"] & S^{n+1}(X') \arrow[d,"S^{n+1}(h')"] \\ S^n(Y'') \arrow[r,"\delta^n_F"] & S^{n+1}(Y') \end{tikzcd} \tag{\textbullet}$$

\end{document}