texlive[60412] Master/texmf-dist: apxproof (4sep21)
commits+karl at tug.org
commits+karl at tug.org
Sat Sep 4 00:07:38 CEST 2021
Revision: 60412
http://tug.org/svn/texlive?view=revision&revision=60412
Author: karl
Date: 2021-09-04 00:07:38 +0200 (Sat, 04 Sep 2021)
Log Message:
-----------
apxproof (4sep21)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/apxproof/apxproof.pdf
trunk/Master/texmf-dist/source/latex/apxproof/apxproof.dtx
trunk/Master/texmf-dist/tex/latex/apxproof/apxproof.sty
Modified: trunk/Master/texmf-dist/doc/latex/apxproof/apxproof.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/apxproof/apxproof.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/apxproof/apxproof.dtx 2021-09-03 22:07:13 UTC (rev 60411)
+++ trunk/Master/texmf-dist/source/latex/apxproof/apxproof.dtx 2021-09-03 22:07:38 UTC (rev 60412)
@@ -24,7 +24,7 @@
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
%<package>\ProvidesPackage{apxproof}
-%<package> [2021/06/23 v1.2.2 Automatic proofs in appendix]
+%<package> [2021/09/03 v1.2.3 Automatic proofs in appendix]
%
%<*driver>
\documentclass{ltxdoc}
@@ -45,7 +45,7 @@
%</driver>
% \fi
%
-% \CheckSum{828}
+% \CheckSum{864}
%
% \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
@@ -400,6 +400,15 @@
% |\ref{|\meta{counter}|-apx}| references the counter in the appendix
% (except in |inline| mode, where both have the same effect).
%
+% \DescribeOption{forwardlinking}
+% Another customization option concerns hyperlinking.
+% Usually, when \textsf{hyperref} is loaded, |foobarrep|
+% environments in the main text have their number link to their repetition in the
+% appendix. To suppress this behavior and have |foobarrep| environments
+% treated as if \textsf{hyperref} were not loaded, one can specify the
+% value |no| to the |forwardlinking| option when loading the package. (By
+% default this option is set to |yes|.)
+%
% \subsection{Advanced Features}
% We now describe a few advanced macros and environments, the usage of
% which is limited to special cases:
@@ -489,7 +498,8 @@
% \section{Acknowledgments}
% Thanks to Antoine Amarilli for feedback and proofreading. Thanks to K.~D.
% Bauer for the implementation of the forward-linking mechanism, and
-% for various bugfixes.
+% for various bugfixes. Thanks to Leonid Kostrykin for an initial
+% implementation of the |forwardlinking| option.
%
% \StopEventually{
% \PrintChanges
@@ -596,7 +606,13 @@
\DeclareStringOption[same]{repeqn}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\axp at forwardlinking}
+% \changes{v1.2.3}{2021/07/12}{\texttt{forwardlinking} option}
% \begin{macrocode}
+\DeclareStringOption[yes]{forwardlinking}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
\ProcessLocalKeyvalOptions*
% \end{macrocode}
% We check that the value of the options are valid, and add a
@@ -636,6 +652,19 @@
package apxproof}
}}
% \end{macrocode}
+% \begin{macro}{\axp at forward@suppress}
+% \begin{macrocode}
+\newbool{axp at forward@suppress}
+\ifthenelse{\equal{\axp at forwardlinking}{yes}}{
+}{\ifthenelse{\equal{\axp at forwardlinking}{no}}{
+ \message{apxproof: Disable forward linking}
+ \global\booltrue{axp at forward@suppress}%
+}{
+ \errmessage{Error: unsupported option forwardlinking=\axp at repeqn\ for
+ package apxproof}
+}}
+% \end{macrocode}
+% \end{macro}
% \subsection{Macros Common to All Compilation Modes}
% \begin{macro}{\axp at newtheoremrep@definetheorem}
% \changes{v1.2.0}{2019/10/01}{Restore predefined theorem counters}
@@ -1094,6 +1123,11 @@
\noexpand\setcounter{equation}{\theaxp at equation}%
}%
}{}%
+ \ifbool{axp at forward@suppress}{%
+ \global\def\axp at refstar{\ref*}
+ }{%
+ \global\def\axp at refstar{\ref}
+ }
\immediate\write\axp at proofsfile{{%
\ifdefined\theopargself
\noexpand\theopargself
@@ -1107,7 +1141,7 @@
\fi
\noexpand\begin{axp@#1rp}
[%
- \noexpand\ref{axp at r\roman{axp at rpcounter}}%
+ \noexpand\axp at refstar{axp at r\roman{axp at rpcounter}}%
\@ifnotempty{##1}{%
\ifdefined\theopargself
\else
@@ -1203,7 +1237,7 @@
% \begin{macrocode}
\newbool{axp at forward}
\newcommand{\axp at forward@link}[2]{%
- \ifbool{axp at forward}{%
+ \ifboolexpr{ bool {axp at forward} and not bool {axp at forward@suppress} }{%
\ifcsdef{hyperlink}{%
\hyperlink{#1}{#2}%
}{%
@@ -1489,6 +1523,9 @@
% bibliography is called \texttt{\textbackslash bibname}}
% \changes{v1.2.1}{2020/02/27}{Ad hoc fix for \textsf{natbib}
% package conflict}
+% \changes{v1.2.3}{2021/08/03}{More robust redefinition of
+% \texttt{thebibliography} environment, for compatibility with
+% \textsf{tocbibind}}
% \begin{macrocode}
\pretocmd{\@enddocumenthook}{%
\ifdefined\NAT at testdef
@@ -1510,8 +1547,17 @@
\renewcommand{\bibname}{\appendixrefname}
\fi\fi
\let\axp at oldthebibliography\thebibliography
- \renewcommand\thebibliography[1]{%
- \ifx\relax#1\relax\else\axp at oldthebibliography{#1}\fi}
+ \let\endaxp at oldthebibliography\endthebibliography
+ \renewenvironment{thebibliography}[1]{%
+ \def\axp at tmp{#1}%
+ \ifx\axp at tmp\empty
+ \gdef\axp at noappendixbibliography1\relax
+ \else
+ \begin{axp at oldthebibliography}{#1}%
+ \fi
+ }{%
+ \ifdefined\axp at noappendixbibliography\relax\else\end{axp at oldthebibliography}%
+ \fi}
\appendixbibliographyprelim
\putbib
\end{bibunit}
Modified: trunk/Master/texmf-dist/tex/latex/apxproof/apxproof.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/apxproof/apxproof.sty 2021-09-03 22:07:13 UTC (rev 60411)
+++ trunk/Master/texmf-dist/tex/latex/apxproof/apxproof.sty 2021-09-03 22:07:38 UTC (rev 60412)
@@ -27,7 +27,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{apxproof}
- [2021/06/23 v1.2.2 Automatic proofs in appendix]
+ [2021/09/03 v1.2.3 Automatic proofs in appendix]
\RequirePackage{environ}
\RequirePackage{etoolbox}
\RequirePackage{fancyvrb}
@@ -54,6 +54,7 @@
\DeclareStringOption[append]{appendix}
\DeclareStringOption[separate]{bibliography}
\DeclareStringOption[same]{repeqn}
+\DeclareStringOption[yes]{forwardlinking}
\ProcessLocalKeyvalOptions*
\ifthenelse{\equal{\axp at appendix}{append}}{
\message{apxproof: Appendix material appended to the document}
@@ -82,6 +83,15 @@
\errmessage{Error: unsupported option repeqn=\axp at repeqn\ for
package apxproof}
}}
+\newbool{axp at forward@suppress}
+\ifthenelse{\equal{\axp at forwardlinking}{yes}}{
+}{\ifthenelse{\equal{\axp at forwardlinking}{no}}{
+ \message{apxproof: Disable forward linking}
+ \global\booltrue{axp at forward@suppress}%
+}{
+ \errmessage{Error: unsupported option forwardlinking=\axp at repeqn\ for
+ package apxproof}
+}}
\def\axp at newtheoremrep@definetheorem#1#2#3#4{%
\expandafter\let\csname #1\endcsname\undefined
\ifcsname c@#1\endcsname
@@ -255,6 +265,11 @@
\noexpand\setcounter{equation}{\theaxp at equation}%
}%
}{}%
+ \ifbool{axp at forward@suppress}{%
+ \global\def\axp at refstar{\ref*}
+ }{%
+ \global\def\axp at refstar{\ref}
+ }
\immediate\write\axp at proofsfile{{%
\ifdefined\theopargself
\noexpand\theopargself
@@ -268,7 +283,7 @@
\fi
\noexpand\begin{axp@#1rp}
[%
- \noexpand\ref{axp at r\roman{axp at rpcounter}}%
+ \noexpand\axp at refstar{axp at r\roman{axp at rpcounter}}%
\@ifnotempty{##1}{%
\ifdefined\theopargself
\else
@@ -316,7 +331,7 @@
}}%
\newbool{axp at forward}
\newcommand{\axp at forward@link}[2]{%
- \ifbool{axp at forward}{%
+ \ifboolexpr{ bool {axp at forward} and not bool {axp at forward@suppress} }{%
\ifcsdef{hyperlink}{%
\hyperlink{#1}{#2}%
}{%
@@ -455,8 +470,17 @@
\renewcommand{\bibname}{\appendixrefname}
\fi\fi
\let\axp at oldthebibliography\thebibliography
- \renewcommand\thebibliography[1]{%
- \ifx\relax#1\relax\else\axp at oldthebibliography{#1}\fi}
+ \let\endaxp at oldthebibliography\endthebibliography
+ \renewenvironment{thebibliography}[1]{%
+ \def\axp at tmp{#1}%
+ \ifx\axp at tmp\empty
+ \gdef\axp at noappendixbibliography1\relax
+ \else
+ \begin{axp at oldthebibliography}{#1}%
+ \fi
+ }{%
+ \ifdefined\axp at noappendixbibliography\relax\else\end{axp at oldthebibliography}%
+ \fi}
\appendixbibliographyprelim
\putbib
\end{bibunit}
More information about the tex-live-commits
mailing list.