texlive[52324] Master/texmf-dist: apxproof (9oct19)

commits+karl at tug.org commits+karl at tug.org
Wed Oct 9 23:56:43 CEST 2019


Revision: 52324
          http://tug.org/svn/texlive?view=revision&revision=52324
Author:   karl
Date:     2019-10-09 23:56:43 +0200 (Wed, 09 Oct 2019)
Log Message:
-----------
apxproof (9oct19)

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

Removed Paths:
-------------
    trunk/Master/texmf-dist/source/latex/apxproof/Makefile

Modified: trunk/Master/texmf-dist/doc/latex/apxproof/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/apxproof/README.md	2019-10-09 21:56:26 UTC (rev 52323)
+++ trunk/Master/texmf-dist/doc/latex/apxproof/README.md	2019-10-09 21:56:43 UTC (rev 52324)
@@ -20,12 +20,12 @@
 few other packages, which should be provided by all reasonable LaTeX
 distributions:
  - `amsthm`
- - `bibunits`
  - `environ`
  - `etoolbox`
  - `fancyvrb`
  - `ifthen`
  - `kvoptions`
+ - `bibunits` (optional, only if the `bibliography` option is set to `separate`)
 
 ## Manual installation
 

Modified: trunk/Master/texmf-dist/doc/latex/apxproof/apxproof.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/source/latex/apxproof/Makefile
===================================================================
--- trunk/Master/texmf-dist/source/latex/apxproof/Makefile	2019-10-09 21:56:26 UTC (rev 52323)
+++ trunk/Master/texmf-dist/source/latex/apxproof/Makefile	2019-10-09 21:56:43 UTC (rev 52324)
@@ -1,20 +0,0 @@
-all: apxproof.pdf apxproof.sty
-
-clean:
-	-rm -f *.aux *.log *.gl? *.idx *.ilg *.fls *.ind *.axp *.bbl *.blg *.hd  *.out
-
-ctan:
-	git archive --format zip master --prefix=apxproof/  --output apxproof.zip
-
-%.pdf: %.dtx %.sty
-	pdflatex $<
-	makeindex -s gind.ist $(patsubst %.pdf,%.idx,$@)
-	makeindex -s gglo.ist -o $(patsubst %.pdf,%.gls,$@) $(patsubst %.pdf,%.glo,$@)
-	bibtex $(patsubst %.pdf,%,$@)
-	bibtex bu1
-	pdflatex $<
-	pdflatex $<
-
-%.sty: %.ins %.dtx
-	-rm $@
-	latex $<

Modified: trunk/Master/texmf-dist/source/latex/apxproof/apxproof.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/apxproof/apxproof.dtx	2019-10-09 21:56:26 UTC (rev 52323)
+++ trunk/Master/texmf-dist/source/latex/apxproof/apxproof.dtx	2019-10-09 21:56:43 UTC (rev 52324)
@@ -24,7 +24,7 @@
 % \iffalse
 %<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
 %<package>\ProvidesPackage{apxproof}
-%<package>  [2019/01/28 v1.1.1 Automatic proofs in appendix]
+%<package>  [2019/10/08 v1.2.0 Automatic proofs in appendix]
 %
 %<*driver>
 \documentclass{ltxdoc}
@@ -45,7 +45,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{729}
+% \CheckSum{787}
 %
 % \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
@@ -200,7 +200,7 @@
 % \item \meta{name} (e.g., |theorem|) is the name of an environment that is created for this kind of
 % theorem;
 % \item \meta{counter} (e.g., |definition|) is an optional counter describing
-% from which kind of environment should the numbering of these environments be
+% from which kind of environment the numbering of these environments should be
 % inherited;
 % \item \meta{title}
 % (e.g., |Theorem|) is
@@ -350,7 +350,7 @@
 % \item[|append|] This is the default.
 % Appendix material gathered by \textsf{apxproof} is appended to
 % the main text.
-% \item[|inline|] In this mode, \textsf{apxproof} simply inline the
+% \item[|inline|] In this mode, \textsf{apxproof} simply inlines the
 % content along with the main text.
 % \item[|strip|] This mode functions similarly to |append| except that
 % the appendix is not appended at the end of the document. All appendix
@@ -362,6 +362,10 @@
 % \textsf{apxproof} provides a few macros that can be redefined (using
 % |\renewcommand|) to customize the appearance of the appendix:
 % \begin{description}
+% \item[\textbackslash|mainbodyrepeatedtheorem|]\DescribeMacro{\mainbodyrepeatedtheorem}
+% is a macro that is executed at the beginning of the body of every
+% repeated theorem. This can be used to notify the reader that the
+% theorem is repeated in appendix in some way, e.g., with a margin note.
 % \item[\textbackslash|appendixsectionformat|\marg{number}\marg{title}]\DescribeMacro{\appendixsectionformat} is a macro
 % that indicates how to format the section titles in the Appendix, given
 % the number and title of the section in the main text. By
@@ -387,7 +391,7 @@
 % Another customization capability concerns \emph{numbered equations} that are present
 % within repeated theorems. An optional |repeqn| option can be specified
 % when loading the package, which controls whether
-% equation numbers should be as in the same text (by setting this option
+% equation numbers should be as in the main text (by setting this option
 % to |same|, the default) or independently
 % numbered (by setting this option to |independent|). In the latter case,
 % whenever a referenceable counter is set with |\label{|\meta{counter}|}|,
@@ -396,8 +400,8 @@
 % (except in |inline| mode, where both have the same effect).
 %
 % \subsection{Advanced Features}
-% We now describe a few advanced macros and environments, whose usage is limited to
-% special cases:
+% We now describe a few advanced macros and environments, the usage of
+% which is limited to special cases:
 % \begin{description}
 % \item[|nestedproof|]\DescribeEnv{nestedproof} is an environment that
 % can be used within a |proof| environment deferred in the appendix; this
@@ -405,7 +409,7 @@
 % be nested within a deferred |proof| environment.
 % \item[\textbackslash|noproofinappendix|]\DescribeMacro{\noproofinappendix}
 % can be used inside repeated theorems that are not followed by a
-% |proof| or |appendixproof| theorem; the point is to ensure that a further
+% |proof| or |appendixproof| environment; the point is to ensure that a further
 % |proof| environment cannot be mistakenly understood as a proof of the repeated
 % theorem. It should not be needed in most situations as
 % \textsf{apxproof} tries figuring out when a proof follows a repeated
@@ -452,6 +456,11 @@
 % which source line has produced which box does not work for appendix
 % content managed by \textsf{apxproof} or repeated theorems. No obvious
 % fix is known, though this issue will be investigated in the long term.
+% \item Unless the |bibliography| option is set to |common|, the
+% \textsf{bibunits} package
+% is used to generate a second bibliography. This means any package, such
+% as \textsf{biblatex}, that is incompatible with \textsf{bibunits} will not be
+% compatible with \textsf{apxproof} unless |bibliography| is set to |common|.
 % \end{itemize}
 %
 % Issues not listed here should be reported to the author.
@@ -493,11 +502,6 @@
 % \subsection{Dependencies}
 % We first load a few package dependencies:
 % \begin{itemize}
-% \item \textsf{bibunits} to add a second bibliography for the appendix
-% material.
-%    \begin{macrocode}
-\RequirePackage{bibunits}
-%    \end{macrocode}
 % \item \textsf{environ} to easily define the repeated theorem
 % environments.
 %    \begin{macrocode}
@@ -602,6 +606,13 @@
   package apxproof}
 }}}
 \ifthenelse{\equal{\axp at bibliography}{separate}}{
+%    \end{macrocode}
+% The external \textsf{bibunits} package 
+% is used to add a second bibliography for the appendix material.
+% \changes{v1.2.0}{2019/04/17}{Do not load \textsf{binunits} if
+% \texttt{bibliography} is set to \texttt{common}}
+%    \begin{macrocode}
+  \RequirePackage{bibunits}
   \message{apxproof: Separate bibliography for appendix material}
 }{\ifthenelse{\equal{\axp at bibliography}{common}}{
   \message{apxproof: Common bibliography for appendix and main text}
@@ -619,6 +630,34 @@
 }}
 %    \end{macrocode}
 % \subsection{Macros Common to All Compilation Modes}
+% \begin{macro}{\axp at newtheoremrep@definetheorem}
+% \changes{v1.2.0}{2019/10/01}{Restore predefined theorem counters}
+% Common to all compilation modes, we define
+% |\axp at newtheoremrep@definetheorem|.
+% When called with first argument |foobar|, we first undefine the existing
+% |foobar| environment (and its counter) if it has already been defined (e.g., by the
+% document class), then invoke |\axp at newtheorem| for the regular version
+% of the theorem |foobar|, saving and restoring any existing theorem counter unless the
+% |\newtheoremdep| redefines the base counter.
+%    \begin{macrocode}
+\def\axp at newtheoremrep@definetheorem#1#2#3#4{%
+  \expandafter\let\csname #1\endcsname\undefined
+  \ifcsname c@#1\endcsname
+    \expandafter\expandafter\expandafter\let\expandafter\expandafter
+      \csname c at axp@#1\endcsname\csname c@#1\endcsname
+    \expandafter\let\csname c@#1\endcsname\undefined
+  \fi
+  \axp at newtheorem{#1}{#2}{#3}{#4}%
+  \ifcsname c at axp@#1\endcsname
+    \ifx\relax#2\relax
+      \expandafter\expandafter\expandafter\let\expandafter\expandafter
+        \csname c@#1\endcsname\csname c at axp@#1\endcsname
+    \else
+    \fi
+  \fi
+}
+%    \end{macrocode}
+% \end{macro}
 % \begin{macro}{\axp at newtheorem}
 % \changes{v1.0.6}{2018/05/10}{Introduce intermediary command for theorem
 % macro}
@@ -630,6 +669,7 @@
 % definition depending on the document class. This command uses two
 % intermediary commands, |\@axp at newtheorem| and |\@@axp at newtheorem|, for
 % the non-starred and starred versions.
+%    \begin{macrocode}
 \def\axp at newtheorem{\@ifstar\@@axp at newtheorem\@axp at newtheorem}
 \def\@axp at newtheorem#1#2#3#4{%
   \ifx\relax#4\relax
@@ -641,6 +681,7 @@
 \def\@@axp at newtheorem#1#2{%
   \newtheorem*{#1}{#2}%
 }
+%    \end{macrocode}
 % \end{macro}
 % \end{macro}
 % \end{macro}
@@ -669,20 +710,8 @@
   \newenvironment{proofsketch}{\begin{axp at oldproof}[Proof sketch]}{\end{axp at oldproof}}
 %    \end{macrocode}
 % \end{environment}  
-% \begin{macro}{\thmhead}  
-% \changes{v1.0.2}{2016/12/13}{Fix display of repeated theorem counter in
-% some document classes}
-% We redefine AMS-\LaTeX{}'s |\thmhead| to use a format where the
-% repeated version of a theorem, using a theorem note, can look exactly
-% like the original version of the theorem and its theorem counter.
-%    \begin{macrocode}
-\AtBeginDocument{%
-  \def\thmhead#1#2#3{%
-    \thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}%
-    \thmnote{ #3}}%
-}
-%    \end{macrocode}
-% \end{macro}  
+% \begin{macro}{\mainbodyrepeatedtheorem}
+% \changes{v1.2.0}{2019/09/21}{Configurable repeated theorem command}
 % \begin{macro}{\appendixrefname}
 % \begin{macro}{\appendixbibliographystyle}
 % \begin{macro}{\appendixbibliographyprelim}
@@ -691,10 +720,11 @@
 % \begin{macro}{\appendixsectionformat}
 % \changes{v1.1.0}{2018/07/17}{Fix missing space in default
 % \cs{appendixsectionformat}}
-% We provide sensible defaults for these four user-customizable macros.
-% Even though they are only useful in append mode, we define them for
+% We provide sensible defaults for these user-customizable macros.
+% Even though they are not all useful in all modes, we define them for
 % all modes so that a |\renewcommand| works in all cases.
 %    \begin{macrocode}
+\newcommand{\mainbodyrepeatedtheorem}{}
 \newcommand{\appendixrefname}{References for the Appendix}
 \newcommand{\appendixbibliographystyle}{alpha}
 \newcommand{\appendixbibliographyprelim}{}
@@ -706,6 +736,7 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
+% \end{macro}
 % \begin{environment}{axp at oldproof}
 %   We save the definition of the existing |proof| environment.
 %    \begin{macrocode}  
@@ -721,10 +752,13 @@
 % \changes{v1.1.0}{2018/07/04}{Fix \cs{label} not being disabled
 % in \textsf{amsmath} environments, where \cs{label at in@display} is
 % used instead (K. D. Bauer)}
+% \changes{v1.2.0}{2019/02/15}{Fix extra spacing erroneously
+% introduced within the \texttt{\textbackslash axp at redefinelabels}
+% macro}
 %    \begin{macrocode}  
   \newcommand{\axp at redefinelabels}{%
-    \providecommand\label at in@display{}
-    \ifthenelse{\equal{\axp at appendix}{inline}}{
+    \providecommand\label at in@display{}%
+    \ifthenelse{\equal{\axp at appendix}{inline}}{%
       \let\axp at oldlabel\label
       \let\axp at oldlabel@in at display\label at in@display
       \renewcommand\label[1]{%
@@ -745,7 +779,7 @@
 %    \end{macrocode}  
 % \end{macro}  
 % \subsubsection{Class-Specific Behavior}    
-% Finally, some class-specific behavior common to all compilation modes  
+% Finally, some class-specific behavior common to all compilation modes.
 % \paragraph{\textsf{llncs} and other Springer document classes}
 % \changes{v1.0.6}{2018/05/10}{Better support of Springer document
 % classes}
@@ -774,20 +808,19 @@
 %    \end{macrocode}
 % \end{macro}    
 % \end{macro}    
+% \begin{macro}{proofsketch}
+% \changes{v1.2.0}{2019/02/15}{Fix proof sketches in inline
+% compilation mode for Springer document classes}
+% We redefine the |proofsketch| environment, which is used
+% differently in the base class.    
+%    \begin{macrocode}
+\renewenvironment{proofsketch}{\begin{axp at oldproof}[sketch]}{\end{axp at oldproof}}
+%    \end{macrocode}
+% \end{macro}
 % We have to redefine the macro |\@thmcountersep| for proper sectioned
 % counters.
 %    \begin{macrocode}
 \def\@thmcountersep{.}
-%    \end{macrocode}
-% We remove the parentheses added by default for theorem notes, which are
-% not compatible with the use of theorem notes by \textsf{apxproof}.
-%    \begin{macrocode}
-\def\@Opargbegintheorem#1#2#3#4{#4\trivlist
-      \item[\hskip\labelsep{#3#1}]{#3 #2\@thmcounterend\ }}
-\def\@spopargbegintheorem#1#2#3#4#5{\trivlist
-      \item[\hskip\labelsep{#4#1\ #2}]{#4 #3\@thmcounterend\ }#5}
-%    \end{macrocode}
-%    \begin{macrocode}
   \fi
 %    \end{macrocode}
 % \subsection{Inline Compilation Mode}
@@ -795,19 +828,23 @@
 \ifthenelse{\equal{\axp at appendix}{inline}}{
 %    \end{macrocode}
 % \begin{macro}{\axp at newtheoremrep}
-% In inline mode, |\axp at newtheoremrep| undefines the existing
-% theorem environment if it has already been defined (e.g., by the
-% document class), invokes |\newtheorem| and creates a repeated theorem
+% In inline mode, |\axp at newtheoremrep| uses
+% |\axp at newtheoremrep@definetheorem| to define the regular theorem
+% environment and creates a repeated theorem
 % environment that behaves exactly as the regular theorem environment,
 % while calling |\axp at redefinelabels| to make sure that |-axp| variants
 % of equation counters are defined.
+% \changes{v1.2.0}{2019/02/15}{Fix formatting of theorems without
+% notes in some document classes in inline mode}
 %    \begin{macrocode}
   \def\axp at newtheoremrep#1[#2]#3[#4]{%
-    \expandafter\let\csname #1\endcsname\undefined
-    \expandafter\let\csname c@#1\endcsname\undefined
-    \axp at newtheorem{#1}{#2}{#3}{#4}%
+    \axp at newtheoremrep@definetheorem{#1}{#2}{#3}{#4}%
     \NewEnviron{#1rep}[1][]{%
-      \begin{#1}[##1]\axp at redefinelabels\BODY\end{#1}%
+      \ifx\relax##1\relax
+        \begin{#1}\axp at redefinelabels\BODY\end{#1}%
+      \else
+        \begin{#1}[##1]\axp at redefinelabels\BODY\end{#1}%
+      \fi
     }
   }
 %    \end{macrocode}
@@ -883,7 +920,7 @@
 % \end{macro}  
 % \end{environment}  
 % \begin{macro}{\axp at unactivateeightbit}
-% \changes{v1.1.0-dev}{2019/01/28}{Fix compilation of non-ASCII
+% \changes{v1.1.0}{2019/01/28}{Fix compilation of non-ASCII
 % characters with \texttt{\textbackslash usepackage[utf8]\{inputenc\}}}
 % We need an auxiliary macro to disable active characters that have the
 % high bit set when writing to the |.axp| file. See
@@ -901,7 +938,7 @@
 % \begin{environment}{axp at VerbatimOut}
 % \begin{macro}{\FVB at axp@VerbatimOut}
 % \begin{macro}{\FVE at axp@VerbatimOut}
-% \changes{v1.1.0-dev}{2018/10/02}{Make \textsf{apxproof} compatible with 
+% \changes{v1.1.0}{2018/10/02}{Make \textsf{apxproof} compatible with 
 % independent use of \textsf{fancyvrb}}
 % Using the functionalities of the \textsf{fancyvrb} package, we define a
 % custom verbatim environment |axp at VerbatimOut| that writes every line
@@ -959,17 +996,14 @@
 % \end{macro}
 % \end{macro}
 % \begin{macro}{axp at newtheoremrep}
-% When called with first argument |foobar|, we first undefine the existing
-% |foobar| environment (and its counter) if it has already been defined (e.g., by the
-% document class), then invoke |\newtheorem| for the regular version
-% of the theorem |foobar| (patching the |\begin{foobar}| so as not to
-% expect a proof in the appendix) and |\newtheorem*| for an internal version |axp at foobarrp| that
+% With first argument |foobar|, we use
+% |\axp at newtheoremrep@definetheorem| to define the regular version of the
+% theorem |foobar|. We then patch |\begin{foobar}| so as not to
+% expect a proof in the appendix and define an internal theorem |axp at foobarrp| that
 % will be used in the appendix to restate the existing theorem.
 %    \begin{macrocode}  
   \def\axp at newtheoremrep#1[#2]#3[#4]{%
-    \expandafter\let\csname #1\endcsname\undefined
-    \expandafter\let\csname c@#1\endcsname\undefined
-    \axp at newtheorem{#1}{#2}{#3}{#4}%
+    \axp at newtheoremrep@definetheorem{#1}{#2}{#3}{#4}%
     \expandafter\pretocmd\csname #1\endcsname{\noproofinappendix}{}{}%
     \axp at newtheorem*{axp@#1rp}{#3}%
     \axp at forward@setup{#1}{#2}{#3}{#4}%
@@ -976,7 +1010,8 @@
 %    \end{macrocode}  
 % We then define a |foobarrep| environment that increments the
 % |axp at rpcounter| and typeset the regular |foobar| theorem with a label
-% derived from the counter. We distinguish the case when the theorem
+% derived from the counter, along with a possible custom command to
+% identify repeated theorems. We distinguish the case when the theorem
 % argument has a note and when it does not.
 % \changes{v1.0.6}{2018/05/10}{Better handling of note-free theorems in
 % document classes that treat theorems differently when they have an
@@ -991,10 +1026,12 @@
       }{}%
       \addtocounter{axp at rpcounter}{1}%
       \ifx\relax##1\relax
-        \axp at with@forward{#1}{\begin{#1}}\label{axp at r\roman{axp at rpcounter}}\BODY\end{#1}%
+        \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}}\BODY\end{#1}%
-      \fi    
+        \axp at with@forward{#1}{\begin{#1}[##1]}\label{axp at r\roman{axp at rpcounter}}%
+      \fi
+      \mainbodyrepeatedtheorem
+      \BODY\end{#1}%
 %    \end{macrocode}  
 % We set the |axp at seenreptheorem| toggle to indicate that we are looking
 % for the proof of the theorem, then store in a macro the content of the
@@ -1009,11 +1046,23 @@
 % repeated version of the theorem using the |axp at foobarrp| environment
 % and a reference to the previously defined label.
 % We use |\axp at redefinelabels| in this environment to avoid multiply
-% defined labels.
+% defined labels. We have to deal in a careful way with theorem notes: we
+% want to use a theorem note to display the number of the repeated
+% theorem, but theorem notes are usually typeset in a much
+% different way (different font, parentheses) than theorem
+% headings. In the case of the Springer document
+% classes, we use the  |\theopargself| macro to disable parentheses. For 
+% other document classes, we need to manually patch the |\thmhead|
+% command at the right time. We also specially cover the case of
+% the ACM document class where |\@acmplainnotefont| is used instead
+% of |\thm at notefont|.
 % \changes{v1.0.2}{2016/12/13}{Fix missing space between repeated theorem
 % counter and theorem note}
+% \changes{v1.0.2}{2016/12/13}{Fix display of repeated theorem counter in
+% some document classes}
 % \changes{v1.0.6}{2018/05/10}{Fix incorrect use of \texttt{\textbackslash noexpand}
 % in optional argument of macro environment}
+% \changes{v1.2.0}{2019/10/07}{Fix display of theorem notes}
 %    \begin{macrocode}  
       \axp at writesection%
       \ifthenelse{\equal{\axp at repeqn}{same}}{%
@@ -1022,16 +1071,40 @@
           \noexpand\setcounter{equation}{\theaxp at equation}%
         }%
       }{}%
-      \immediate\write\axp at proofsfile{%
+      \immediate\write\axp at proofsfile{{%
+        \ifdefined\theopargself
+          \noexpand\theopargself
+        \else
+          \noexpand\pretocmd{\noexpand\@begintheorem}{%
+            \noexpand\patchcmd{\noexpand\thmhead}{\noexpand\@acmplainnotefont}{}{}{}%
+            \noexpand\patchcmd{\noexpand\thmhead}{\noexpand\the\noexpand\thm at notefont}{}{}{}%
+            \noexpand\patchcmd{\noexpand\thmhead}{(}{}{}{}%
+            \noexpand\patchcmd{\noexpand\thmhead}{)}{}{}{}%
+          }{}{}
+        \fi
         \noexpand\begin{axp@#1rp}
-          [\noexpand\ref{axp at r\roman{axp at rpcounter}}%
-           \@ifnotempty{##1}{ \unexpanded{##1}}]%
+          [%
+            \noexpand\ref{axp at r\roman{axp at rpcounter}}%
+            \@ifnotempty{##1}{%
+              \ifdefined\theopargself
+              \else
+                \ifdefined\@acmplainnotefont
+                  \noexpand\@acmplainnotefont
+                \else
+                  \noexpand\ifdefined\noexpand\thm at notefont
+                    \noexpand\the\noexpand\thm at notefont
+                  \noexpand\fi
+                \fi
+              \fi  
+              {} (\unexpanded{##1})%
+            }%
+          ]%
           \noexpand\axp at forward@target{axp at fw@r\roman{axp at rpcounter}}{}%
           \noexpand\axp at redefinelabels
           \expandafter\noexpand\csname rplet\roman{axp at rpcounter}%
                                \endcsname
         \noexpand\end{axp@#1rp}
-      }%
+      }}%
       \ifthenelse{\equal{\axp at repeqn}{same}}{%
         \immediate\write\axp at proofsfile{%
           \noexpand\setcounter{equation}{\value{axp at equationx}}%
@@ -1350,15 +1423,18 @@
 %    \end{macrocode}  
 % \begin{macro}{\axp at oldbibliography}    
 % \begin{macro}{\bibliography}    
-% Thanks to \textsf{bibunits}'s |\defaultbibliography| macro, we set the appendix
-% bibliography source to be the same as that of the main text.    
-%    \begin{macrocode}  
-    \let\axp at oldbibliography\bibliography
-    \renewcommand\bibliography[1]{%
-      \defaultbibliography{#1}%
-      \axp at oldbibliography{#1}%
-    }
-%    \end{macrocode}  
+% Unless the |bibliography| option is set to |common|, we need to set the
+% appendix bibliography source to be the same as that of the main
+% text, thanks to \textsf{bibunits}'s |\defaultbibliography| macro.
+%    \begin{macrocode}
+    \ifthenelse{\equal{\axp at bibliography}{separate}}{
+      \let\axp at oldbibliography\bibliography
+      \renewcommand\bibliography[1]{%
+        \defaultbibliography{#1}%
+        \axp at oldbibliography{#1}%
+      }
+    }{}
+%    \end{macrocode}
 % \end{macro}
 % \end{macro}
 % After the end of the main text, we add the appendix (after the command 
@@ -1445,30 +1521,8 @@
 %    \begin{macrocode}
   \fi
 %    \end{macrocode}
-% \paragraph{ACM Document Classes (new version)}
 % \changes{v1.0.6}{2018/05/10}{Support of new ACM document class
 % (\texttt{acmart.cls})}
-% Again, we adjust the styling of theorems for the needs of \textsf{apxproof}.
-%    \begin{macrocode}
-  \@ifclassloaded{acmart}{  
-%    \end{macrocode}
-%    \begin{macrocode}  
-  \newtheoremstyle{mystyle}
-    {.5\baselineskip\@plus.2\baselineskip
-      \@minus.2\baselineskip}
-    {.5\baselineskip\@plus.2\baselineskip
-      \@minus.2\baselineskip}
-    {\@acmplainbodyfont}
-    {\@acmplainindent}
-    {\@acmplainheadfont}
-    {.}
-    {.5em}
-    {\thmname{#1}\thmnumber{ #2}\thmnote{ {\@acmplainheadfont #3}}}
-  \theoremstyle{mystyle}
-%    \end{macrocode}
-%    \begin{macrocode}
-  }{} 
-%    \end{macrocode}
 % \paragraph{\textsf{lipcs}}
 %    \begin{macrocode}
    \ifdefined\lipics at opterrshort
@@ -1487,22 +1541,6 @@
 % \end{macro}    
 %    \begin{macrocode}
   \fi
-%    \end{macrocode}
-% \paragraph{\textsf{llncs}}
-%    \begin{macrocode}
-  \@ifclassloaded{llncs}{
-%    \end{macrocode}
-% \begin{macro}{proofsketch}
-% We redefine the |proofsketch| environment, which is used
-% differently in the base class.    
-%    \begin{macrocode}
-    \renewenvironment{proofsketch}{\begin{axp at oldproof}[sketch]}{\end{axp at oldproof}}
-%    \end{macrocode}
-% \end{macro}
-%    \begin{macrocode}
-  }{}
-%     \end{macrocode}
-%    \begin{macrocode}
 }
 %    \end{macrocode}
 % \Finale

Modified: trunk/Master/texmf-dist/source/latex/apxproof/apxproof.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/apxproof/apxproof.ins	2019-10-09 21:56:26 UTC (rev 52323)
+++ trunk/Master/texmf-dist/source/latex/apxproof/apxproof.ins	2019-10-09 21:56:43 UTC (rev 52324)
@@ -1,5 +1,5 @@
 %%
-%% Copyright (C) 2016-2017 by Pierre Senellart
+%% Copyright (C) 2016-2019 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-2017 by Pierre Senellart
+Copyright (C) 2016-2019 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	2019-10-09 21:56:26 UTC (rev 52323)
+++ trunk/Master/texmf-dist/tex/latex/apxproof/apxproof.sty	2019-10-09 21:56:43 UTC (rev 52324)
@@ -6,7 +6,7 @@
 %%
 %% apxproof.dtx  (with options: `package')
 %% 
-%% Copyright (C) 2016-2017 by Pierre Senellart
+%% Copyright (C) 2016-2019 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,8 +27,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
 \ProvidesPackage{apxproof}
-  [2019/01/28 v1.1.1 Automatic proofs in appendix]
-\RequirePackage{bibunits}
+  [2019/10/08 v1.2.0 Automatic proofs in appendix]
 \RequirePackage{environ}
 \RequirePackage{etoolbox}
 \RequirePackage{fancyvrb}
@@ -66,6 +65,7 @@
   package apxproof}
 }}}
 \ifthenelse{\equal{\axp at bibliography}{separate}}{
+  \RequirePackage{bibunits}
   \message{apxproof: Separate bibliography for appendix material}
 }{\ifthenelse{\equal{\axp at bibliography}{common}}{
   \message{apxproof: Common bibliography for appendix and main text}
@@ -81,6 +81,22 @@
   \errmessage{Error: unsupported option repeqn=\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
+    \expandafter\expandafter\expandafter\let\expandafter\expandafter
+      \csname c at axp@#1\endcsname\csname c@#1\endcsname
+    \expandafter\let\csname c@#1\endcsname\undefined
+  \fi
+  \axp at newtheorem{#1}{#2}{#3}{#4}%
+  \ifcsname c at axp@#1\endcsname
+    \ifx\relax#2\relax
+      \expandafter\expandafter\expandafter\let\expandafter\expandafter
+        \csname c@#1\endcsname\csname c at axp@#1\endcsname
+    \else
+    \fi
+  \fi
+}
 \def\axp at newtheorem{\@ifstar\@@axp at newtheorem\@axp at newtheorem}
 \def\@axp at newtheorem#1#2#3#4{%
   \ifx\relax#4\relax
@@ -99,11 +115,7 @@
   \@oparg{\axp at newtheoremrep{#1}[#2]{#3}}[]%
 }
   \newenvironment{proofsketch}{\begin{axp at oldproof}[Proof sketch]}{\end{axp at oldproof}}
-\AtBeginDocument{%
-  \def\thmhead#1#2#3{%
-    \thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}%
-    \thmnote{ #3}}%
-}
+\newcommand{\mainbodyrepeatedtheorem}{}
 \newcommand{\appendixrefname}{References for the Appendix}
 \newcommand{\appendixbibliographystyle}{alpha}
 \newcommand{\appendixbibliographyprelim}{}
@@ -112,8 +124,8 @@
   \let\axp at oldproof\proof
   \let\endaxp at oldproof\endproof
   \newcommand{\axp at redefinelabels}{%
-    \providecommand\label at in@display{}
-    \ifthenelse{\equal{\axp at appendix}{inline}}{
+    \providecommand\label at in@display{}%
+    \ifthenelse{\equal{\axp at appendix}{inline}}{%
       \let\axp at oldlabel\label
       \let\axp at oldlabel@in at display\label at in@display
       \renewcommand\label[1]{%
@@ -146,19 +158,18 @@
 \def\@@axp at newtheorem#1#2{%
   \spnewtheorem*{#1}{#2}{\upshape\bfseries}{\itshape}%
 }
+\renewenvironment{proofsketch}{\begin{axp at oldproof}[sketch]}{\end{axp at oldproof}}
 \def\@thmcountersep{.}
-\def\@Opargbegintheorem#1#2#3#4{#4\trivlist
-      \item[\hskip\labelsep{#3#1}]{#3 #2\@thmcounterend\ }}
-\def\@spopargbegintheorem#1#2#3#4#5{\trivlist
-      \item[\hskip\labelsep{#4#1\ #2}]{#4 #3\@thmcounterend\ }#5}
   \fi
 \ifthenelse{\equal{\axp at appendix}{inline}}{
   \def\axp at newtheoremrep#1[#2]#3[#4]{%
-    \expandafter\let\csname #1\endcsname\undefined
-    \expandafter\let\csname c@#1\endcsname\undefined
-    \axp at newtheorem{#1}{#2}{#3}{#4}%
+    \axp at newtheoremrep@definetheorem{#1}{#2}{#3}{#4}%
     \NewEnviron{#1rep}[1][]{%
-      \begin{#1}[##1]\axp at redefinelabels\BODY\end{#1}%
+      \ifx\relax##1\relax
+        \begin{#1}\axp at redefinelabels\BODY\end{#1}%
+      \else
+        \begin{#1}[##1]\axp at redefinelabels\BODY\end{#1}%
+      \fi
     }
   }
   \let\inlineproof\proof
@@ -212,9 +223,7 @@
   \newcounter{axp at equation}
   \newcounter{axp at equationx}
   \def\axp at newtheoremrep#1[#2]#3[#4]{%
-    \expandafter\let\csname #1\endcsname\undefined
-    \expandafter\let\csname c@#1\endcsname\undefined
-    \axp at newtheorem{#1}{#2}{#3}{#4}%
+    \axp at newtheoremrep@definetheorem{#1}{#2}{#3}{#4}%
     \expandafter\pretocmd\csname #1\endcsname{\noproofinappendix}{}{}%
     \axp at newtheorem*{axp@#1rp}{#3}%
     \axp at forward@setup{#1}{#2}{#3}{#4}%
@@ -224,10 +233,12 @@
       }{}%
       \addtocounter{axp at rpcounter}{1}%
       \ifx\relax##1\relax
-        \axp at with@forward{#1}{\begin{#1}}\label{axp at r\roman{axp at rpcounter}}\BODY\end{#1}%
+        \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}}\BODY\end{#1}%
+        \axp at with@forward{#1}{\begin{#1}[##1]}\label{axp at r\roman{axp at rpcounter}}%
       \fi
+      \mainbodyrepeatedtheorem
+      \BODY\end{#1}%
       \global\toggletrue{axp at seenreptheorem}%
       \global\expandafter\let\csname rplet\roman{axp at rpcounter}%
                              \endcsname
@@ -239,16 +250,40 @@
           \noexpand\setcounter{equation}{\theaxp at equation}%
         }%
       }{}%
-      \immediate\write\axp at proofsfile{%
+      \immediate\write\axp at proofsfile{{%
+        \ifdefined\theopargself
+          \noexpand\theopargself
+        \else
+          \noexpand\pretocmd{\noexpand\@begintheorem}{%
+            \noexpand\patchcmd{\noexpand\thmhead}{\noexpand\@acmplainnotefont}{}{}{}%
+            \noexpand\patchcmd{\noexpand\thmhead}{\noexpand\the\noexpand\thm at notefont}{}{}{}%
+            \noexpand\patchcmd{\noexpand\thmhead}{(}{}{}{}%
+            \noexpand\patchcmd{\noexpand\thmhead}{)}{}{}{}%
+          }{}{}
+        \fi
         \noexpand\begin{axp@#1rp}
-          [\noexpand\ref{axp at r\roman{axp at rpcounter}}%
-           \@ifnotempty{##1}{ \unexpanded{##1}}]%
+          [%
+            \noexpand\ref{axp at r\roman{axp at rpcounter}}%
+            \@ifnotempty{##1}{%
+              \ifdefined\theopargself
+              \else
+                \ifdefined\@acmplainnotefont
+                  \noexpand\@acmplainnotefont
+                \else
+                  \noexpand\ifdefined\noexpand\thm at notefont
+                    \noexpand\the\noexpand\thm at notefont
+                  \noexpand\fi
+                \fi
+              \fi
+              {} (\unexpanded{##1})%
+            }%
+          ]%
           \noexpand\axp at forward@target{axp at fw@r\roman{axp at rpcounter}}{}%
           \noexpand\axp at redefinelabels
           \expandafter\noexpand\csname rplet\roman{axp at rpcounter}%
                                \endcsname
         \noexpand\end{axp@#1rp}
-      }%
+      }}%
       \ifthenelse{\equal{\axp at repeqn}{same}}{%
         \immediate\write\axp at proofsfile{%
           \noexpand\setcounter{equation}{\value{axp at equationx}}%
@@ -384,11 +419,13 @@
   \let\axp at oldtableofcontents\tableofcontents
   \def\tableofcontents{{\let\section\axp at oldsection\axp at oldtableofcontents}}
   \ifthenelse{\equal{\axp at appendix}{append}}{
-    \let\axp at oldbibliography\bibliography
-    \renewcommand\bibliography[1]{%
-      \defaultbibliography{#1}%
-      \axp at oldbibliography{#1}%
-    }
+    \ifthenelse{\equal{\axp at bibliography}{separate}}{
+      \let\axp at oldbibliography\bibliography
+      \renewcommand\bibliography[1]{%
+        \defaultbibliography{#1}%
+        \axp at oldbibliography{#1}%
+      }
+    }{}
     \AtEndDocument{
       \appendixprelim
       \appendix
@@ -429,20 +466,6 @@
     \newcommand{\refname}{REFERENCES}
     \renewcommand{\appendixrefname}{REFERENCES FOR THE APPENDIX}
   \fi
-  \@ifclassloaded{acmart}{
-  \newtheoremstyle{mystyle}
-    {.5\baselineskip\@plus.2\baselineskip
-      \@minus.2\baselineskip}
-    {.5\baselineskip\@plus.2\baselineskip
-      \@minus.2\baselineskip}
-    {\@acmplainbodyfont}
-    {\@acmplainindent}
-    {\@acmplainheadfont}
-    {.}
-    {.5em}
-    {\thmname{#1}\thmnumber{ #2}\thmnote{ {\@acmplainheadfont #3}}}
-  \theoremstyle{mystyle}
-  }{}
    \ifdefined\lipics at opterrshort
     \renewcommand{\appendixbibliographyprelim}{%
       \global\let\@oldbiblabel\@biblabel
@@ -449,9 +472,6 @@
       \def\@biblabel{\hspace*{-2em}\small\@oldbiblabel}%
     }
   \fi
-  \@ifclassloaded{llncs}{
-    \renewenvironment{proofsketch}{\begin{axp at oldproof}[sketch]}{\end{axp at oldproof}}
-  }{}
 }
 \endinput
 %%



More information about the tex-live-commits mailing list