summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/apxproof/apxproof.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/apxproof/apxproof.sty')
-rw-r--r--Master/texmf-dist/tex/latex/apxproof/apxproof.sty31
1 files changed, 18 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/latex/apxproof/apxproof.sty b/Master/texmf-dist/tex/latex/apxproof/apxproof.sty
index a7f9ce12d29..ccbfef56bdd 100644
--- a/Master/texmf-dist/tex/latex/apxproof/apxproof.sty
+++ b/Master/texmf-dist/tex/latex/apxproof/apxproof.sty
@@ -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@oldamsthmproof\proof
@@ -213,7 +214,6 @@
\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{%
@@ -239,7 +239,7 @@
\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}%
@@ -248,6 +248,7 @@
\endcsname
\BODY
\axp@writesection%
+ \immediate\write\axp@proofsfile{\noexpand\makeatletter}%
\ifthenelse{\equal{\axp@repeqn}{same}}{%
\immediate\write\axp@proofsfile{%
\noexpand\setcounter{axp@equationx}{\value{equation}}%
@@ -279,7 +280,7 @@
\noexpand\fi
\fi
\fi
- {} (\unexpanded{##1})%
+ {} (\unexpanded{{##1}})%
}%
]%
\noexpand\axp@forward@target{axp@fw@r\roman{axp@rpcounter}}{}%
@@ -342,7 +343,7 @@
{%
\axp@writesection
\immediate\write\axp@proofsfile{%
- \noexpand\begin{axp@oldproof}%
+ \noexpand\makeatletter\noexpand\begin{axp@oldproof}\noexpand\makeatother%
}%
\axp@VerbatimOut
}
@@ -374,13 +375,17 @@
\let\endnestedproof\endaxp@oldproof
\newcounter{axp@seccounter}
\def\axp@sectitle{}
- \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}}
\let\axp@oldsection\section
\def\section{\@ifstar\@section\@@section}
\newcommand{\@section}[2][\relax]{\axp@@@section{*}{#1}{#2}}%
@@ -430,7 +435,7 @@
\axp@oldbibliography{#1}%
}
}{}
- \AtEndDocument{
+ \pretocmd{\@enddocumenthook}{%
\ifdefined\NAT@testdef
\renewcommand\bibcite[2]{%
\global\@namedef{b@#1\@extra@binfo}{#2}%
@@ -459,7 +464,7 @@
\let\bibcite\NAT@testdef
\fi
}{}
- }
+ }{}{}
}{}
\ifdefined\@acmtitlebox
\renewenvironment{proofsketch}{\begin{axp@oldproof}[sketch]}{\end{axp@oldproof}}