From 64f6691703e3ee5c5364415c59f5e4e6d6e78be8 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 23 Jun 2021 19:43:39 +0000 Subject: apxproof (23jun21) git-svn-id: svn://tug.org/texlive/trunk@59683 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/apxproof/apxproof.dtx | 67 ++++++++++++++-------- .../texmf-dist/source/latex/apxproof/apxproof.ins | 4 +- 2 files changed, 46 insertions(+), 25 deletions(-) (limited to 'Master/texmf-dist/source/latex/apxproof') diff --git a/Master/texmf-dist/source/latex/apxproof/apxproof.dtx b/Master/texmf-dist/source/latex/apxproof/apxproof.dtx index d02bb77435d..307934752d4 100644 --- a/Master/texmf-dist/source/latex/apxproof/apxproof.dtx +++ b/Master/texmf-dist/source/latex/apxproof/apxproof.dtx @@ -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 %\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] % %<*driver> \documentclass{ltxdoc} @@ -45,7 +45,7 @@ % % \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 @@ This is a citation in the appendix~\cite{proofsAreHard}. % 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 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \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 @@ This is a citation in the appendix~\cite{proofsAreHard}. \def\FV@ProcessLine{\immediate\write\axp@proofsfile}% \let\FV@FontScanPrep\relax \let\@noligs\relax - \immediate\write\axp@proofsfile{\noexpand\makeatother}% \def\FV@CatCodesHook{}% \FV@Scan} \def\FVE@axp@VerbatimOut{% @@ -1035,6 +1039,8 @@ This is a citation in the appendix~\cite{proofsAreHard}. % 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@repeqn}{same}}{% @@ -1044,7 +1050,7 @@ This is a citation in the appendix~\cite{proofsAreHard}. \ifx\relax##1\relax \axp@with@forward{#1}{\begin{#1}}\label{axp@r\roman{axp@rpcounter}}% \else - \axp@with@forward{#1}{\begin{#1}[##1]}\label{axp@r\roman{axp@rpcounter}}% + \axp@with@forward{#1}{\begin{#1}[{##1}]}\label{axp@r\roman{axp@rpcounter}}% \fi \mainbodyrepeatedtheorem \BODY\end{#1}% @@ -1081,6 +1087,7 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \changes{v1.2.0}{2019/10/07}{Fix display of theorem notes} % \begin{macrocode} \axp@writesection% + \immediate\write\axp@proofsfile{\noexpand\makeatletter}% \ifthenelse{\equal{\axp@repeqn}{same}}{% \immediate\write\axp@proofsfile{% \noexpand\setcounter{axp@equationx}{\value{equation}}% @@ -1112,7 +1119,7 @@ This is a citation in the appendix~\cite{proofsAreHard}. \noexpand\fi \fi \fi - {} (\unexpanded{##1})% + {} (\unexpanded{{##1}})% }% ]% \noexpand\axp@forward@target{axp@fw@r\roman{axp@rpcounter}}{}% @@ -1256,7 +1263,7 @@ This is a citation in the appendix~\cite{proofsAreHard}. {% \axp@writesection \immediate\write\axp@proofsfile{% - \noexpand\begin{axp@oldproof}% + \noexpand\makeatletter\noexpand\begin{axp@oldproof}\noexpand\makeatother% }% \axp@VerbatimOut } @@ -1316,21 +1323,28 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \end{macrocode} % \end{macro} % \begin{macro}{\axp@section} -% \begin{macro}{\axp@@ssection} -% \begin{macro}{\axp@@section} -% This command behaves similarly to |\axp@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@section| behaves similarly to |\axp@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@section{\@ifstar\axp@@ssection\axp@@section} - \def\axp@@ssection#1{% - \@ifnextchar\section{}{\axp@oldsection*{#1}}% + \def\axp@section#1{% + \@ifnextchar\input + {\axp@@sectiontestinput{#1}}% + {\axp@@sectiontestsection{#1}}% } - \def\axp@@section#1{% - \@ifnextchar\section{}{\axp@oldsection{#1}}% + \def\axp@@sectiontestinput#1\input#2{% + \CatchFileDef{\axp@tmp}{#2}{}% + \def\axp@tmptmp{\axp@@sectiontestsection{#1}}% + \expandafter\axp@tmptmp\axp@tmp% } + \def\axp@@sectiontestsection#1{\@ifnextchar\section{\makeatother}{\axp@oldsection{#1}\makeatother}} % \end{macrocode} % \end{macro} % \end{macro} @@ -1457,7 +1471,14 @@ This is a citation in the appendix~\cite{proofsAreHard}. % |\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 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \changes{v1.2.1}{2020/02/27}{Ad hoc fix for \textsf{natbib} % package conflict} % \begin{macrocode} - \AtEndDocument{ + \pretocmd{\@enddocumenthook}{% \ifdefined\NAT@testdef \renewcommand\bibcite[2]{% \global\@namedef{b@#1\@extra@binfo}{#2}% @@ -1498,7 +1519,7 @@ This is a citation in the appendix~\cite{proofsAreHard}. \let\bibcite\NAT@testdef \fi }{} - } + }{}{} % \end{macrocode} % \begin{macrocode} }{} diff --git a/Master/texmf-dist/source/latex/apxproof/apxproof.ins b/Master/texmf-dist/source/latex/apxproof/apxproof.ins index 23cc7248a0b..d563944d941 100644 --- a/Master/texmf-dist/source/latex/apxproof/apxproof.ins +++ b/Master/texmf-dist/source/latex/apxproof/apxproof.ins @@ -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 -- cgit v1.2.3