Skip to content

Commit

Permalink
Fix compilation of documents using hyperref after \newtheoremrep is i…
Browse files Browse the repository at this point in the history
…ssued
  • Loading branch information
PierreSenellart committed Aug 6, 2018
1 parent e846906 commit 6b19888
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apxproof.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
%</driver>
% \fi
%
% \CheckSum{711}
% \CheckSum{716}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
Expand Down Expand Up @@ -1052,6 +1052,8 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% in the |.aux| file, so we need to to be able to disable
% addition of the hyperlink, which is why we use an
% intermediate |\axp@forward@link|\marg{target}\marg{text} macro,
% We also redefine |\theHfoobar| which is used by |hyperref| but not
% defined if |hyperref| was loaded after |\newtheoremrep| was used.
% and |\protect| it to output it verbatim into the |.aux| file.
%
% These hyperlinks are of course disabled in the |strip| compilation
Expand All @@ -1062,6 +1064,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
\global\booltrue{axp@forward}%
\ifcsundef{axp@old@the\csname axp@cn@#1\endcsname}{%
\csletcs{axp@old@the\csname axp@cn@#1\endcsname}{the\csname axp@cn@#1\endcsname}%
\csletcs{theH\csname axp@cn@#1\endcsname}{the\csname axp@cn@#1\endcsname}%
\csdef{the\csname axp@cn@#1\endcsname}{%
\protect\axp@forward@link{axp@fw@r\roman{axp@rpcounter}}%
{\csname axp@old@the\csname axp@cn@#1\endcsname\endcsname}%
Expand Down
Binary file modified apxproof.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions apxproof.sty
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
\global\booltrue{axp@forward}%
\ifcsundef{axp@old@the\csname axp@cn@#1\endcsname}{%
\csletcs{axp@old@the\csname axp@cn@#1\endcsname}{the\csname axp@cn@#1\endcsname}%
\csletcs{theH\csname axp@cn@#1\endcsname}{the\csname axp@cn@#1\endcsname}%
\csdef{the\csname axp@cn@#1\endcsname}{%
\protect\axp@forward@link{axp@fw@r\roman{axp@rpcounter}}%
{\csname axp@old@the\csname axp@cn@#1\endcsname\endcsname}%
Expand Down
13 changes: 13 additions & 0 deletions examples/hyperref-after-newtheorem/test.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
\documentclass{article}

\usepackage{../../apxproof}
\newtheoremrep{proposition}{Proposition}
\usepackage{hyperref}

\begin{document}
\begin{propositionrep}
Foo.
\end{propositionrep}
\end{document}


0 comments on commit 6b19888

Please sign in to comment.