When I use \eqref (from amsmath) in the optional argument to the proof environment (from amsthm) and the three packages thmtools, hyperref, and showkeys are loaded, TeX runs into an infinite loop. Here is a minimal failing example:

\usepackage{amsmath, amsthm} 



\begin{proof}[Proof of~\eqref{simple}]
Count on your fingers.


The error message is:

! TeX capacity exceeded, sorry [parameter stack size=10000].
\@x@protect #1\fi #2#3->
                    \fi \protect #1
l.14 \begin{proof}[Proof of~\eqref{simple}]

No pages of output.

Does anyone know why this is happening and how to fix it?

  • 3
    \protect\eqref – daleif Oct 2 '13 at 10:55
  • Wow. It's that simple. Amazing how the problem surfaces only with a strange combination of packages and circumstances. I guess that's the unpredictability of using fragile commands in moving arguments. – Ari Brodsky Oct 2 '13 at 19:34
  • @daleif an answer? – egreg Oct 4 '14 at 22:11

\eqref is not robust, thus in some cases it needs protection, that is \protect\eqref

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.