Skip to content

Command \makeproof will fail for appendix mode if hyperref is loaded#6

Open
piotr-semenov wants to merge 2 commits into
thisisdhaas:masterfrom
piotr-semenov:master
Open

Command \makeproof will fail for appendix mode if hyperref is loaded#6
piotr-semenov wants to merge 2 commits into
thisisdhaas:masterfrom
piotr-semenov:master

Conversation

@piotr-semenov
Copy link
Copy Markdown
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
Copy Markdown
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.

@piotr-semenov
Copy link
Copy Markdown
Contributor Author

Hi Daniel @thisisdhaas,

First of all, sorry for my long silence on this PR.

The last couple of years have been quite difficult for me personally (for entire world as well I guess), and I had to step away for much longer than I expected.
Now I’d like to get back.

I’ll comment as you requested, re-check the PR against a current TeX Live setup, and update the PR if needed.

Thank you for your patience, and sorry again for the delay.

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