diff options
author | Karl Berry <karl@freefriends.org> | 2017-06-05 23:14:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-06-05 23:14:20 +0000 |
commit | 83aa814bc3de55078e4a1b9dad1ad44fd153fcd1 (patch) | |
tree | 60753619db7724240b62906e425028e53536a1eb /Master | |
parent | 4988588dea2538d0703acbac265cb4cd85fcc26a (diff) |
apxproof (31may17)
git-svn-id: svn://tug.org/texlive/trunk@44478 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/apxproof/apxproof.pdf | bin | 440812 -> 442682 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/apxproof/apxproof.dtx | 71 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/apxproof/apxproof.sty | 27 |
3 files changed, 68 insertions, 30 deletions
diff --git a/Master/texmf-dist/doc/latex/apxproof/apxproof.pdf b/Master/texmf-dist/doc/latex/apxproof/apxproof.pdf Binary files differindex a9836d91ed8..48ed383adac 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/apxproof.dtx b/Master/texmf-dist/source/latex/apxproof/apxproof.dtx index 9f46f84e254..602025b0ab1 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> [2017/03/17 v1.0.4 Automatic proofs in appendix] +%<package> [2017/05/31 v1.0.5 Automatic proofs in appendix] % %<*driver> \documentclass{ltxdoc} @@ -44,7 +44,7 @@ %</driver> % \fi % -% \CheckSum{482} +% \CheckSum{498} % % \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 @@ -189,16 +189,28 @@ This proof is in the appendix. % once in the main text, and once in the appendix before the proof of % the statement. To use this feature, you can define a new % \emph{repeated theorem} environment using the |\newtheoremrep| command: +% \changes{v1.0.5}{2017/05/31}{Ability to specify a sectioning counter in newtheoremrep} % \begin{quote} -% |\newtheoremrep|\marg{name}\oarg{counter}\marg{title}\DescribeMacro{\newtheoremrep} +% |\newtheoremrep|\marg{name}\oarg{counter}\marg{title}\oarg{countersec}\DescribeMacro{\newtheoremrep} % \end{quote} % Usage is exactly the same as that of AMS \LaTeX{}'s |\newtheorem| -% macro: \meta{name} (e.g., |theorem|) is the name of an environment that is created for this kind of -% theorem, \meta{counter} (e.g., |definition|) is an optional counter describing -% from which kind of enviroment should the numbering of these environments be -% inherited, and \meta{title} +% macro: +% \begin{itemize} +% \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 +% inherited; +% \item \meta{title} % (e.g., |Theorem|) is -% the title that will be used to display this theorem environment. What +% the title that will be used to display this theorem environment; +% \item \meta{countersec} (e.g., |section|) is an optional counter of a +% sectioning command indicating that counters for this theorem should +% be prefixed by this counter (and reset at each occurrence of the +% sectioning command). +% \end{itemize} +% \meta{counter} and \meta{countersec} should not be used together. +% What % differs from |\newtheorem| is that, when the following is written: % \begin{quote} % |\newtheoremrep{foobar}{Foobar}| @@ -264,6 +276,7 @@ This is the proof of the repeated foobar. % When the proof is deferred to the appendix, it is common practice to % add a proof sketch in the main text. \textsf{apxproof} defines a simple % |proofsketch| environment for this purpose: +% \changes{v1.0.5}{2017/05/31}{Fix compilation of proofsketch environment in inline mode} % \begin{quote} % |\begin{proofsketch}|\DescribeEnv{proofsketch}\\ % \hspace*{1em}\dots\\ @@ -576,17 +589,23 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \end{macrocode} % \subsection{Macros Common to All Compilation Modes} % \begin{macro}{\newtheoremrep} +% \begin{macro}{\axp@newtheoremreptmp} % We define the high-level |\newtheoremrep| to have the same syntax as % \textsf{amsthm}'s |\newtheorem|. For this purpose, we need a little -% trick to deal with the second optional argument, which is what -% |\@oparg| is used for. |\axp@newtheoremrep| is defined differently +% trick to deal with the second and fourth optional arguments, which is what +% |\@oparg| and |\axp@newtheoremrep| are +% used for. |\axp@newtheoremrep| is defined differently % depending on the compilation mode % \begin{macrocode} \newcommand\newtheoremrep[1]{% - \@oparg{\axp@newtheoremrep{#1}}[]% + \@oparg{\axp@newtheoremreptmp{#1}}[]% +} +\def\axp@newtheoremreptmp#1[#2]#3{% + \@oparg{\axp@newtheoremrep{#1}[#2]{#3}}[]% } % \end{macrocode} % \end{macro} +% \end{macro} % \begin{environment}{proofsketch} % Simple |proofsketch| environment. % \changes{v1.0.3}{2016/12/16}{Ignore spaces after beginning of Proof sketch} @@ -654,6 +673,13 @@ This is a citation in the appendix~\cite{proofsAreHard}. \renewenvironment{proofsketch}{\begin{axp@oldproof}[sketch]}{\end{axp@oldproof}} }{} % \end{macrocode} +% \begin{environment}{axp@oldproof} +% We save the definition of the existing |proof| environment. +% \begin{macrocode} + \let\axp@oldproof\proof + \let\endaxp@oldproof\endproof +% \end{macrocode} +% \end{environment} % \subsection{Inline Compilation Mode} % \begin{macrocode} \ifthenelse{\equal{\axp@appendix}{inline}}{ @@ -664,10 +690,14 @@ This is a citation in the appendix~\cite{proofsAreHard}. % document class), invokes |\newtheorem| and creates a repeated theorem % environment that behaves exactly as the regular theorem environment. % \begin{macrocode} - \def\axp@newtheoremrep#1[#2]#3{% + \def\axp@newtheoremrep#1[#2]#3[#4]{% \expandafter\let\csname #1\endcsname\undefined \expandafter\let\csname c@#1\endcsname\undefined - \newtheorem{#1}[#2]{#3}% + \ifx\relax#4\relax + \newtheorem{#1}[#2]{#3}% + \else + \newtheorem{#1}{#3}[#4]% + \fi \NewEnviron{#1rep}[1][]{% \begin{#1}[##1]\BODY\end{#1}% } @@ -789,10 +819,14 @@ This is a citation in the appendix~\cite{proofsAreHard}. % expect a proof in the appendix) and |\newtheorem*| for an internal version |axp@foobarrp| that % will be used in the appendix to restate the existing theorem. % \begin{macrocode} - \def\axp@newtheoremrep#1[#2]#3{% + \def\axp@newtheoremrep#1[#2]#3[#4]{% \expandafter\let\csname #1\endcsname\undefined \expandafter\let\csname c@#1\endcsname\undefined - \newtheorem{#1}[#2]{#3}% + \ifx\relax#4\relax + \newtheorem{#1}[#2]{#3}% + \else + \newtheorem{#1}{#3}[#4]% + \fi \expandafter\pretocmd\csname #1\endcsname{\noproofinappendix}{}{}% \newtheorem*{axp@#1rp}{#3}% % \end{macrocode} @@ -836,13 +870,6 @@ This is a citation in the appendix~\cite{proofsAreHard}. % \end{macrocode} % \end{macro} % \subsubsection{Proof Environments} -% \begin{environment}{axp@oldproof} -% We save the definition of the existing |proof| environment. -% \begin{macrocode} - \let\axp@oldproof\proof - \let\endaxp@oldproof\endproof -% \end{macrocode} -% \end{environment} % \begin{macro}{\noproofinappendix} % Utility macro that toggles |axp@seenreptheorem| to false. % \begin{macrocode} diff --git a/Master/texmf-dist/tex/latex/apxproof/apxproof.sty b/Master/texmf-dist/tex/latex/apxproof/apxproof.sty index 9ca76fd8d19..ef8e571af9d 100644 --- a/Master/texmf-dist/tex/latex/apxproof/apxproof.sty +++ b/Master/texmf-dist/tex/latex/apxproof/apxproof.sty @@ -27,7 +27,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{apxproof} - [2017/03/17 v1.0.4 Automatic proofs in appendix] + [2017/05/31 v1.0.5 Automatic proofs in appendix] \RequirePackage{bibunits} \RequirePackage{environ} \RequirePackage{etoolbox} @@ -73,7 +73,10 @@ package apxproof} }} \newcommand\newtheoremrep[1]{% - \@oparg{\axp@newtheoremrep{#1}}[]% + \@oparg{\axp@newtheoremreptmp{#1}}[]% +} +\def\axp@newtheoremreptmp#1[#2]#3{% + \@oparg{\axp@newtheoremrep{#1}[#2]{#3}}[]% } \newenvironment{proofsketch}{\begin{axp@oldproof}[Proof sketch]}{\end{axp@oldproof}} \AtBeginDocument{% @@ -102,11 +105,17 @@ \@ifclassloaded{llncs}{ \renewenvironment{proofsketch}{\begin{axp@oldproof}[sketch]}{\end{axp@oldproof}} }{} + \let\axp@oldproof\proof + \let\endaxp@oldproof\endproof \ifthenelse{\equal{\axp@appendix}{inline}}{ - \def\axp@newtheoremrep#1[#2]#3{% + \def\axp@newtheoremrep#1[#2]#3[#4]{% \expandafter\let\csname #1\endcsname\undefined \expandafter\let\csname c@#1\endcsname\undefined - \newtheorem{#1}[#2]{#3}% + \ifx\relax#4\relax + \newtheorem{#1}[#2]{#3}% + \else + \newtheorem{#1}{#3}[#4]% + \fi \NewEnviron{#1rep}[1][]{% \begin{#1}[##1]\BODY\end{#1}% } @@ -147,10 +156,14 @@ {\endVerbatimOut} \newtoggle{axp@seenreptheorem} \newcounter{axp@rpcounter} - \def\axp@newtheoremrep#1[#2]#3{% + \def\axp@newtheoremrep#1[#2]#3[#4]{% \expandafter\let\csname #1\endcsname\undefined \expandafter\let\csname c@#1\endcsname\undefined - \newtheorem{#1}[#2]{#3}% + \ifx\relax#4\relax + \newtheorem{#1}[#2]{#3}% + \else + \newtheorem{#1}{#3}[#4]% + \fi \expandafter\pretocmd\csname #1\endcsname{\noproofinappendix}{}{}% \newtheorem*{axp@#1rp}{#3}% \NewEnviron{#1rep}[1][]{% @@ -172,8 +185,6 @@ } } } - \let\axp@oldproof\proof - \let\endaxp@oldproof\endproof \newcommand\noproofinappendix{% \global\togglefalse{axp@seenreptheorem}% } |