From acfe8d23f443df0daee4ef6929bbd905070110d0 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 4 Sep 2009 00:59:35 +0000 Subject: ifmtarg update (2sep09) git-svn-id: svn://tug.org/texlive/trunk@15065 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/ifmtarg/ifmtarg.sty | 72 ++++++++++++++++++++++++ Master/texmf-dist/tex/latex/ltxmisc/ifmtarg.sty | 66 ---------------------- Master/tlpkg/bin/tlpkg-ctan-check | 2 +- Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc | 1 + Master/tlpkg/tlpsrc/ifmtarg.tlpsrc | 0 5 files changed, 74 insertions(+), 67 deletions(-) create mode 100644 Master/texmf-dist/tex/latex/ifmtarg/ifmtarg.sty delete mode 100644 Master/texmf-dist/tex/latex/ltxmisc/ifmtarg.sty create mode 100644 Master/tlpkg/tlpsrc/ifmtarg.tlpsrc (limited to 'Master') diff --git a/Master/texmf-dist/tex/latex/ifmtarg/ifmtarg.sty b/Master/texmf-dist/tex/latex/ifmtarg/ifmtarg.sty new file mode 100644 index 00000000000..f34d97e828a --- /dev/null +++ b/Master/texmf-dist/tex/latex/ifmtarg/ifmtarg.sty @@ -0,0 +1,72 @@ +% ifmtarg.sty +% +% Provides an if-then-else command for an empty macro argument +% (empty = zero or more spaces only) +% Use as \@ifmtarg{arg1}{Code for arg1 empty}{Code for arg1 not empty} +% +% Author: Peter Wilson, Herries Press +% Maintainer: Will Robertson (will dot robertson at latex-project dot org) +% Copyright Peter Wilson, 1996 +% Copyright Peter Wilson and Donald Arseneau, 2000 +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any +% later version: +% +% This work has the LPPL maintenance status "maintained". +% The Current Maintainer of this work is Will Robertson. +% +% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{ifmtarg}[2009/09/02 v1.2a check for an empty argument] + +%% Commands by Donald Arseneau +\begingroup +\catcode`\Q=3 +\long\gdef\@ifmtarg#1{\@xifmtarg#1QQ\@secondoftwo\@firstoftwo\@nil} +\long\gdef\@xifmtarg#1#2Q#3#4#5\@nil{#4} +\long\gdef\@ifnotmtarg#1{\@xifmtarg#1QQ\@firstofone\@gobble\@nil} +\endgroup + +\endinput + +% +% The \@ifmtarg command takes 3 arguments and \@ifnotmtarg takes 2 arguments. +% \@ifnotmtarg is slightly more efficient when code is only required +% for a non-empty argument. +% +% Example usages: +% \newcommand{\isempty}{1]{% +% \@ifmtarg{#1}{\typeout{YES}}{\typeout{NO}}} +% +% \isempty{} -> YES +% \isempty{ } -> YES +% \isempty{E} -> NO +% \isempty{ E } -> NO +% +% \newcommand{\isnotempty}[1]{% +% \@ifnotmtarg{#1}{\typeout{YES}}} +% +% \isnotempty{} -> +% \isnotempty{ } -> +% \isnotempty{E} -> YES +% \isnotempty{ E } -> YES +% +% In an Email to me on 13 March 2000, Donald Arseneau pointed out some +% failings with my original definition of the \@ifmtarg command: +% \newcommand{\@ifmtarg}[3]{% +% \edef\@mtarg{\zap@space#1 \@empty}% +% \ifx\@empty\@mtarg\relax #2\else #3\fi} +% +% It works most of the time correctly but Donald showed that it can +% give unexpected results +% under conditions that I had not thought of. He suggested the coding +% that now appears in the package above for the \@ifmtarg and +% \@ifnotmtarg commands. For a discussion on detecting empty arguments +% see CTAN/info/aro-bend/answer.002 +% +% +% CHANGE HISTORY +% v1.2a - New maintainer (Will Robertson) +% diff --git a/Master/texmf-dist/tex/latex/ltxmisc/ifmtarg.sty b/Master/texmf-dist/tex/latex/ltxmisc/ifmtarg.sty deleted file mode 100644 index 1c489af34c2..00000000000 --- a/Master/texmf-dist/tex/latex/ltxmisc/ifmtarg.sty +++ /dev/null @@ -1,66 +0,0 @@ -% ifmtarg.sty -% -% Provides an if-then-else command for an empty macro argument -% (empty = zero or more spaces only) -% Use as \@ifmtarg{arg1}{Code for arg1 empty}{Code for arg1 not empty} -% -% author: Peter Wilson (CUA) -% (now at peter.r.wilson@boeing.com) -% Copyright Peter Wilson, 1996 -% Copyright Peter Wilson and Donald Arseneau, 2000 -% Released under the LaTeX Project Public License -% -% -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ifmtarg}[2000/03/24 v1.2 check for an empty argument] - -%% Commands by Donald Arseneau -\begingroup -\catcode`\Q=3 -\long\gdef\@ifmtarg#1{\@xifmtarg#1QQ\@secondoftwo\@firstoftwo\@nil} -\long\gdef\@xifmtarg#1#2Q#3#4#5\@nil{#4} -\long\gdef\@ifnotmtarg#1{\@xifmtarg#1QQ\@firstofone\@gobble\@nil} -\endgroup - -\endinput - -% -% The \@ifmtarg command takes 3 arguments and \@ifnotmtarg takes 2 arguments. -% \@ifnotmtarg is slightly more efficient when code is only required -% for a non-empty argument. -% -% Example usages: -% \newcommand{\isempty}{1]{% -% \@ifmtarg{#1}{\typeout{YES}}{\typeout{NO}}} -% -% \isempty{} -> YES -% \isempty{ } -> YES -% \isempty{E} -> NO -% \isempty{ E } -> NO -% -% \newcommand{\isnotempty}[1]{% -% \@ifnotmtarg{#1}{\typeout{YES}}} -% -% \isnotempty{} -> -% \isnotempty{ } -> -% \isnotempty{E} -> YES -% \isnotempty{ E } -> YES -% -% In an Email to me on 13 March 2000, Donald Arseneau pointed out some -% failings with my original definition of the \@ifmtarg command: -% \newcommand{\@ifmtarg}[3]{% -% \edef\@mtarg{\zap@space#1 \@empty}% -% \ifx\@empty\@mtarg\relax #2\else #3\fi} -% -% It works most of the time correctly but Donald showed that it can -% give unexpected results -% under conditions that I had not thought of. He suggested the coding -% that now appears in the package above for the \@ifmtarg and -% \@ifnotmtarg commands. For a discussion on detecting empty arguments -% see CTAN/info/aro-bend/answer.002 -% -% Peter W. -% - - - diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index 24084804dfc..0df4bd47cae 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -128,7 +128,7 @@ my @WorkingTLP = qw( hhtensor histogr hitec hrlatex hvfloat hypdvips hyperref hyperxmp hyph-utf8 hyphen-base hyphenat hyphenex hyplain - ibygrk icsv IEEEconf IEEEtran ifplatform ifxetex + ibygrk icsv IEEEconf IEEEtran ifmtarg ifplatform ifxetex ijmart ijqc image-gallery impatient impatient-fr import imtekda inconsolata inlinebib inlinedef interactiveworkbook intro-scientific inversepath diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc index 9798f955cbc..c0d8a0caeda 100644 --- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc @@ -249,6 +249,7 @@ depend hyperref-docsrc depend hyperxmp depend hyphenat depend ifmslide +depend ifmtarg depend ifplatform depend image-gallery depend import diff --git a/Master/tlpkg/tlpsrc/ifmtarg.tlpsrc b/Master/tlpkg/tlpsrc/ifmtarg.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d -- cgit v1.2.3