summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/etoolbox/etoolbox.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/etoolbox/etoolbox.sty')
-rw-r--r--Master/texmf-dist/tex/latex/etoolbox/etoolbox.sty67
1 files changed, 56 insertions, 11 deletions
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&#3#4#5:{#4}
+% {<numexpr>}{<comp>}{<numexpr>}{<true>}{<false>}
+
+\newcommand*{\ifnumcomp}[3]{%
+ \ifnum\numexpr#1\relax
+ #2\numexpr#3\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+
+% {<numexpr>}{<numexpr>}{<true>}{<false>}
+
+\newcommand*{\ifnumequal}[1]{%
+ \ifnumcomp{#1}=}
+
+\newcommand*{\ifnumgreater}[1]{%
+ \ifnumcomp{#1}>}
+
+\newcommand*{\ifnumless}[1]{%
+ \ifnumcomp{#1}<}
+
+% {<dimexpr>}{<comp>}{<dimexpr>}{<true>}{<false>}
+
+\newcommand*{\ifdimcomp}[3]{%
+ \ifdim\dimexpr#1\relax
+ #2\dimexpr#3\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+
+% {<dimexpr>}{<dimexpr>}{<true>}{<false>}
+
+\newcommand*{\ifdimequal}[1]{%
+ \ifdimcomp{#1}=}
+
+\newcommand*{\ifdimgreater}[1]{%
+ \ifdimcomp{#1}>}
+
+\newcommand*{\ifdimless}[1]{%
+ \ifdimcomp{#1}<}
+
+% {<string>}{<true>}{<false>}
+
% {<cstoken>}
\newcommand*{\expandonce}[1]{%
@@ -575,19 +623,19 @@
\newrobustcmd*{\csmugdef}[1]{%
\expandafter\mugdef\csname#1\endcsname}
-% {<counter>}{<value>}
+% {<counter>}{<numexpr>}
\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}}
-% {<length>}{<value>}
+% {<length>}{<glueexpr>}
\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{%