From 0cc0c2d961f797a7f87a28ceb63cefb6b2990bc2 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Thu, 15 Oct 2020 21:14:01 +0000
Subject: apxproof (15oct20)

git-svn-id: svn://tug.org/texlive/trunk@56673 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/source/latex/apxproof/apxproof.dtx  | 48 +++++++++++++++++-----
 1 file changed, 38 insertions(+), 10 deletions(-)

(limited to 'Master/texmf-dist/source/latex/apxproof/apxproof.dtx')

diff --git a/Master/texmf-dist/source/latex/apxproof/apxproof.dtx b/Master/texmf-dist/source/latex/apxproof/apxproof.dtx
index 2385984fd88..d02bb77435d 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-2019 by Pierre Senellart
+% Copyright (C) 2016-2020 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>  [2019/10/08 v1.2.0 Automatic proofs in appendix]
+%<package>  [2020/10/15 v1.2.1 Automatic proofs in appendix]
 %
 %<*driver>
 \documentclass{ltxdoc}
@@ -45,7 +45,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{787}
+% \CheckSum{813}
 %
 % \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
@@ -373,7 +373,8 @@ This is a citation in the appendix~\cite{proofsAreHard}.
 % (\meta{title})''.
 % \item[\textbackslash|appendixrefname|]\DescribeMacro{\appendixrefname} contains the heading that is displayed before
 % the bibliography. By default, this is ``References for the
-% Appendix''.
+% Appendix''. (Note that this command is also defined and used by the
+% |memoir| document class.)
 % \item[\textbackslash|appendixbibliographystyle|]\DescribeMacro{\appendixbibliographystyle} contains the |.bst| bibliography
 % style that is used in the bibliography in appendix. By default, this is
 % |alpha|.
@@ -430,6 +431,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
 % \item \LaTeX{} standard document classes (e.g., |article.cls|)
 % \item \href{https://www.ctan.org/pkg/koma-script}{KOMA-Script}
 % (e.g., |scrartcl.cls|, |scrbook.cls|)
+% \item \href{https://ctan.org/pkg/memoir}{|memoir.cls|}
 % \item \href{https://www.acm.org/publications/proceedings-template}{ACM
 % SIG Proceedings} (e.g., |sig-alternate.cls|, |acmart.cls|)
 % \item \href{https://www.springer.com/computer/lncs/lncs+authors}{
@@ -466,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--2019 by Pierre Senellart.
+% Copyright \textcopyright{} 2016--2020 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
@@ -609,7 +611,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
 %    \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
+% \changes{v1.2.0}{2019/04/17}{Do not load \textsf{bibunits} if
 % \texttt{bibliography} is set to \texttt{common}}
 %    \begin{macrocode}
   \RequirePackage{bibunits}
@@ -713,6 +715,8 @@ This is a citation in the appendix~\cite{proofsAreHard}.
 % \begin{macro}{\mainbodyrepeatedtheorem}
 % \changes{v1.2.0}{2019/09/21}{Configurable repeated theorem command}
 % \begin{macro}{\appendixrefname}
+% \changes{v1.2.1}{2020/10/09}{Fix compatibility with
+% \texttt{memoir} document class}
 % \begin{macro}{\appendixbibliographystyle}
 % \begin{macro}{\appendixbibliographyprelim}
 % \begin{macro}{\appendixprelim}
@@ -725,7 +729,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
 % all modes so that a |\renewcommand| works in all cases.
 %    \begin{macrocode}
 \newcommand{\mainbodyrepeatedtheorem}{}
-\newcommand{\appendixrefname}{References for the Appendix}
+\providecommand{\appendixrefname}{References for the Appendix}
 \newcommand{\appendixbibliographystyle}{alpha}
 \newcommand{\appendixbibliographyprelim}{}
 \newcommand{\appendixprelim}{\clearpage\onecolumn}
@@ -943,7 +947,15 @@ This is a citation in the appendix~\cite{proofsAreHard}.
 % Using the functionalities of the \textsf{fancyvrb} package, we define a
 % custom verbatim environment |axp@VerbatimOut| that writes every line
 % to the |\axp@proofsfile|. We also use the previous macro to disable active
-% characters with the eighth bit set.
+% characters with the eighth bit set, and we make sure the catcode of |@|
+% is reset for every verbatim environment, in case it is used by the user (e.g.,
+% as in the \textsf{xypic} package). Finally, as an additional
+% precaution, we reset |\FV@CatCodesHook| that is for example set by the
+% |commandchars| or |commentchar| option of |\fvset|.
+% \changes{v1.2.1}{2020/01/01}{Fix compatibility with
+% \textsf{xypic} package}
+% \changes{v1.2.1}{2020/10/15}{Fix compatibility with other uses of \textsf{fancyvrb} that set
+% \texttt{\textbackslash FV@CatCodesHook}}
 %    \begin{macrocode}
   \DefineVerbatimEnvironment{axp@VerbatimOut}{axp@VerbatimOut}{}
   \def\FVB@axp@VerbatimOut{%
@@ -956,8 +968,12 @@ 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{\endgroup\@esphack}
+  \def\FVE@axp@VerbatimOut{%
+      \immediate\write\axp@proofsfile{\noexpand\makeatletter}%
+      \endgroup\@esphack}
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}  
@@ -1445,11 +1461,20 @@ This is a citation in the appendix~\cite{proofsAreHard}.
 % 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
-% (|scrartcl|, |scrreprt|) called |\bibname|.
+% (|scrartcl|, |scrreprt|) called |\bibname|. An ad-hoc test is added
+% to fix a conflict with the \textsf{natbib} package which redefines
+% |bibcite| at the end of the document.
 % \changes{v1.0.6}{2018/05/10}{Deal with document classes where the
 % bibliography is called \texttt{\textbackslash bibname}}
+% \changes{v1.2.1}{2020/02/27}{Ad hoc fix for \textsf{natbib}
+% package conflict}
 %    \begin{macrocode}
     \AtEndDocument{
+      \ifdefined\NAT@testdef
+        \renewcommand\bibcite[2]{%
+          \global\@namedef{b@#1\@extra@binfo}{#2}%
+        }
+      \fi
       \appendixprelim
       \appendix
       \ifthenelse{\equal{\axp@bibliography}{separate}}{
@@ -1469,6 +1494,9 @@ This is a citation in the appendix~\cite{proofsAreHard}.
         \appendixbibliographyprelim
         \putbib
       \end{bibunit}
+      \ifdefined\NAT@testdef
+        \let\bibcite\NAT@testdef
+      \fi
       }{}
     }
 %    \end{macrocode}  
-- 
cgit v1.2.3

