Skip to content

Conversation

@piotr-semenov
Copy link
Contributor

@piotr-semenov piotr-semenov commented Oct 21, 2024

If user uses both of moveproofs and hyperref packages together then pdflatex will fail to process TOC for appendix subsections containing proofs. Please, find the minimal non-working example named mnwe.tex below.

\documentclass{article}

\usepackage{lipsum}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}

\usepackage{hyperref}

\usepackage[location=appendix]{moveproofs}


\begin{document}
    \section{Theorems}
    \begin{theorem}\label{th:1}
        \lipsum[2-4]
    \end{theorem}
    \makeproof{th:1}{
        \lipsum[2-4]
    }{Proof of Theorem \ref{th:1}}
\end{document}

If user tries to render mnwe.tex to PDF then will get the error because TOC wants strings for subsection titles rather than TeX code.

> docker run --rm -v $(pwd):/work -w /work -it texlive/texlive:latest latexmk -pdf -pdflatex mnwe.tex

...
! Argument of \pgfkeys@@normal has an extra }.
...

This PR extends the moveproof package's command \appendixproof to handle this case.
This PR was tested with TeX Live 2024 and latexmk v4.85.

@thisisdhaas
Copy link
Owner

@piotr-semenov this looks great, thank you for fixing! Mind adding a comment to the code to explain the exception case for hyperref? (Something like the first sentence of your PR description).

I'm happy to merge this and cut a new release once you've done so.

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

Successfully merging this pull request may close these issues.

2 participants