\usepackage{amsthm} % causes error. Compiles fine if either this line, or the first line, or both, is commented out.



The limit of a sum is the sum of the limits.


When trying to compile the above MWE, I get the following error:

! Package tagpdf Error: there is no open structure on the stack

If I comment out either the \DocumentMetadata{testphase=phase-III} line, or the \usepackage{amsthm} line, or both, then it compiles as expected.

Or if I leave both lines in, but I comment out the \begin{thrm} and \end{thrm} lines, it will also compile.

I am using TeXworks Version 0.69 (MiKTeX 24.4) in Windows 11 Enterprise. I have used the MiKTeX console to update all packages as of today (June 17, 2024). As of right now if I check for updates in the MiKTeX console, it shows "There are currently no updates available."

I get the same issue using LuaLaTeX, pdfLaTeX, or XeLaTeX.

What can I do to fix/work around this issue?

  • well currently your only option is not to use amsthm, sorry. It overwrites the tagging code. Commented Jun 17 at 17:35
  • 1
    OK, thank you! I did not find that information documented anywhere, but maybe I just wasn't googling the right thing. I'd also be happy to accept this if posted as an answer. Thanks again!
    – mathmandan
    Commented Jun 17 at 17:38
  • well it is more the other way round: as it is not documented that amsthm is compatible you should assume it is not. You could open an issue here github.com/latex3/tagging-project/issues. We know that this is an open issue, but it doesn't harm to track it anyway. Commented Jun 17 at 17:43
  • OK, I understand. Thank you!
    – mathmandan
    Commented Jun 17 at 17:45
  • I opened the issue at GitHub: github.com/latex3/tagging-project/issues/83
    – mathmandan
    Commented Jun 17 at 18:08


You must log in to answer this question.

Browse other questions tagged .