diff options
author | Karl Berry <karl@freefriends.org> | 2019-09-10 21:45:07 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-09-10 21:45:07 +0000 |
commit | a2e36e6098124b767825914adc09449f74ca3e67 (patch) | |
tree | ae3f56d8e3bce73e1ea9eb8ad0f581b5a21cd9fb /Master/texmf-dist/tex/latex/etoolbox | |
parent | e61169d86a92777b235c4339081877fd6f987296 (diff) |
etoolbox (10sep19)
git-svn-id: svn://tug.org/texlive/trunk@52073 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/etoolbox')
-rw-r--r-- | Master/texmf-dist/tex/latex/etoolbox/etoolbox.def | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/etoolbox/etoolbox.sty | 122 |
2 files changed, 84 insertions, 40 deletions
diff --git a/Master/texmf-dist/tex/latex/etoolbox/etoolbox.def b/Master/texmf-dist/tex/latex/etoolbox/etoolbox.def index 4069146dcce..59ebf9e1f49 100644 --- a/Master/texmf-dist/tex/latex/etoolbox/etoolbox.def +++ b/Master/texmf-dist/tex/latex/etoolbox/etoolbox.def @@ -1,5 +1,5 @@ \ProvidesFile{etoolbox.def} - [2018/08/19 v2.5f etoolbox debug messages (JAW)] + [2019/09/09 v2.5g etoolbox debug messages (JAW)] \begingroup \makeatletter diff --git a/Master/texmf-dist/tex/latex/etoolbox/etoolbox.sty b/Master/texmf-dist/tex/latex/etoolbox/etoolbox.sty index 067d62b92d6..189653133f1 100644 --- a/Master/texmf-dist/tex/latex/etoolbox/etoolbox.sty +++ b/Master/texmf-dist/tex/latex/etoolbox/etoolbox.sty @@ -1,5 +1,5 @@ % Copyright (c) 2007-2011 Philipp Lehman. -% (c) 2015-2018 Joseph Wright +% (c) 2015-2019 Joseph Wright % % Permission is granted to copy, distribute and/or modify this % software under the terms of the LaTeX Project Public License @@ -12,7 +12,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{etoolbox} - [2018/08/19 v2.5f e-TeX tools for LaTeX (JAW)] + [2019/09/09 v2.5g e-TeX tools for LaTeX (JAW)] \begingroup \@ifundefined{eTeXversion} @@ -268,8 +268,8 @@ {\@secondoftwo} {\ifdefmacro{#1} {\ifdefparam{#1} - {\@secondoftwo} - {\etb@ifdefempty{#1}}} + {\@secondoftwo} + {\etb@ifdefempty{#1}}} {\@secondoftwo}}} \def\etb@ifdefempty#1{% @@ -295,8 +295,8 @@ {\@firstoftwo} {\ifdefmacro{#1} {\ifdefparam{#1} - {\@secondoftwo} - {\etb@ifdefempty{#1}}} + {\@secondoftwo} + {\etb@ifdefempty{#1}}} {\@secondoftwo}}} % {<csname>}{<true>}{<false>} @@ -342,14 +342,14 @@ \ifdefmacro{#1} {\ifdefmacro{#2} {\begingroup - \edef\etb@tempa{\expandafter\strip@prefix\meaning#1}% - \edef\etb@tempb{\expandafter\strip@prefix\meaning#2}% - \ifx\etb@tempa\etb@tempb - \aftergroup\@firstoftwo - \else - \aftergroup\@secondoftwo - \fi - \endgroup} + \edef\etb@tempa{\expandafter\strip@prefix\meaning#1}% + \edef\etb@tempb{\expandafter\strip@prefix\meaning#2}% + \ifx\etb@tempa\etb@tempb + \aftergroup\@firstoftwo + \else + \aftergroup\@secondoftwo + \fi + \endgroup} {\@secondoftwo}} {\@secondoftwo}} @@ -362,7 +362,7 @@ {\@secondoftwo} {\expandafter\ifdefstrequal \csname#1\expandafter\endcsname - \csname#2\endcsname}}} + \csname#2\endcsname}}} % {<cstoken>}{<string>}{<true>}{<false>} @@ -1520,7 +1520,7 @@ {\noexpand\etb@listitem\noexpand\do{####1}% \expandafter\noexpand \csname etb@lst@\expandafter\@gobble\string#1\endcsname - \noexpand\@nil}}}% + \noexpand\@nil}}}% \@tempa} \long\def\etb@lst@@notoken@do#1{% @@ -1558,7 +1558,7 @@ {\noexpand\etb@listitem{####1}{####2}% \expandafter\noexpand \csname etb@lst@\expandafter\@gobble\string#1\endcsname - {####1}\noexpand\@nil}}}% + {####1}\noexpand\@nil}}}% \@tempa} \long\def\etb@lst@@notoken@arg#1#2{% @@ -1751,20 +1751,41 @@ \newrobustcmd{\AtBeginEnvironment}[1]{% \csgappto{@begin@#1@hook}} -\patchcmd\begin - {\csname #1\endcsname} - {\csuse{@begin@#1@hook}% - \csname #1\endcsname} - {} - {\etb@warning{% - Patching '\string\begin' failed!\MessageBreak - '\string\AtBeginEnvironment' will not work\@gobble}} +\ifcsname begin \endcsname + \expandafter\patchcmd\csname begin \endcsname + {\csname #1\endcsname} + {\csuse{@begin@#1@hook}% + \csname #1\endcsname} + {} + {\etb@warning{% + Patching '\string\begin' failed!\MessageBreak + '\string\AtBeginEnvironment' will not work\@gobble}} +\else + \patchcmd\begin + {\csname #1\endcsname} + {\csuse{@begin@#1@hook}% + \csname #1\endcsname} + {} + {\etb@warning{% + Patching '\string\begin' failed!\MessageBreak + '\string\AtBeginEnvironment' will not work\@gobble}} +\fi % {<environment>}{<code>} \newrobustcmd{\AtEndEnvironment}[1]{% \csgappto{@end@#1@hook}} +\ifcsname end \endcsname +\expandafter\patchcmd\csname end \endcsname + {\csname end#1\endcsname} + {\csuse{@end@#1@hook}% + \csname end#1\endcsname} + {} + {\etb@warning{% + Patching '\string\end' failed!\MessageBreak + '\string\AtEndEnvironment' will not work\@gobble}} +\else \patchcmd\end {\csname end#1\endcsname} {\csuse{@end@#1@hook}% @@ -1773,31 +1794,54 @@ {\etb@warning{% Patching '\string\end' failed!\MessageBreak '\string\AtEndEnvironment' will not work\@gobble}} +\fi % {<environment>}{<code>} \newrobustcmd{\BeforeBeginEnvironment}[1]{% \csgappto{@beforebegin@#1@hook}} -\pretocmd\begin - {\csuse{@beforebegin@#1@hook}} - {} - {\etb@warning{% - Patching '\string\begin' failed!\MessageBreak - '\string\BeforeBeginEnvironment' will not work\@gobble}} +\ifcsname begin \endcsname + \expandafter\pretocmd\csname begin \endcsname + {\csuse{@beforebegin@#1@hook}} + {} + {\etb@warning{% + Patching '\string\begin' failed!\MessageBreak + '\string\BeforeBeginEnvironment' will not work\@gobble}} +\else + \pretocmd\begin + {\csuse{@beforebegin@#1@hook}} + {} + {\etb@warning{% + Patching '\string\begin' failed!\MessageBreak + '\string\BeforeBeginEnvironment' will not work\@gobble}} +\fi % {<environment>}{<code>} \newrobustcmd{\AfterEndEnvironment}[1]{% \csgappto{@afterend@#1@hook}} -\patchcmd\end - {\if@ignore} - {\csuse{@afterend@#1@hook}% - \if@ignore} - {} - {\etb@warning{% - Patching '\string\end' failed!\MessageBreak - '\string\AfterEndEnvironment' will not work\@gobble}} +\let\if@ignore\relax +\ifcsname end \endcsname + \expandafter\patchcmd\csname end \endcsname + {\if@ignore} + {\csuse{@afterend@#1@hook}% + \if@ignore} + {} + {\etb@warning{% + Patching '\string\end' failed!\MessageBreak + '\string\AfterEndEnvironment' will not work\@gobble}} +\else + \patchcmd\end + {\if@ignore} + {\csuse{@afterend@#1@hook}% + \if@ignore} + {} + {\etb@warning{% + Patching '\string\end' failed!\MessageBreak + '\string\AfterEndEnvironment' will not work\@gobble}} +\fi +\let\if@ignore\iffalse \endinput |