Here is my code.



\newcommand\theorem{\refstepcounter{theorem}Theorem \thetheorem}

\renewcommand\theproof{\arabic{proof} (\thetheorem)}
\newcommand\proof{\refstepcounter{proof}Proof \theproof}

\newcommand\figurec{\refstepcounter{figurec}Figure \thefigurec}


\section{New Section}

\item \theorem

Stuff ...
\item \proof
\[ \begin{tikzpicture}
\node at (2.25,-1.5){\figurec\label{lab2}};
\end{tikzpicture} \]
Stuff ... Figure \ref{lab2}.


Compiling it shows:

enter image description here

If I comment out amsmath I get:

enter image description here

For some reason, having amsmath messes up my labeling inside tikzpicture. I need a way of resolving this issue as I use both packages extensively together. Thanks!

  • 1
    Looks like the behavior is triggered by the enclosing \[ and \], if you leave them out you're back at the desired behavior. Perhaps that's the simplest way to go. – user121799 Jul 20 '18 at 15:27
  • Ah. Strange. Thank you! I replaced them with \begin{center}, \end{center} and now it works perfectly. – Chung Ren Khoo Jul 20 '18 at 15:32

Figured it out thanks to https://tex.stackexchange.com/users/121799/marmot.

Just had to replace

\[ ... \]


\begin{center} ... \end{center}

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.