Skip to content

\label after an amsthm theorem produces extra horizontal space with pdftex and xetex #835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mbertucci47 opened this issue Apr 25, 2025 · 1 comment

Comments

@mbertucci47
Copy link
Contributor

With pdflatex or xelatex but not lualatex, a \label after an amsthm theorem produces extra horizontal space.

\DocumentMetadata
  {
    lang=en-US,
    pdfversion=2.0,
    pdfstandard=ua-2,
    testphase=latest
  }
\documentclass{article}
\usepackage{kantlipsum}
\usepackage{amsthm}

\newtheorem{lemma}{Lemma}

\begin{document}

\begin{lemma}
\kant[1][1-2]
\end{lemma}
\begin{lemma}\label{foo}
\kant[1][1-2]
\end{lemma}

\end{document}

extra space

This is fixed by putting a % after \label{foo} but this shouldn't be necessary.

The problem doesn't arise with the kernel \newtheorem.

@u-fischer
Copy link
Member

hm yes. The core problem is that with tagging we are already in hmode. One probably will have to put all the code from \@begintheorem into a \deferred@thm@head again, but I don't think that I want to struggle with amsthm now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants