summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-04-01 21:32:49 +0000
committerKarl Berry <karl@freefriends.org>2012-04-01 21:32:49 +0000
commit9b116137f26dae6d64e8bd0fb307c7eaf92627a1 (patch)
tree39142d66fb4aee0fd3f0a44650dcd3cc594360f0
parent1fedf7730131627fc42776988e6bf0b316d5910e (diff)
ifthenx (1apr12)
git-svn-id: svn://tug.org/texlive/trunk@25819 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/ifthenx/README15
-rw-r--r--Master/texmf-dist/tex/latex/ifthenx/ifthenx.sty39
2 files changed, 33 insertions, 21 deletions
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)
<geoffrey stop jones snailshell uqconnect stop edu stop au>
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)
% <geoffrey stop jones snailshell uqconnect stop edu stop au>
%
% 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{<pkgname>}}{<true part>}{<false part>}
@@ -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}}{<true part>}{<false part>}
-% will branch to the <true part> path.
+% will branch along the <true part> 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{%