texlive[59683] Master/texmf-dist: apxproof (23jun21)

commits+karl at tug.org commits+karl at tug.org
Wed Jun 23 21:43:39 CEST 2021


Revision: 59683
          http://tug.org/svn/texlive?view=revision&revision=59683
Author:   karl
Date:     2021-06-23 21:43:39 +0200 (Wed, 23 Jun 2021)
Log Message:
-----------
apxproof (23jun21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/apxproof/README.md
    trunk/Master/texmf-dist/doc/latex/apxproof/apxproof.pdf
    trunk/Master/texmf-dist/source/latex/apxproof/apxproof.dtx
    trunk/Master/texmf-dist/source/latex/apxproof/apxproof.ins
    trunk/Master/texmf-dist/tex/latex/apxproof/apxproof.sty

Modified: trunk/Master/texmf-dist/doc/latex/apxproof/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/apxproof/README.md	2021-06-23 15:01:05 UTC (rev 59682)
+++ trunk/Master/texmf-dist/doc/latex/apxproof/README.md	2021-06-23 19:43:39 UTC (rev 59683)
@@ -34,7 +34,7 @@
 
 ## License
 
-Copyright © 2016-2020 by Pierre Senellart.
+Copyright © 2016-2021 by Pierre Senellart.
 
 This work may be distributed and/or modified under the conditions of the
 LaTeX Project Public License, either version 1.3 of this license or (at

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-06-23 15:01:05 UTC (rev 59682)
+++ trunk/Master/texmf-dist/source/latex/apxproof/apxproof.dtx	2021-06-23 19:43:39 UTC (rev 59683)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% Copyright (C) 2016-2020 by Pierre Senellart
+% Copyright (C) 2016-2021 by Pierre Senellart
 %
 % This work may be distributed and/or modified under the
 % conditions of the LaTeX Project Public License, either version 1.3
@@ -24,7 +24,7 @@
 % \iffalse
 %<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
 %<package>\ProvidesPackage{apxproof}
-%<package>  [2020/10/15 v1.2.1 Automatic proofs in appendix]
+%<package>  [2021/06/23 v1.2.2 Automatic proofs in appendix]
 %
 %<*driver>
 \documentclass{ltxdoc}
@@ -45,7 +45,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{813}
+% \CheckSum{828}
 %
 % \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
@@ -468,7 +468,7 @@
 % Issues not listed here should be reported to the author.
 %
 % \section{License}
-% Copyright \textcopyright{} 2016--2020 by Pierre Senellart.
+% Copyright \textcopyright{} 2016--2021 by Pierre Senellart.
 % 
 % This work may be distributed and/or modified under the conditions of the
 % \LaTeX{} Project Public License, either version 1.3 of this license or (at
@@ -526,6 +526,11 @@
 %    \begin{macrocode}
 \RequirePackage{kvoptions}
 %    \end{macrocode}
+% \item \textsf{catchfile} to be able to check the content of files
+% |\input| within appendix content.
+%    \begin{macrocode}
+\RequirePackage{catchfile}
+%    \end{macrocode}
 % \item \textsf{amsthm} for its |\newteorem| macro.
 % Some document classes (e.g., \textsf{lipics})
 % preload \textsf{amsthm}: this is fine, |\RequirePackage{amsthm}|
@@ -968,7 +973,6 @@
       \def\FV at ProcessLine{\immediate\write\axp at proofsfile}%
       \let\FV at FontScanPrep\relax
       \let\@noligs\relax
-      \immediate\write\axp at proofsfile{\noexpand\makeatother}%
       \def\FV at CatCodesHook{}%
       \FV at Scan}
   \def\FVE at axp@VerbatimOut{%
@@ -1035,6 +1039,8 @@
 % We save the equation counter
 % before typesetting the theorem environment, to reset it to the same
 % value in the repeated environment when |repeqn| is set to |same|.
+% \changes{v1.2.2}{2020/11/25}{Fix handling of optional arguments of
+% repeated theorems containing optional arguments}
 %    \begin{macrocode}
     \NewEnviron{#1rep}[1][]{%
       \ifthenelse{\equal{\axp at repeqn}{same}}{%
@@ -1044,7 +1050,7 @@
       \ifx\relax##1\relax
         \axp at with@forward{#1}{\begin{#1}}\label{axp at r\roman{axp at rpcounter}}%
       \else
-        \axp at with@forward{#1}{\begin{#1}[##1]}\label{axp at r\roman{axp at rpcounter}}%
+        \axp at with@forward{#1}{\begin{#1}[{##1}]}\label{axp at r\roman{axp at rpcounter}}%
       \fi
       \mainbodyrepeatedtheorem
       \BODY\end{#1}%
@@ -1081,6 +1087,7 @@
 % \changes{v1.2.0}{2019/10/07}{Fix display of theorem notes}
 %    \begin{macrocode}  
       \axp at writesection%
+      \immediate\write\axp at proofsfile{\noexpand\makeatletter}%
       \ifthenelse{\equal{\axp at repeqn}{same}}{%
         \immediate\write\axp at proofsfile{%
           \noexpand\setcounter{axp at equationx}{\value{equation}}%
@@ -1112,7 +1119,7 @@
                   \noexpand\fi
                 \fi
               \fi  
-              {} (\unexpanded{##1})%
+              {} (\unexpanded{{##1}})%
             }%
           ]%
           \noexpand\axp at forward@target{axp at fw@r\roman{axp at rpcounter}}{}%
@@ -1256,7 +1263,7 @@
     {%
       \axp at writesection
       \immediate\write\axp at proofsfile{%
-        \noexpand\begin{axp at oldproof}%
+        \noexpand\makeatletter\noexpand\begin{axp at oldproof}\noexpand\makeatother%
       }%
       \axp at VerbatimOut
     }
@@ -1316,21 +1323,28 @@
 %    \end{macrocode}  
 % \end{macro}  
 % \begin{macro}{\axp at section}  
-% \begin{macro}{\axp@@ssection}  
-% \begin{macro}{\axp@@section}  
-% This command behaves similarly to |\axp at oldsection|, except that it first
-% tests whether a |\section| follows, and if so, does not produce
-% anything. This is useful to avoid producing empty sections in the
-% appendix. As usual, we have to process starred and unstarred version
-% separately.
+% \changes{v1.2.2}{2021/06/23}{Detect a section within an included
+% file to avoid produced useless sections}
+% \begin{macro}{\axp@@sectiontestinput}
+% \begin{macro}{\axp@@sectiontestsection}
+% This command |\axp at section| behaves similarly to |\axp at oldsection|,
+% except that it first tests whether a |\section| follows, and if so,
+% does not produce anything. This is useful to avoid producing empty
+% sections in the appendix. Using the \textsf{catchfile} package, we
+% also check whether a |\section| is within an |\input| that immediately
+% follows.  
 %    \begin{macrocode}  
-  \def\axp at section{\@ifstar\axp@@ssection\axp@@section}
-  \def\axp@@ssection#1{%
-    \@ifnextchar\section{}{\axp at oldsection*{#1}}%
+  \def\axp at section#1{%
+    \@ifnextchar\input
+      {\axp@@sectiontestinput{#1}}%
+      {\axp@@sectiontestsection{#1}}%
   }
-  \def\axp@@section#1{%
-    \@ifnextchar\section{}{\axp at oldsection{#1}}%
+  \def\axp@@sectiontestinput#1\input#2{%
+    \CatchFileDef{\axp at tmp}{#2}{}%
+    \def\axp at tmptmp{\axp@@sectiontestsection{#1}}%
+    \expandafter\axp at tmptmp\axp at tmp%
   }
+  \def\axp@@sectiontestsection#1{\@ifnextchar\section{\makeatother}{\axp at oldsection{#1}\makeatother}}
 %    \end{macrocode}  
 % \end{macro}  
 % \end{macro}  
@@ -1457,7 +1471,14 @@
 % |\appendixprelim| is issued)
 % within a |bibunit| environment so as to typeset
 % a separate bibliography for the appendix (unless the |bibliography|
-% option is set to |common|). There is an extra test to
+% option is set to |common|). This is done using |\pretocmd| on
+% |\@enddocumenthook| instead of |\AtEndDocument| because we want the
+% code to be run before any code in the |\@enddocumenthook| that has
+% been set in the document class, as in the \textsf{amsart} document
+% class.
+% \changes{v1.2.2}{2021/03/23}{Compatibility with AMS document classes: do not
+% use \texttt{\textbackslash AtEndDocument}}
+% There is an extra test to
 % ensure an empty bibliography environment is not produced.
 % The name of the bibliography is changed to |\appendixrefname|; in most
 % document classes, it is called |\refname| but it is occasionally
@@ -1469,7 +1490,7 @@
 % \changes{v1.2.1}{2020/02/27}{Ad hoc fix for \textsf{natbib}
 % package conflict}
 %    \begin{macrocode}
-    \AtEndDocument{
+    \pretocmd{\@enddocumenthook}{%
       \ifdefined\NAT at testdef
         \renewcommand\bibcite[2]{%
           \global\@namedef{b@#1\@extra at binfo}{#2}%
@@ -1498,7 +1519,7 @@
         \let\bibcite\NAT at testdef
       \fi
       }{}
-    }
+    }{}{}
 %    \end{macrocode}  
 %    \begin{macrocode}  
   }{}

Modified: trunk/Master/texmf-dist/source/latex/apxproof/apxproof.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/apxproof/apxproof.ins	2021-06-23 15:01:05 UTC (rev 59682)
+++ trunk/Master/texmf-dist/source/latex/apxproof/apxproof.ins	2021-06-23 19:43:39 UTC (rev 59683)
@@ -1,5 +1,5 @@
 %%
-%% Copyright (C) 2016-2019 by Pierre Senellart
+%% Copyright (C) 2016-2021 by Pierre Senellart
 %%
 %% This work may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either version 1.3
@@ -26,7 +26,7 @@
 
 \preamble
 
-Copyright (C) 2016-2019 by Pierre Senellart
+Copyright (C) 2016-2021 by Pierre Senellart
 
 This work may be distributed and/or modified under the
 conditions of the LaTeX Project Public License, either version 1.3

Modified: trunk/Master/texmf-dist/tex/latex/apxproof/apxproof.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/apxproof/apxproof.sty	2021-06-23 15:01:05 UTC (rev 59682)
+++ trunk/Master/texmf-dist/tex/latex/apxproof/apxproof.sty	2021-06-23 19:43:39 UTC (rev 59683)
@@ -6,7 +6,7 @@
 %%
 %% apxproof.dtx  (with options: `package')
 %% 
-%% Copyright (C) 2016-2019 by Pierre Senellart
+%% Copyright (C) 2016-2021 by Pierre Senellart
 %% 
 %% This work may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either version 1.3
@@ -27,12 +27,13 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
 \ProvidesPackage{apxproof}
-  [2020/10/15 v1.2.1 Automatic proofs in appendix]
+  [2021/06/23 v1.2.2 Automatic proofs in appendix]
 \RequirePackage{environ}
 \RequirePackage{etoolbox}
 \RequirePackage{fancyvrb}
 \RequirePackage{ifthen}
 \RequirePackage{kvoptions}
+\RequirePackage{catchfile}
 \@ifpackageloaded{amsthm}{
   }{
     \let\apx at oldamsthmproof\proof
@@ -213,7 +214,6 @@
       \def\FV at ProcessLine{\immediate\write\axp at proofsfile}%
       \let\FV at FontScanPrep\relax
       \let\@noligs\relax
-      \immediate\write\axp at proofsfile{\noexpand\makeatother}%
       \def\FV at CatCodesHook{}%
       \FV at Scan}
   \def\FVE at axp@VerbatimOut{%
@@ -239,7 +239,7 @@
       \ifx\relax##1\relax
         \axp at with@forward{#1}{\begin{#1}}\label{axp at r\roman{axp at rpcounter}}%
       \else
-        \axp at with@forward{#1}{\begin{#1}[##1]}\label{axp at r\roman{axp at rpcounter}}%
+        \axp at with@forward{#1}{\begin{#1}[{##1}]}\label{axp at r\roman{axp at rpcounter}}%
       \fi
       \mainbodyrepeatedtheorem
       \BODY\end{#1}%
@@ -248,6 +248,7 @@
                              \endcsname
       \BODY
       \axp at writesection%
+      \immediate\write\axp at proofsfile{\noexpand\makeatletter}%
       \ifthenelse{\equal{\axp at repeqn}{same}}{%
         \immediate\write\axp at proofsfile{%
           \noexpand\setcounter{axp at equationx}{\value{equation}}%
@@ -279,7 +280,7 @@
                   \noexpand\fi
                 \fi
               \fi
-              {} (\unexpanded{##1})%
+              {} (\unexpanded{{##1}})%
             }%
           ]%
           \noexpand\axp at forward@target{axp at fw@r\roman{axp at rpcounter}}{}%
@@ -342,7 +343,7 @@
     {%
       \axp at writesection
       \immediate\write\axp at proofsfile{%
-        \noexpand\begin{axp at oldproof}%
+        \noexpand\makeatletter\noexpand\begin{axp at oldproof}\noexpand\makeatother%
       }%
       \axp at VerbatimOut
     }
@@ -374,13 +375,17 @@
   \let\endnestedproof\endaxp at oldproof
   \newcounter{axp at seccounter}
   \def\axp at sectitle{}
-  \def\axp at section{\@ifstar\axp@@ssection\axp@@section}
-  \def\axp@@ssection#1{%
-    \@ifnextchar\section{}{\axp at oldsection*{#1}}%
+  \def\axp at section#1{%
+    \@ifnextchar\input
+      {\axp@@sectiontestinput{#1}}%
+      {\axp@@sectiontestsection{#1}}%
   }
-  \def\axp@@section#1{%
-    \@ifnextchar\section{}{\axp at oldsection{#1}}%
+  \def\axp@@sectiontestinput#1\input#2{%
+    \CatchFileDef{\axp at tmp}{#2}{}%
+    \def\axp at tmptmp{\axp@@sectiontestsection{#1}}%
+    \expandafter\axp at tmptmp\axp at tmp%
   }
+  \def\axp@@sectiontestsection#1{\@ifnextchar\section{\makeatother}{\axp at oldsection{#1}\makeatother}}
   \let\axp at oldsection\section
   \def\section{\@ifstar\@section\@@section}
   \newcommand{\@section}[2][\relax]{\axp@@@section{*}{#1}{#2}}%
@@ -430,7 +435,7 @@
         \axp at oldbibliography{#1}%
       }
     }{}
-    \AtEndDocument{
+    \pretocmd{\@enddocumenthook}{%
       \ifdefined\NAT at testdef
         \renewcommand\bibcite[2]{%
           \global\@namedef{b@#1\@extra at binfo}{#2}%
@@ -459,7 +464,7 @@
         \let\bibcite\NAT at testdef
       \fi
       }{}
-    }
+    }{}{}
   }{}
   \ifdefined\@acmtitlebox
   \renewenvironment{proofsketch}{\begin{axp at oldproof}[sketch]}{\end{axp at oldproof}}



More information about the tex-live-commits mailing list.