I would like to label and equation with a tikz duck from the tikzducks package and refer back to it later, like so:
The obvious solution:
\usepackage{tikz}
\usepackage{tikzducks}
\usepackage{amsmath}
\section*{Question 1}
\begin{enumerate}[(a)]
\item
\[a^{2} + b^{2} = c^{2} \tag{$\begin{tikzpicture}[scale=0.2]
\duck
\end{tikzpicture}$} \label{C}\]
From equation \(\eqref{C}\), $b^{2} = c^{2} - a^{2}$.
\end{enumerate}
gives me the error: TeX capacity exceeded, sorry [input stack size=5000]. However when I put the duck elsewhere in the image, I do not get this error, the document compiles and I get to see my duck (quack)!
(I might add that it doesn't matter whether or not the tikzpicture environment is placed inside math mode or not.)
I can't seem to find a way to stop this error from happening.
Thanks for looking at my question.
document
env. Also\(\eqref{C}\),
does not make any sense. What are you trying to do here? – daleif Mar 31 '20 at 8:18\begin{enumerate}[(a)]
– daleif Mar 31 '20 at 8:22mwe
package, see CTAN). It should also be minimal, thus only the package that are relevant for your problem. – daleif Mar 31 '20 at 8:52