From e508801ab0b9dae308a9f31a025735094bf1ac22 Mon Sep 17 00:00:00 2001 From: "Dr. Clea F. Rees" Date: Fri, 7 Aug 2009 00:42:54 +0000 Subject: etoolbox new version git-svn-id: svn://tug.org/texlive/trunk@14559 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/etoolbox/etoolbox.def | 24 ++++---- Master/texmf-dist/tex/latex/etoolbox/etoolbox.sty | 67 +++++++++++++++++++---- 2 files changed, 68 insertions(+), 23 deletions(-) (limited to 'Master/texmf-dist/tex/latex/etoolbox') diff --git a/Master/texmf-dist/tex/latex/etoolbox/etoolbox.def b/Master/texmf-dist/tex/latex/etoolbox/etoolbox.def index 41540333b44..c9f791e4442 100644 --- a/Master/texmf-dist/tex/latex/etoolbox/etoolbox.def +++ b/Master/texmf-dist/tex/latex/etoolbox/etoolbox.def @@ -1,6 +1,6 @@ -% $Id: etoolbox.def,v 1.7 2008/06/28 18:25:41 lehman stable $ +% $Id: etoolbox.def,v 1.8 2009/08/06 16:50:04 lehman stable $ -\ProvidesFile{etoolbox.def}[2008/06/28 v1.7 etoolbox debug messages] +\ProvidesFile{etoolbox.def}[2009/08/06 v1.8 etoolbox debug messages] \begingroup \makeatletter @@ -43,18 +43,18 @@ redefining macro now} \gdef\etb@msg@s@ret{% retokenizing macro now} -\gdef\etb@msg@f@def{% - control sequence is undefined or \@backslashchar relax} +\xdef\etb@msg@f@def{% + control sequence is undefined or \string\relax} \gdef\etb@msg@f@mac{% control sequence is not a macro} -\gdef\etb@msg@f@tok{% - macro cannot be retokenized cleanly\etb@msg@ex - the macro may have been defined under a category\etb@msg@br - code regime different from the current one\etb@msg@ex - the replacement text may contain special control\etb@msg@br - sequence tokens formed with \@backslashchar - csname...\@backslashchar endcsname;\etb@msg@ex - the replacement text may contain carriage return,\etb@msg@br +\xdef\etb@msg@f@tok{% + macro cannot be retokenized cleanly\noexpand\etb@msg@ex + the macro may have been defined under a category\noexpand\etb@msg@br + code regime different from the current one\noexpand\etb@msg@ex + the replacement text may contain special control\noexpand\etb@msg@br + sequence tokens formed with + \string\csname...\string\endcsname;\noexpand\etb@msg@ex + the replacement text may contain carriage return,\noexpand\etb@msg@br newline, or similar characters} \xdef\etb@msg@f@hsh{% nested patching command and parameters in patch\noexpand\etb@msg@ex diff --git a/Master/texmf-dist/tex/latex/etoolbox/etoolbox.sty b/Master/texmf-dist/tex/latex/etoolbox/etoolbox.sty index c026d1407e0..d1292913092 100644 --- a/Master/texmf-dist/tex/latex/etoolbox/etoolbox.sty +++ b/Master/texmf-dist/tex/latex/etoolbox/etoolbox.sty @@ -1,6 +1,6 @@ -% $Id: etoolbox.sty,v 1.7 2008/06/28 18:25:41 lehman stable $ +% $Id: etoolbox.sty,v 1.8 2009/08/06 16:50:04 lehman stable $ -% Copyright (c) 2007-2008 Philipp Lehman. +% Copyright (c) 2007-2009 Philipp Lehman. % % Permission is granted to copy, distribute and/or modify this % software under the terms of the LaTeX Project Public License @@ -15,7 +15,7 @@ % particular purpose. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{etoolbox}[2008/06/28 v1.7 e-TeX tools for LaTeX] +\ProvidesPackage{etoolbox}[2009/08/06 v1.8 e-TeX tools for LaTeX] \begingroup \@ifundefined{eTeXversion} @@ -36,12 +36,16 @@ \catcode\number`\|=\the\catcode`\|\relax \catcode\number`\:=\the\catcode`\:\relax \catcode\number`\-=\the\catcode`\-\relax + \catcode\number`\==\the\catcode`\=\relax + \catcode\number`\<=\the\catcode`\<\relax \catcode\number`\>=\the\catcode`\>\relax } \catcode`\&=3 \catcode`\|=3 \@makeother\: \@makeother\- +\@makeother\= +\@makeother\< \@makeother\> \AtEndOfPackage{% @@ -374,6 +378,50 @@ \etb@ifblank@i#1&&\@secondoftwo\@firstoftwo:} \long\def\etb@ifblank@i#1#2#4#5:{#4} +% {}{}{}{}{} + +\newcommand*{\ifnumcomp}[3]{% + \ifnum\numexpr#1\relax + #2\numexpr#3\relax + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi} + +% {}{}{}{} + +\newcommand*{\ifnumequal}[1]{% + \ifnumcomp{#1}=} + +\newcommand*{\ifnumgreater}[1]{% + \ifnumcomp{#1}>} + +\newcommand*{\ifnumless}[1]{% + \ifnumcomp{#1}<} + +% {}{}{}{}{} + +\newcommand*{\ifdimcomp}[3]{% + \ifdim\dimexpr#1\relax + #2\dimexpr#3\relax + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi} + +% {}{}{}{} + +\newcommand*{\ifdimequal}[1]{% + \ifdimcomp{#1}=} + +\newcommand*{\ifdimgreater}[1]{% + \ifdimcomp{#1}>} + +\newcommand*{\ifdimless}[1]{% + \ifdimcomp{#1}<} + +% {}{}{} + % {} \newcommand*{\expandonce}[1]{% @@ -575,19 +623,19 @@ \newrobustcmd*{\csmugdef}[1]{% \expandafter\mugdef\csname#1\endcsname} -% {}{} +% {}{} \newrobustcmd*{\defcounter}[2]{% \ifcsundef{c@#1} {\etb@noglobal\@nocounterr{#1}}% - {\csname c@#1\endcsname\numexpr#2\relax\relax}} + {\csname c@#1\endcsname\numexpr#2\relax}} -% {}{} +% {}{} \newrobustcmd*{\deflength}[2]{% \ifundef{#1} {\etb@noglobal\etb@err@nolen{#1}}% - {#1\dimexpr#2\relax\relax}} + {#1\glueexpr#2\relax}} \protected\def\etb@err@nolen#1{% \etb@error{Length \string#1 undefined}\@eha} @@ -964,10 +1012,7 @@ \newcommand{\rmntonum}[1]{% \ifblank{#1} {} - {\expandafter\expandafter - \expandafter\etb@rti@end - \expandafter\number - \expandafter\numexpr + {\expandafter\etb@rti@end\number\numexpr \expandafter\etb@rti@prs\detokenize{#1}&\relax}} \def\etb@rti@prs#1#2{% -- cgit v1.2.3