diff options
author | Karl Berry <karl@freefriends.org> | 2019-10-09 21:56:43 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-10-09 21:56:43 +0000 |
commit | 68870d6c60b48ad4fb4d0395942495c8409ef0c3 (patch) | |
tree | 0131b14554948d4f77db9fb316c2f8d70b2220b3 | |
parent | 471569c5ee34496ab0adf5a1139e53203e8b0343 (diff) |
apxproof (9oct19)
git-svn-id: svn://tug.org/texlive/trunk@52324 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/apxproof/README.md | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/apxproof/apxproof.pdf | bin | 559200 -> 561064 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/apxproof/Makefile | 20 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/apxproof/apxproof.dtx | 268 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/apxproof/apxproof.ins | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/apxproof/apxproof.sty | 118 |
6 files changed, 225 insertions, 187 deletions
diff --git a/Master/texmf-dist/doc/latex/apxproof/README.md b/Master/texmf-dist/doc/latex/apxproof/README.md index 512574166ad..d8cef5cda48 100644 --- a/Master/texmf-dist/doc/latex/apxproof/README.md +++ b/Master/texmf-dist/doc/latex/apxproof/README.md @@ -20,12 +20,12 @@ In addition to a working installation of LaTeX2e, `apxproof` relies on a 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 diff --git a/Master/texmf-dist/doc/latex/apxproof/apxproof.pdf b/Master/texmf-dist/doc/latex/apxproof/apxproof.pdf Binary files differindex 0a0de8d3eef..6ae1a640f6c 100644 --- a/Master/texmf-dist/doc/latex/apxproof/apxproof.pdf +++ b/Master/texmf-dist/doc/latex/apxproof/apxproof.pdf diff --git a/Master/texmf-dist/source/latex/apxproof/Makefile b/Master/texmf-dist/source/latex/apxproof/Makefile deleted file mode 100644 index d24336a7d7c..00000000000 --- a/Master/texmf-dist/source/latex/apxproof/Makefile +++ /dev/null @@ -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 $< diff --git a/Master/texmf-dist/source/latex/apxproof/apxproof.dtx b/Master/texmf-dist/source/latex/apxproof/apxproof.dtx index 25de2a7dcb2..2385984fd88 100644 --- a/Master/texmf-dist/source/latex/apxproof/apxproof.dtx +++ b/Master/texmf-dist/source/latex/apxproof/apxproof.dtx @@ -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 @@ This proof is in the appendix. % \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 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \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 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \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 @@ This is a citation in the appendix~\cite{proofsAreHard}. % 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 @@ This is a citation in the appendix~\cite{proofsAreHard}. % (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 @@ This is a citation in the appendix~\cite{proofsAreHard}. % 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 @@ This is a citation in the appendix~\cite{proofsAreHard}. % 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 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \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 @@ This is a citation in the appendix~\cite{proofsAreHard}. package apxproof} }}} \ifthenelse{\equal{\axp@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@bibliography}{common}}{ \message{apxproof: Common bibliography for appendix and main text} @@ -619,6 +630,34 @@ This is a citation in the appendix~\cite{proofsAreHard}. }} % \end{macrocode} % \subsection{Macros Common to All Compilation Modes} +% \begin{macro}{\axp@newtheoremrep@definetheorem} +% \changes{v1.2.0}{2019/10/01}{Restore predefined theorem counters} +% Common to all compilation modes, we define +% |\axp@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@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@newtheoremrep@definetheorem#1#2#3#4{% + \expandafter\let\csname #1\endcsname\undefined + \ifcsname c@#1\endcsname + \expandafter\expandafter\expandafter\let\expandafter\expandafter + \csname c@axp@#1\endcsname\csname c@#1\endcsname + \expandafter\let\csname c@#1\endcsname\undefined + \fi + \axp@newtheorem{#1}{#2}{#3}{#4}% + \ifcsname c@axp@#1\endcsname + \ifx\relax#2\relax + \expandafter\expandafter\expandafter\let\expandafter\expandafter + \csname c@#1\endcsname\csname c@axp@#1\endcsname + \else + \fi + \fi +} +% \end{macrocode} +% \end{macro} % \begin{macro}{\axp@newtheorem} % \changes{v1.0.6}{2018/05/10}{Introduce intermediary command for theorem % macro} @@ -630,6 +669,7 @@ This is a citation in the appendix~\cite{proofsAreHard}. % definition depending on the document class. This command uses two % intermediary commands, |\@axp@newtheorem| and |\@@axp@newtheorem|, for % the non-starred and starred versions. +% \begin{macrocode} \def\axp@newtheorem{\@ifstar\@@axp@newtheorem\@axp@newtheorem} \def\@axp@newtheorem#1#2#3#4{% \ifx\relax#4\relax @@ -641,6 +681,7 @@ This is a citation in the appendix~\cite{proofsAreHard}. \def\@@axp@newtheorem#1#2{% \newtheorem*{#1}{#2}% } +% \end{macrocode} % \end{macro} % \end{macro} % \end{macro} @@ -669,20 +710,8 @@ This is a citation in the appendix~\cite{proofsAreHard}. \newenvironment{proofsketch}{\begin{axp@oldproof}[Proof sketch]}{\end{axp@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 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \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 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % \begin{environment}{axp@oldproof} % We save the definition of the existing |proof| environment. % \begin{macrocode} @@ -721,10 +752,13 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \changes{v1.1.0}{2018/07/04}{Fix \cs{label} not being disabled % in \textsf{amsmath} environments, where \cs{label@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@redefinelabels} +% macro} % \begin{macrocode} \newcommand{\axp@redefinelabels}{% - \providecommand\label@in@display{} - \ifthenelse{\equal{\axp@appendix}{inline}}{ + \providecommand\label@in@display{}% + \ifthenelse{\equal{\axp@appendix}{inline}}{% \let\axp@oldlabel\label \let\axp@oldlabel@in@display\label@in@display \renewcommand\label[1]{% @@ -745,7 +779,7 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \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 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \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@oldproof}[sketch]}{\end{axp@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 @@ This is a citation in the appendix~\cite{proofsAreHard}. \ifthenelse{\equal{\axp@appendix}{inline}}{ % \end{macrocode} % \begin{macro}{\axp@newtheoremrep} -% In inline mode, |\axp@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@newtheoremrep| uses +% |\axp@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@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@newtheoremrep#1[#2]#3[#4]{% - \expandafter\let\csname #1\endcsname\undefined - \expandafter\let\csname c@#1\endcsname\undefined - \axp@newtheorem{#1}{#2}{#3}{#4}% + \axp@newtheoremrep@definetheorem{#1}{#2}{#3}{#4}% \NewEnviron{#1rep}[1][]{% - \begin{#1}[##1]\axp@redefinelabels\BODY\end{#1}% + \ifx\relax##1\relax + \begin{#1}\axp@redefinelabels\BODY\end{#1}% + \else + \begin{#1}[##1]\axp@redefinelabels\BODY\end{#1}% + \fi } } % \end{macrocode} @@ -883,7 +920,7 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \end{macro} % \end{environment} % \begin{macro}{\axp@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 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \begin{environment}{axp@VerbatimOut} % \begin{macro}{\FVB@axp@VerbatimOut} % \begin{macro}{\FVE@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@VerbatimOut| that writes every line @@ -959,24 +996,22 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \end{macro} % \end{macro} % \begin{macro}{axp@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@foobarrp| that +% With first argument |foobar|, we use +% |\axp@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@foobarrp| that % will be used in the appendix to restate the existing theorem. % \begin{macrocode} \def\axp@newtheoremrep#1[#2]#3[#4]{% - \expandafter\let\csname #1\endcsname\undefined - \expandafter\let\csname c@#1\endcsname\undefined - \axp@newtheorem{#1}{#2}{#3}{#4}% + \axp@newtheoremrep@definetheorem{#1}{#2}{#3}{#4}% \expandafter\pretocmd\csname #1\endcsname{\noproofinappendix}{}{}% \axp@newtheorem*{axp@#1rp}{#3}% \axp@forward@setup{#1}{#2}{#3}{#4}% % \end{macrocode} % We then define a |foobarrep| environment that increments the % |axp@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 @@ This is a citation in the appendix~\cite{proofsAreHard}. }{}% \addtocounter{axp@rpcounter}{1}% \ifx\relax##1\relax - \axp@with@forward{#1}{\begin{#1}}\label{axp@r\roman{axp@rpcounter}}\BODY\end{#1}% + \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}}\BODY\end{#1}% - \fi + \axp@with@forward{#1}{\begin{#1}[##1]}\label{axp@r\roman{axp@rpcounter}}% + \fi + \mainbodyrepeatedtheorem + \BODY\end{#1}% % \end{macrocode} % We set the |axp@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 @@ This is a citation in the appendix~\cite{proofsAreHard}. % repeated version of the theorem using the |axp@foobarrp| environment % and a reference to the previously defined label. % We use |\axp@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@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@writesection% \ifthenelse{\equal{\axp@repeqn}{same}}{% @@ -1022,16 +1071,40 @@ This is a citation in the appendix~\cite{proofsAreHard}. \noexpand\setcounter{equation}{\theaxp@equation}% }% }{}% - \immediate\write\axp@proofsfile{% + \immediate\write\axp@proofsfile{{% + \ifdefined\theopargself + \noexpand\theopargself + \else + \noexpand\pretocmd{\noexpand\@begintheorem}{% + \noexpand\patchcmd{\noexpand\thmhead}{\noexpand\@acmplainnotefont}{}{}{}% + \noexpand\patchcmd{\noexpand\thmhead}{\noexpand\the\noexpand\thm@notefont}{}{}{}% + \noexpand\patchcmd{\noexpand\thmhead}{(}{}{}{}% + \noexpand\patchcmd{\noexpand\thmhead}{)}{}{}{}% + }{}{} + \fi \noexpand\begin{axp@#1rp} - [\noexpand\ref{axp@r\roman{axp@rpcounter}}% - \@ifnotempty{##1}{ \unexpanded{##1}}]% + [% + \noexpand\ref{axp@r\roman{axp@rpcounter}}% + \@ifnotempty{##1}{% + \ifdefined\theopargself + \else + \ifdefined\@acmplainnotefont + \noexpand\@acmplainnotefont + \else + \noexpand\ifdefined\noexpand\thm@notefont + \noexpand\the\noexpand\thm@notefont + \noexpand\fi + \fi + \fi + {} (\unexpanded{##1})% + }% + ]% \noexpand\axp@forward@target{axp@fw@r\roman{axp@rpcounter}}{}% \noexpand\axp@redefinelabels \expandafter\noexpand\csname rplet\roman{axp@rpcounter}% \endcsname \noexpand\end{axp@#1rp} - }% + }}% \ifthenelse{\equal{\axp@repeqn}{same}}{% \immediate\write\axp@proofsfile{% \noexpand\setcounter{equation}{\value{axp@equationx}}% @@ -1350,15 +1423,18 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \end{macrocode} % \begin{macro}{\axp@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@oldbibliography\bibliography - \renewcommand\bibliography[1]{% - \defaultbibliography{#1}% - \axp@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@bibliography}{separate}}{ + \let\axp@oldbibliography\bibliography + \renewcommand\bibliography[1]{% + \defaultbibliography{#1}% + \axp@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 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \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@opterrshort @@ -1487,22 +1541,6 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \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@oldproof}[sketch]}{\end{axp@oldproof}} -% \end{macrocode} -% \end{macro} -% \begin{macrocode} - }{} -% \end{macrocode} -% \begin{macrocode} } % \end{macrocode} % \Finale diff --git a/Master/texmf-dist/source/latex/apxproof/apxproof.ins b/Master/texmf-dist/source/latex/apxproof/apxproof.ins index 77e0ce981bb..23cc7248a0b 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-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 diff --git a/Master/texmf-dist/tex/latex/apxproof/apxproof.sty b/Master/texmf-dist/tex/latex/apxproof/apxproof.sty index 34769d2bbd6..ff6a5fe72e4 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-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@bibliography}{separate}}{ + \RequirePackage{bibunits} \message{apxproof: Separate bibliography for appendix material} }{\ifthenelse{\equal{\axp@bibliography}{common}}{ \message{apxproof: Common bibliography for appendix and main text} @@ -81,6 +81,22 @@ \errmessage{Error: unsupported option repeqn=\axp@repeqn\ for package apxproof} }} +\def\axp@newtheoremrep@definetheorem#1#2#3#4{% + \expandafter\let\csname #1\endcsname\undefined + \ifcsname c@#1\endcsname + \expandafter\expandafter\expandafter\let\expandafter\expandafter + \csname c@axp@#1\endcsname\csname c@#1\endcsname + \expandafter\let\csname c@#1\endcsname\undefined + \fi + \axp@newtheorem{#1}{#2}{#3}{#4}% + \ifcsname c@axp@#1\endcsname + \ifx\relax#2\relax + \expandafter\expandafter\expandafter\let\expandafter\expandafter + \csname c@#1\endcsname\csname c@axp@#1\endcsname + \else + \fi + \fi +} \def\axp@newtheorem{\@ifstar\@@axp@newtheorem\@axp@newtheorem} \def\@axp@newtheorem#1#2#3#4{% \ifx\relax#4\relax @@ -99,11 +115,7 @@ \@oparg{\axp@newtheoremrep{#1}[#2]{#3}}[]% } \newenvironment{proofsketch}{\begin{axp@oldproof}[Proof sketch]}{\end{axp@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@oldproof\proof \let\endaxp@oldproof\endproof \newcommand{\axp@redefinelabels}{% - \providecommand\label@in@display{} - \ifthenelse{\equal{\axp@appendix}{inline}}{ + \providecommand\label@in@display{}% + \ifthenelse{\equal{\axp@appendix}{inline}}{% \let\axp@oldlabel\label \let\axp@oldlabel@in@display\label@in@display \renewcommand\label[1]{% @@ -146,19 +158,18 @@ \def\@@axp@newtheorem#1#2{% \spnewtheorem*{#1}{#2}{\upshape\bfseries}{\itshape}% } +\renewenvironment{proofsketch}{\begin{axp@oldproof}[sketch]}{\end{axp@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@appendix}{inline}}{ \def\axp@newtheoremrep#1[#2]#3[#4]{% - \expandafter\let\csname #1\endcsname\undefined - \expandafter\let\csname c@#1\endcsname\undefined - \axp@newtheorem{#1}{#2}{#3}{#4}% + \axp@newtheoremrep@definetheorem{#1}{#2}{#3}{#4}% \NewEnviron{#1rep}[1][]{% - \begin{#1}[##1]\axp@redefinelabels\BODY\end{#1}% + \ifx\relax##1\relax + \begin{#1}\axp@redefinelabels\BODY\end{#1}% + \else + \begin{#1}[##1]\axp@redefinelabels\BODY\end{#1}% + \fi } } \let\inlineproof\proof @@ -212,9 +223,7 @@ \newcounter{axp@equation} \newcounter{axp@equationx} \def\axp@newtheoremrep#1[#2]#3[#4]{% - \expandafter\let\csname #1\endcsname\undefined - \expandafter\let\csname c@#1\endcsname\undefined - \axp@newtheorem{#1}{#2}{#3}{#4}% + \axp@newtheoremrep@definetheorem{#1}{#2}{#3}{#4}% \expandafter\pretocmd\csname #1\endcsname{\noproofinappendix}{}{}% \axp@newtheorem*{axp@#1rp}{#3}% \axp@forward@setup{#1}{#2}{#3}{#4}% @@ -224,10 +233,12 @@ }{}% \addtocounter{axp@rpcounter}{1}% \ifx\relax##1\relax - \axp@with@forward{#1}{\begin{#1}}\label{axp@r\roman{axp@rpcounter}}\BODY\end{#1}% + \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}}\BODY\end{#1}% + \axp@with@forward{#1}{\begin{#1}[##1]}\label{axp@r\roman{axp@rpcounter}}% \fi + \mainbodyrepeatedtheorem + \BODY\end{#1}% \global\toggletrue{axp@seenreptheorem}% \global\expandafter\let\csname rplet\roman{axp@rpcounter}% \endcsname @@ -239,16 +250,40 @@ \noexpand\setcounter{equation}{\theaxp@equation}% }% }{}% - \immediate\write\axp@proofsfile{% + \immediate\write\axp@proofsfile{{% + \ifdefined\theopargself + \noexpand\theopargself + \else + \noexpand\pretocmd{\noexpand\@begintheorem}{% + \noexpand\patchcmd{\noexpand\thmhead}{\noexpand\@acmplainnotefont}{}{}{}% + \noexpand\patchcmd{\noexpand\thmhead}{\noexpand\the\noexpand\thm@notefont}{}{}{}% + \noexpand\patchcmd{\noexpand\thmhead}{(}{}{}{}% + \noexpand\patchcmd{\noexpand\thmhead}{)}{}{}{}% + }{}{} + \fi \noexpand\begin{axp@#1rp} - [\noexpand\ref{axp@r\roman{axp@rpcounter}}% - \@ifnotempty{##1}{ \unexpanded{##1}}]% + [% + \noexpand\ref{axp@r\roman{axp@rpcounter}}% + \@ifnotempty{##1}{% + \ifdefined\theopargself + \else + \ifdefined\@acmplainnotefont + \noexpand\@acmplainnotefont + \else + \noexpand\ifdefined\noexpand\thm@notefont + \noexpand\the\noexpand\thm@notefont + \noexpand\fi + \fi + \fi + {} (\unexpanded{##1})% + }% + ]% \noexpand\axp@forward@target{axp@fw@r\roman{axp@rpcounter}}{}% \noexpand\axp@redefinelabels \expandafter\noexpand\csname rplet\roman{axp@rpcounter}% \endcsname \noexpand\end{axp@#1rp} - }% + }}% \ifthenelse{\equal{\axp@repeqn}{same}}{% \immediate\write\axp@proofsfile{% \noexpand\setcounter{equation}{\value{axp@equationx}}% @@ -384,11 +419,13 @@ \let\axp@oldtableofcontents\tableofcontents \def\tableofcontents{{\let\section\axp@oldsection\axp@oldtableofcontents}} \ifthenelse{\equal{\axp@appendix}{append}}{ - \let\axp@oldbibliography\bibliography - \renewcommand\bibliography[1]{% - \defaultbibliography{#1}% - \axp@oldbibliography{#1}% - } + \ifthenelse{\equal{\axp@bibliography}{separate}}{ + \let\axp@oldbibliography\bibliography + \renewcommand\bibliography[1]{% + \defaultbibliography{#1}% + \axp@oldbibliography{#1}% + } + }{} \AtEndDocument{ \appendixprelim \appendix @@ -429,29 +466,12 @@ \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@opterrshort \renewcommand{\appendixbibliographyprelim}{% \global\let\@oldbiblabel\@biblabel \def\@biblabel{\hspace*{-2em}\small\@oldbiblabel}% } \fi - \@ifclassloaded{llncs}{ - \renewenvironment{proofsketch}{\begin{axp@oldproof}[sketch]}{\end{axp@oldproof}} - }{} } \endinput %% |