Closed kbauer closed 6 years ago
This is actually roughly the same issue as #9, and due to a \protect
use before issuing the \axp@tmp
command. The problem is, if I do not protect it, some document classes behave stupidly (trying to uppercase the counter name in section headers). I need to take some time to think how to solve this issue in the cleanest way possible.
Just to be clear: This means that putting the \ref
directly in the \axp@section
would yield undesirable results?
diff --git a/apxproof.dtx b/apxproof.dtx
index 02010c8..46afcf4 100644
--- a/apxproof.dtx
+++ b/apxproof.dtx
@@ -1165,12 +1165,10 @@ This is a citation in the appendix~\cite{proofsAreHard}.
\ifx\axp@sectitle\@empty
\else
\immediate\write\axp@proofsfile{%
- \noexpand\def\noexpand\axp@tmp{%
- \noexpand\ref{axp@s\roman{axp@seccounter}}%
- }
\noexpand\axp@section{%
- \noexpand\appendixsectionformat{\protect\noexpand\axp@tmp}%
- {\axp@sectitle}%
+ \noexpand\appendixsectionformat{%
+ \protect\noexpand\ref{axp@s\roman{axp@seccounter}}%
+ }{\axp@sectitle}%
}%
}%
\nosectionappendix
Accidential close...
Ah, I see... This ends up uppercasing the label of the reference.
LaTeX Warning: Reference `AXP@SIV' on page 3 undefined on input line 7.
Having created a testfile
\documentclass{article}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{../../apxproof}
\makeatletter
\let\bibliography\@gobble
\let\bibliographystyle\@gobble
\makeatother
\input{../common}
I noticed, that the error only occurs when the last page is using \axp@tmp
in the header, i.e. it is undefined by \end{document}
: Without the \let\bilbiography[style]\relax
the last header is the bibliography, and no error occurs.
I think, the solution may be as easy as adding \noexpand\global
before \noexpand\def\noexpand\axp@tmp
:
diff --git a/apxproof.dtx b/apxproof.dtx
index 02010c8..58a4bdd 100644
--- a/apxproof.dtx
+++ b/apxproof.dtx
@@ -1165,7 +1165,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
\ifx\axp@sectitle\@empty
\else
\immediate\write\axp@proofsfile{%
- \noexpand\def\noexpand\axp@tmp{%
+ \noexpand\global\noexpand\def\noexpand\axp@tmp{%
\noexpand\ref{axp@s\roman{axp@seccounter}}%
}
\noexpand\axp@section{%
Thanks for the fix! Merged in 926c39b after minor corrections. This seems to solve most issues with fancyhdr
and \tableofcontents
.
The
apxproof
package is incompatible with\fancyhdr
and\pagestyle{fancy}
, causing an "Undefined command sequence" error upon typesetting the header.The issue seems to be caused by the use of
\axp@tmp
in the.axp
file, as by the time the header is typeset, including the section title, this macro may no longer be assigned.Minimal working example