From 9b116137f26dae6d64e8bd0fb307c7eaf92627a1 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 1 Apr 2012 21:32:49 +0000 Subject: ifthenx (1apr12) git-svn-id: svn://tug.org/texlive/trunk@25819 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/ifthenx/README | 15 ++++++---- Master/texmf-dist/tex/latex/ifthenx/ifthenx.sty | 39 +++++++++++++++---------- 2 files changed, 33 insertions(+), 21 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/ifthenx/README b/Master/texmf-dist/doc/latex/ifthenx/README index 954344ce2d6..1f767c8ef9c 100644 --- a/Master/texmf-dist/doc/latex/ifthenx/README +++ b/Master/texmf-dist/doc/latex/ifthenx/README @@ -1,4 +1,4 @@ -ifthenx.sty Copyright (C) 2012 Geoffrey Jones 2012/03/31 (v0.1) +ifthenx.sty Copyright (C) 2012 Geoffrey Jones 2012/04/01 (v0.1a) Package ifthenx.sty -- this little package extends David Carlisle's @@ -63,13 +63,16 @@ Related Packages: own modified version instead). If loaded in the recommended order, users can ``mix and match'' the tests. For example: - \newcommand\foo{-4} - \ifthenelse{\NOT\isundefined{\foo} % native ifthen pkg cmd - \AND\isnamedefined{foo} % xifthen pkg command - \AND\isnumber{\foo}}{true}{false} % ifthenx pkg command + \newcommand*\foo{3} + \newcommand*\baz{98} + \ifthenelse{ + \isnumber{\foo} % ifthenx pkg command + \AND\isodd{\foo} % ifthen pkg command + \AND\cnttest{\foo + \baz}{>}{100} % xifthen pkg command + }{true}{false} evaluates true. -Version: v0.1 *** prerelease *** +Version: v0.1a *** release for comments *** The author would welcome bug reports, comments, suggestions, extensions and so forth at this early stage. diff --git a/Master/texmf-dist/tex/latex/ifthenx/ifthenx.sty b/Master/texmf-dist/tex/latex/ifthenx/ifthenx.sty index 3c699818985..147984fe7e2 100644 --- a/Master/texmf-dist/tex/latex/ifthenx/ifthenx.sty +++ b/Master/texmf-dist/tex/latex/ifthenx/ifthenx.sty @@ -1,6 +1,6 @@ -% $Id: ifthenx.sty 784 2012-03-31 12:00:47Z Geoffrey $ +% $Id: ifthenx.sty 790 2012-04-01 10:59:41Z Geoffrey $ % -% ifthenx.sty Copyright (C) 2012 Geoffrey Jones 2012/03/31 (v0.1) +% ifthenx.sty Copyright (C) 2012 Geoffrey Jones 2012/04/01 (v0.1a) % % % Package ifthenx.sty -- this little package extends David Carlisle's @@ -65,13 +65,16 @@ % own modified version instead). If loaded in the recommended order, % users can ``mix and match'' the tests. % For example: -% \newcommand\foo{-4} -% \ifthenelse{\NOT\isundefined{\foo} % native ifthen pkg cmd -% \AND\isnamedefined{foo} % xifthen pkg command -% \AND\isnumber{\foo}}{true}{false} % ifthenx pkg command +% \newcommand*\foo{3} +% \newcommand*\baz{98} +% \ifthenelse{ +% \isnumber{\foo} % ifthenx pkg command +% \AND\isodd{\foo} % ifthen pkg command +% \AND\cnttest{\foo + \baz}{>}{100} % xifthen pkg command +% }{true}{false} % evaluates true. % -% Version: v0.1 *** prerelease *** +% Version: v0.1a *** release for comments *** % The author would welcome bug reports, comments, suggestions, % extensions and so forth at this early stage. % @@ -93,7 +96,7 @@ \NeedsTeXFormat{LaTeX2e}[1994/12/01] \ProvidesPackage{ifthenx} - [2012/03/31 (v0.1) ifthen package extensions (GJ)] + [2012/04/01 (v0.1a) ifthen package extensions (GJ)] \RequirePackage{ifthen} @@ -132,6 +135,8 @@ % macro. The helper writes `!' or `?' to a temporary macro, % respectively to signify test success/true or failure/false. % This is then expanded and responded to by the mainline command. +% Note that, where appropriate (the number tests), we ensure that +% any `!' contained in arguments won't interrupt this pattern. %------------------------------------------------------------------ % \ifthenelse{\packageloaded{}}{}{} @@ -157,7 +162,7 @@ % Normal TeX file search conventions apply, e.g., if file `x.tex' % exists in the TEXMF file structure or a local path, then % \ifthenelse{\fileexists{x}}{}{} -% will branch to the path. +% will branch along the path. % % \input@path will be searched if the file isn't found in the % installation TEXMF tree. This can be configured; for example, @@ -167,7 +172,7 @@ % % Also note that this test trims leading (but not trailing) space % characters from its argument before producing its result. Like -% LateX's native \IfFileExists, this test returns false if passed +% LaTeX's native \IfFileExists, this test returns false if passed % an empty (zero length) filename and, rather absurdly, true % if the filename expands to \relax. % @@ -231,14 +236,16 @@ \def\itx@@gobblefirstdecimalpoint#1.#2\@empty#3\relax{#1#2} \def\itx@ispositiveinteger#1#2{% - \TE@throw\noexpand\itx@@ispositiveinteger#1\noexpand\@nil% + \TE@throw\noexpand\in@{!}{#1}% + \noexpand\itx@@ispositiveinteger#1\noexpand\@nil% \noexpand\if!\@tempa#2} \def\itx@@ispositiveinteger#1\@nil{% - \def\@tempa{\ifnum9<1#1!\else?\fi}} + \def\@tempa{\ifin@?\else\ifnum9<1#1!\else?\fi\fi}} \def\itx@isinteger#1#2{% - \TE@throw\noexpand\itx@@isinteger#1\noexpand\@nil% + \TE@throw\noexpand\in@{!}{#1}% + \noexpand\itx@@isinteger#1\noexpand\@nil% \noexpand\if!\@tempa#2} \def\itx@@isinteger#1\@nil{% @@ -246,7 +253,8 @@ \expandafter{\expandafter\itx@gobbleleadingminus#1}\@nil} \def\itx@ispositiverealnumber#1#2{% - \TE@throw\noexpand\itx@@ispositiverealnumber#1\noexpand\@nil% + \TE@throw\noexpand\in@{!}{#1}% + \noexpand\itx@@ispositiverealnumber#1\noexpand\@nil% \noexpand\if!\@tempa#2} \def\itx@@ispositiverealnumber#1\@nil{% @@ -255,7 +263,8 @@ \expandafter{#1}}\@nil} \def\itx@isrealnumber#1#2{% - \TE@throw\noexpand\itx@@isrealnumber#1\noexpand\@nil% + \TE@throw\noexpand\in@{!}{#1}% + \noexpand\itx@@isrealnumber#1\noexpand\@nil% \noexpand\if!\@tempa#2} \def\itx@@isrealnumber#1\@nil{% -- cgit v1.2.3