From d3746a96d3f419b7854e7c02d1315dd0c827f971 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 3 Sep 2021 22:07:38 +0000 Subject: apxproof (4sep21) git-svn-id: svn://tug.org/texlive/trunk@60412 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/apxproof/apxproof.pdf | Bin 566581 -> 569226 bytes .../texmf-dist/source/latex/apxproof/apxproof.dtx | 60 ++++++++++++++++++--- Master/texmf-dist/tex/latex/apxproof/apxproof.sty | 34 ++++++++++-- 3 files changed, 82 insertions(+), 12 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/apxproof/apxproof.pdf b/Master/texmf-dist/doc/latex/apxproof/apxproof.pdf index 48f0d4638e5..223f7ebad7b 100644 Binary files a/Master/texmf-dist/doc/latex/apxproof/apxproof.pdf and b/Master/texmf-dist/doc/latex/apxproof/apxproof.pdf differ diff --git a/Master/texmf-dist/source/latex/apxproof/apxproof.dtx b/Master/texmf-dist/source/latex/apxproof/apxproof.dtx index 307934752d4..0225d20e776 100644 --- a/Master/texmf-dist/source/latex/apxproof/apxproof.dtx +++ b/Master/texmf-dist/source/latex/apxproof/apxproof.dtx @@ -24,7 +24,7 @@ % \iffalse %\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] % %<*driver> \documentclass{ltxdoc} @@ -45,7 +45,7 @@ % % \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 @@ This is a citation in the appendix~\cite{proofsAreHard}. % |\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 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \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,6 +606,12 @@ This is a citation in the appendix~\cite{proofsAreHard}. \DeclareStringOption[same]{repeqn} % \end{macrocode} % \end{macro} +% \begin{macro}{\axp@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} @@ -636,6 +652,19 @@ This is a citation in the appendix~\cite{proofsAreHard}. package apxproof} }} % \end{macrocode} +% \begin{macro}{\axp@forward@suppress} +% \begin{macrocode} +\newbool{axp@forward@suppress} +\ifthenelse{\equal{\axp@forwardlinking}{yes}}{ +}{\ifthenelse{\equal{\axp@forwardlinking}{no}}{ + \message{apxproof: Disable forward linking} + \global\booltrue{axp@forward@suppress}% +}{ + \errmessage{Error: unsupported option forwardlinking=\axp@repeqn\ for + package apxproof} +}} +% \end{macrocode} +% \end{macro} % \subsection{Macros Common to All Compilation Modes} % \begin{macro}{\axp@newtheoremrep@definetheorem} % \changes{v1.2.0}{2019/10/01}{Restore predefined theorem counters} @@ -1094,6 +1123,11 @@ This is a citation in the appendix~\cite{proofsAreHard}. \noexpand\setcounter{equation}{\theaxp@equation}% }% }{}% + \ifbool{axp@forward@suppress}{% + \global\def\axp@refstar{\ref*} + }{% + \global\def\axp@refstar{\ref} + } \immediate\write\axp@proofsfile{{% \ifdefined\theopargself \noexpand\theopargself @@ -1107,7 +1141,7 @@ This is a citation in the appendix~\cite{proofsAreHard}. \fi \noexpand\begin{axp@#1rp} [% - \noexpand\ref{axp@r\roman{axp@rpcounter}}% + \noexpand\axp@refstar{axp@r\roman{axp@rpcounter}}% \@ifnotempty{##1}{% \ifdefined\theopargself \else @@ -1203,7 +1237,7 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \begin{macrocode} \newbool{axp@forward} \newcommand{\axp@forward@link}[2]{% - \ifbool{axp@forward}{% + \ifboolexpr{ bool {axp@forward} and not bool {axp@forward@suppress} }{% \ifcsdef{hyperlink}{% \hyperlink{#1}{#2}% }{% @@ -1489,6 +1523,9 @@ This is a citation in the appendix~\cite{proofsAreHard}. % 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@testdef @@ -1510,8 +1547,17 @@ This is a citation in the appendix~\cite{proofsAreHard}. \renewcommand{\bibname}{\appendixrefname} \fi\fi \let\axp@oldthebibliography\thebibliography - \renewcommand\thebibliography[1]{% - \ifx\relax#1\relax\else\axp@oldthebibliography{#1}\fi} + \let\endaxp@oldthebibliography\endthebibliography + \renewenvironment{thebibliography}[1]{% + \def\axp@tmp{#1}% + \ifx\axp@tmp\empty + \gdef\axp@noappendixbibliography1\relax + \else + \begin{axp@oldthebibliography}{#1}% + \fi + }{% + \ifdefined\axp@noappendixbibliography\relax\else\end{axp@oldthebibliography}% + \fi} \appendixbibliographyprelim \putbib \end{bibunit} diff --git a/Master/texmf-dist/tex/latex/apxproof/apxproof.sty b/Master/texmf-dist/tex/latex/apxproof/apxproof.sty index ccbfef56bdd..e78762c399f 100644 --- a/Master/texmf-dist/tex/latex/apxproof/apxproof.sty +++ b/Master/texmf-dist/tex/latex/apxproof/apxproof.sty @@ -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@appendix}{append}}{ \message{apxproof: Appendix material appended to the document} @@ -82,6 +83,15 @@ \errmessage{Error: unsupported option repeqn=\axp@repeqn\ for package apxproof} }} +\newbool{axp@forward@suppress} +\ifthenelse{\equal{\axp@forwardlinking}{yes}}{ +}{\ifthenelse{\equal{\axp@forwardlinking}{no}}{ + \message{apxproof: Disable forward linking} + \global\booltrue{axp@forward@suppress}% +}{ + \errmessage{Error: unsupported option forwardlinking=\axp@repeqn\ for + package apxproof} +}} \def\axp@newtheoremrep@definetheorem#1#2#3#4{% \expandafter\let\csname #1\endcsname\undefined \ifcsname c@#1\endcsname @@ -255,6 +265,11 @@ \noexpand\setcounter{equation}{\theaxp@equation}% }% }{}% + \ifbool{axp@forward@suppress}{% + \global\def\axp@refstar{\ref*} + }{% + \global\def\axp@refstar{\ref} + } \immediate\write\axp@proofsfile{{% \ifdefined\theopargself \noexpand\theopargself @@ -268,7 +283,7 @@ \fi \noexpand\begin{axp@#1rp} [% - \noexpand\ref{axp@r\roman{axp@rpcounter}}% + \noexpand\axp@refstar{axp@r\roman{axp@rpcounter}}% \@ifnotempty{##1}{% \ifdefined\theopargself \else @@ -316,7 +331,7 @@ }}% \newbool{axp@forward} \newcommand{\axp@forward@link}[2]{% - \ifbool{axp@forward}{% + \ifboolexpr{ bool {axp@forward} and not bool {axp@forward@suppress} }{% \ifcsdef{hyperlink}{% \hyperlink{#1}{#2}% }{% @@ -455,8 +470,17 @@ \renewcommand{\bibname}{\appendixrefname} \fi\fi \let\axp@oldthebibliography\thebibliography - \renewcommand\thebibliography[1]{% - \ifx\relax#1\relax\else\axp@oldthebibliography{#1}\fi} + \let\endaxp@oldthebibliography\endthebibliography + \renewenvironment{thebibliography}[1]{% + \def\axp@tmp{#1}% + \ifx\axp@tmp\empty + \gdef\axp@noappendixbibliography1\relax + \else + \begin{axp@oldthebibliography}{#1}% + \fi + }{% + \ifdefined\axp@noappendixbibliography\relax\else\end{axp@oldthebibliography}% + \fi} \appendixbibliographyprelim \putbib \end{bibunit} -- cgit v1.2.3