Skip to content
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

[BUG] proof-at-the-end-package breaks \chapter macro in komascript classes #11

Closed
mw88-personal opened this issue Aug 24, 2022 · 7 comments

Comments

@mw88-personal
Copy link

Describe the bug
When used in conjunction with any komascript class, e.g. scrbook, scrreport, the loading of package proof-at-the-end breaks the \chapter macro. If I load a different class, e.g. book, it works fine, though.
Can you confirm this is a bug, and suggest a solution, as I really would like to use proof-at-the-end in my notes, and can not deviate from scrbook.

To Reproduce: Minimal Working Example

% file: mwe.tex
\documentclass{scrreport}

\usepackage{proof-at-the-end}

\begin{document}
Test
\chapter{Testchap}
 asdf
\end{document}

produces error output:

$ pdflatex mwe
...
! Missing \endcsname inserted.
<to be read again> 
                   \edef 
l.7 \chapter{Testchap}

Version
Output of latex --version:

$ latex --version
pdfTeX 3.141592653-2.6-1.40.24 (TeX Live 2022)
kpathsea version 6.3.4
Copyright 2022 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.03

Version of proof-at-the-end: 2022/02/07

@tobiasBora
Copy link
Contributor

Thanks a lot for the report. I confirm the bug, I'll investigate now.

@tobiasBora
Copy link
Contributor

tobiasBora commented Aug 24, 2022

Ok so it seems that the problem is coming from the line:

\AtEndPreamble{%
  \RequirePackage{hyperref}
}%

so a quick workaround is to copy the .sty file in your project and to remove this line and to manually load hyperref if needed. Meanwhile I'll look for the proper way to do that in komascript.

-- EDIT --
Argh forget what I just said, I think the problem comes from the way I patch chapters… I'll come back soonish hopefully.

@tobiasBora
Copy link
Contributor

So to disable the error, one can do:

\usepackage[disablePatchSection]{proof-at-the-end}

but then the section will be poorly numbered if you use the text link section. One workaround is to manually add \pratendAddLabel after the chapters like in:

\documentclass{scrreport}

\usepackage[disablePatchSection]{proof-at-the-end}

\begin{document}
Test
\chapter{Testchap}\pratendAddLabel
 asdf
\end{document}

But I'll try to find how to properly patch chapters in komascript.

@mw88-personal
Copy link
Author

Thanks for working on it. I can confirm the workaround #11 (comment) does indeed work.

However, I need to ship this with my own class and sell this package to my collegues, so I would prefer a more durable and standard solution, so this can be only temporary for me.

@tobiasBora
Copy link
Contributor

tobiasBora commented Aug 24, 2022

The lastest version should fix this issue. You can try it by copy/pasting the .sty file in your project, and test it, e.g., using:

\documentclass{scrreport} %% Works with both memoir and scrreport
\usepackage{lipsum}
\usepackage{thmtools}
\usepackage{amsthm}
\usepackage[commandRef=cref,createShortEnv,conf={text link section}]{proof-at-the-end}
\newtheorem{thm}{Theorem}[section]
\usepackage{hyperref}
\usepackage{cleveref}
\crefname{thm}{Theorem}{Theorems}


\begin{document}

\lipsum[1]

\chapter{Here is my title}

\lipsum[1]

\section{Here is my section}\label{mysection}

\begin{thmE}[][end]\label{mytheorem}
Here is my important theorem  
\end{thmE}
\begin{proofE}
  Here is the proof
\end{proofE}

\chapter{Proofs}\label{coucou}

\printProofs

\end{document}

@mw88-personal
Copy link
Author

Thank you, that seems to work. Now I only have to wait till this fix is in the TeXlive repositories.

@tobiasBora
Copy link
Contributor

tobiasBora commented Aug 24, 2022 via email

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