diff options
author | Karl Berry <karl@freefriends.org> | 2007-04-24 23:59:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-04-24 23:59:16 +0000 |
commit | e5b5774fb869f9df3c583add33d5dc9f025f4b46 (patch) | |
tree | 57ffaa5ab86519c1910c0eb5cb0bbcc44446ae89 /Master/texmf-dist/tex/latex | |
parent | 372e8497bf41d3fe0563c5c44fac9957c553a376 (diff) |
xifthen update (23apr07)
git-svn-id: svn://tug.org/texlive/trunk@4186 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/xifthen/xifthen.sty | 104 |
1 files changed, 93 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/latex/xifthen/xifthen.sty b/Master/texmf-dist/tex/latex/xifthen/xifthen.sty index 081ac3ab696..ba973cd60ab 100644 --- a/Master/texmf-dist/tex/latex/xifthen/xifthen.sty +++ b/Master/texmf-dist/tex/latex/xifthen/xifthen.sty @@ -1,8 +1,7 @@ -\def \@tempa $#1 #2 #3 #4 #5 #6 #7 ${% - \def \filedate {#4}% - \def \fileversion {v#3}% -} -\@tempa $Id: xifthen.sty,v 1.1.1.1 2006/03/25 01:24:34 noirel Exp $ +% $Date: 2007-04-21 17:11:50 +0200 (Sat, 21 Apr 2007) $ +% $Revision: 28 $ +\def \filedate {2007/04/21}% +\def \fileversion {v1.1}% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{xifthen}% [\filedate \space \fileversion \space Extended ifthen features] @@ -12,28 +11,86 @@ \RequirePackage{ifthen} \RequirePackage{ifmtarg} +% \cnttest {<counter expression>} {<relation>} {<counter expression>} +% \newcommand*{\TE@cnttest}[4]{% \TE@throw \noexpand \calc@assign@count{\@tempcnta}{\unexpanded{#1}}% \noexpand \calc@assign@count{\@tempcntb}{\unexpanded{#3}}% - \noexpand \ifnum \@tempcnta#2\@tempcntb + \noexpand \if \noexpand \TE@cnttest@ {#2}% #4% } +\newcommand*{\TE@cnttest@}[1]{% + \ifcsname TE@cnttest@@#1\endcsname + \csname TE@cnttest@@#1\expandafter\expandafter\expandafter \endcsname + \expandafter \@gobble + \else + \expandafter \@firstofone + \fi + {FF\PackageError{xifthen}{Not a valid comparison operator "#1"}% + {Valid comparisons are <, =, >, <=, and =>.}}% +} + +\@namedef{TE@cnttest@@<}{\ifnum \@tempcnta<\@tempcntb AA\else AB\fi} +\@namedef{TE@cnttest@@>}{\ifnum \@tempcnta>\@tempcntb AA\else AB\fi} +\@namedef{TE@cnttest@@=}{\ifnum \@tempcnta=\@tempcntb AA\else AB\fi} +\@namedef{TE@cnttest@@<=}{% + \ifnum \@tempcnta<\@tempcntb AA\else + \ifnum \@tempcnta=\@tempcntb AA\else AB\fi + \fi +} +\@namedef{TE@cnttest@@>=}{% + \ifnum \@tempcnta>\@tempcntb AA\else + \ifnum \@tempcnta=\@tempcntb AA\else AB\fi + \fi +} + +% \dimtest {<dimension expression>} {<relation>} {<dimension expression>} +% \newcommand*{\TE@dimtest}[4]{% \TE@throw \noexpand \calc@assign@skip{\@tempskipa}{\unexpanded{#1}}% \noexpand \calc@assign@skip{\@tempskipb}{\unexpanded{#3}}% - \noexpand \ifdim \@tempskipa#2\@tempskipb + \noexpand \if \noexpand \TE@dimtest@ {#2}% #4% } +\newcommand*{\TE@dimtest@}[1]{% + \ifcsname TE@dimtest@@#1\endcsname + \csname TE@dimtest@@#1\expandafter\expandafter\expandafter \endcsname + \expandafter \@gobble + \else + \expandafter \@firstofone + \fi + {FF\PackageError{xifthen}{Not a valid comparison operator "#1"}% + {Valid comparisons are <, =, >, <=, and =>.}}% +} + +\@namedef{TE@dimtest@@<}{\ifdim \@tempskipa<\@tempskipb AA\else AB\fi} +\@namedef{TE@dimtest@@>}{\ifdim \@tempskipa>\@tempskipb AA\else AB\fi} +\@namedef{TE@dimtest@@=}{\ifdim \@tempskipa=\@tempskipb AA\else AB\fi} +\@namedef{TE@dimtest@@<=}{% + \ifdim \@tempskipa<\@tempskipb AA\else + \ifdim \@tempskipa=\@tempskipb AA\else AB\fi + \fi +} +\@namedef{TE@dimtest@@>=}{% + \ifdim \@tempskipa>\@tempskipb AA\else + \ifdim \@tempskipa=\@tempskipb AA\else AB\fi + \fi +} + +% \isnamedefined {<command name>} +% \newcommand*{\TE@isnamedefined}[2]{% \TE@throw \noexpand \ifcsname #1\endcsname #2% } +% \isempty {<content>} +% \newcommand*{\TE@isempty}[2]{% \TE@throw \noexpand \if FF\noexpand \@nameuse{fi}% @@ -45,12 +102,34 @@ #2% } +% \isequivalentto {<command>} {<command>} +% \newcommand*{\TE@isequivalentto}[3]{% \TE@throw \noexpand \ifx \noexpand #1\noexpand#2% #3% } +% \isin {<substring>} {<string>} +% +\newcommand*{\TE@isin}[3]{% + \TE@throw + \unexpanded {\in@{#1}{#2}}% + \noexpand \ifin@ + #3% +} + +% \endswith {<string>} {<substring>} +% +\newcommand*{\TE@endswith}[3]{% + \TE@throw + \unexpanded {\in@{#2\@nil}{#1\@nil}}% + \noexpand \ifin@ + #3% +} + +% \newtest <command> [<number>] {<definition>} +% \newcommand*{\newtest}[1]{% \@ifnextchar[{% \@newtest{#1}% @@ -76,10 +155,13 @@ \newcommand*{\TE@hook}{% \let \isequivalentto = \TE@isequivalentto - \let \isnamedefined = \TE@isnamedefined - \let \isempty = \TE@isempty - \let \cnttest = \TE@cnttest - \let \dimtest = \TE@dimtest + \let \terminateswith = \TE@endswith % For compability reasons (deprecated) + \let \endswith = \TE@endswith + \let \isnamedefined = \TE@isnamedefined + \let \isempty = \TE@isempty + \let \cnttest = \TE@cnttest + \let \dimtest = \TE@dimtest + \let \isin = \TE@isin } \renewcommand{\ifthenelse}[1]{% |