PierreSenellart / apxproof

LaTeX package for automatically putting proof environments in appendix
LaTeX Project Public License v1.3c
23 stars 8 forks source link

Apxproof makes \section brittle #22

Closed kbauer closed 6 years ago

kbauer commented 6 years ago

Apparently apxproof makes the \section command brittle.

With apxproof, using anything other than plain text becomes dangerous, leading to failure of e.g.

\documentclass{article}
\usepackage{apxproof}

\begin{document}

\section{A \textit{B}}

\end{document}

The source of the issue seems to be the line

\def\@section#1{%
  \global\edef\axp@sectitle{#1}%    <-- This one.
  ...
}

Other things that broke for me with apxproof when used in \section commands:

PierreSenellart commented 6 years ago

Thanks for the bug report. Fixed in 6f6101e. The \edef was definitely misguided here.

kbauer commented 6 years ago

Simply removing \edef made some examples fail for me. Combined with #23, I created a pull request for a larger change that should fix both issues.

PierreSenellart commented 6 years ago

Yes, in addition to removing \edef you need to use \expandonce when writing \axp@sectitle to the .apx file, which is what we both did.