summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/oberdiek/ltxcmds.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-05-02 21:50:45 +0000
committerKarl Berry <karl@freefriends.org>2012-05-02 21:50:45 +0000
commitaa1776c78dfdb456e2228fbceaa886e64e36174c (patch)
tree7967af7f0f2079a632809a813221918af16ba8cc /Master/texmf-dist/source/latex/oberdiek/ltxcmds.dtx
parenta86d14742b305868a1c2b1f33f1263a6b7d0e03d (diff)
oberdiek (1may12)
git-svn-id: svn://tug.org/texlive/trunk@26177 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/oberdiek/ltxcmds.dtx')
-rw-r--r--Master/texmf-dist/source/latex/oberdiek/ltxcmds.dtx367
1 files changed, 308 insertions, 59 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/ltxcmds.dtx b/Master/texmf-dist/source/latex/oberdiek/ltxcmds.dtx
index c13a2a457e5..1a6e0c4de65 100644
--- a/Master/texmf-dist/source/latex/oberdiek/ltxcmds.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/ltxcmds.dtx
@@ -1,11 +1,12 @@
% \iffalse meta-comment
-%
+%
% File: ltxcmds.dtx
-% Version: 2011/04/18 v1.20
-%
+% Version: 2011/11/09 v1.22
+% Info: LaTeX kernel commands for general use
+%
% Copyright (C) 2009-2011 by
% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
-%
+%
% 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
@@ -15,25 +16,26 @@
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of
% LaTeX version 2005/12/01 or later.
-%
+%
% This work has the LPPL maintenance status "maintained".
-%
+%
% This Current Maintainer of this work is Heiko Oberdiek.
-%
+%
% The Base Interpreter refers to any `TeX-Format',
% because some files are installed in TDS:tex/generic//.
-%
+%
% This work consists of the main source file ltxcmds.dtx
% and the derived files
% ltxcmds.sty, ltxcmds.pdf, ltxcmds.ins, ltxcmds.drv,
% ltxcmds-test1.tex, ltxcmds-test-gobble.tex,
% ltxcmds-test-ifempty.tex, ltxcmds-test-zapspace.tex,
-% ltxcmds-test-ifboxempty.tex, ltxcmds-test-nextchar.tex.
-%
+% ltxcmds-test-ifboxempty.tex, ltxcmds-test-nextchar.tex,
+% ltxcmds-test-carcdr.tex.
+%
% Distribution:
% CTAN:macros/latex/contrib/oberdiek/ltxcmds.dtx
% CTAN:macros/latex/contrib/oberdiek/ltxcmds.pdf
-%
+%
% Unpacking:
% (a) If ltxcmds.ins is present:
% tex ltxcmds.ins
@@ -42,7 +44,7 @@
% (c) If you insist on using LaTeX
% latex \let\install=y\input{ltxcmds.dtx}
% (quote the arguments according to the demands of your shell)
-%
+%
% Documentation:
% (a) If ltxcmds.drv is present:
% latex ltxcmds.drv
@@ -52,14 +54,14 @@
% if available. Here you can specify further options, e.g.
% use A4 as paper format:
% \PassOptionsToClass{a4paper}{article}
-%
+%
% Programm calls to get the documentation (example):
% pdflatex ltxcmds.dtx
% makeindex -s gind.ist ltxcmds.idx
% pdflatex ltxcmds.dtx
% makeindex -s gind.ist ltxcmds.idx
% pdflatex ltxcmds.dtx
-%
+%
% Installation:
% TDS:tex/generic/oberdiek/ltxcmds.sty
% TDS:doc/latex/oberdiek/ltxcmds.pdf
@@ -69,6 +71,7 @@
% TDS:doc/latex/oberdiek/test/ltxcmds-test-zapspace.tex
% TDS:doc/latex/oberdiek/test/ltxcmds-test-ifboxempty.tex
% TDS:doc/latex/oberdiek/test/ltxcmds-test-nextchar.tex
+% TDS:doc/latex/oberdiek/test/ltxcmds-test-carcdr.tex
% TDS:source/latex/oberdiek/ltxcmds.dtx
%
%<*ignore>
@@ -86,7 +89,7 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: ltxcmds 2011/04/18 v1.20 LaTeX kernel commands for general use (HO)}
+\Msg{* Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)}
\Msg{************************************************************************}
\keepsilent
@@ -98,7 +101,7 @@
This is a generated file.
Project: ltxcmds
-Version: 2011/04/18 v1.20
+Version: 2011/11/09 v1.22
Copyright (C) 2009-2011 by
Heiko Oberdiek <heiko.oberdiek at googlemail.com>
@@ -125,7 +128,8 @@ and the derived files
ltxcmds.sty, ltxcmds.pdf, ltxcmds.ins, ltxcmds.drv,
ltxcmds-test1.tex, ltxcmds-test-gobble.tex,
ltxcmds-test-ifempty.tex, ltxcmds-test-zapspace.tex,
- ltxcmds-test-ifboxempty.tex, ltxcmds-test-nextchar.tex.
+ ltxcmds-test-ifboxempty.tex, ltxcmds-test-nextchar.tex,
+ ltxcmds-test-carcdr.tex.
\endpreamble
\let\MetaPrefix\DoubleperCent
@@ -142,6 +146,11 @@ and the derived files
\file{ltxcmds-test-zapspace.tex}{\from{ltxcmds.dtx}{test-zapspace}}%
\file{ltxcmds-test-ifboxempty.tex}{\from{ltxcmds.dtx}{test-ifboxempty}}%
\file{ltxcmds-test-nextchar.tex}{\from{ltxcmds.dtx}{test-nextchar}}%
+ \file{ltxcmds-test-carcdr.tex}{\from{ltxcmds.dtx}{test-carcdr}}%
+ \nopreamble
+ \nopostamble
+ \usedir{source/latex/oberdiek/catalogue}%
+ \file{ltxcmds.xml}{\from{ltxcmds.dtx}{catalogue}}%
}
\catcode32=13\relax% active space
@@ -168,9 +177,9 @@ and the derived files
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{ltxcmds.drv}%
- [2011/04/18 v1.20 LaTeX kernel commands for general use (HO)]%
+ [2011/11/09 v1.22 LaTeX kernel commands for general use (HO)]%
\documentclass{ltxdoc}
-\usepackage{holtxdoc}[2011/02/04]
+\usepackage{holtxdoc}[2011/11/22]
\usepackage{zref-savepos}
\usepackage{paralist}
\hfuzz=1pt
@@ -180,7 +189,7 @@ and the derived files
%</driver>
% \fi
%
-% \CheckSum{2385}
+% \CheckSum{2685}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -201,7 +210,7 @@ and the derived files
% \GetFileInfo{ltxcmds.drv}
%
% \title{The \xpackage{ltxcmds} package}
-% \date{2011/04/18 v1.20}
+% \date{2011/11/09 v1.22}
% \author{Heiko Oberdiek\\\xemail{heiko.oberdiek at googlemail.com}}
%
% \maketitle
@@ -306,7 +315,7 @@ and the derived files
% Macros \cs{ltx@firstofthree}, \cs{ltx@secondofthree}
% and \cs{ltx@thirdofthree} were added in version
% 2010/11/12 v1.11.
-% Macros \cs{ltx@firstoffour}, \dots, \cs{ltx@forthoffour}
+% Macros \cs{ltx@firstoffour}, \dots, \cs{ltx@fourthoffour}
% were added in version 2011/02/04 v1.16.
%
% \subsection{List helpers}
@@ -321,28 +330,46 @@ and the derived files
%
% \begin{declcs}{ltx@cartwo} \M{1} \M{2} \dots\ \cs{@nil}
% \TO \meta{1}\meta{2}\\
+% \cs{ltx@carsecond} \M{1} \M{2} \dots\ \cs{@nil} \TO \meta{2}\\
% \cs{ltx@cdrtwo} \M{1} \M{2} \dots\ \cs{@nil} \TO \dots
% \end{declcs}
%
% \begin{declcs}{ltx@carthree} \M{1} \M{2} \M{3} \dots\ \cs{@nil}
% \TO \meta{1}\meta{2}\meta{3}\\
+% \cs{ltx@carthird} \M{1} \M{2} \M{3} \dots\ \cs{@nil}
+% \TO \meta{3}\\
% \cs{ltx@cdrthree} \M{1} \M{2} \M{3} \dots\ \cs{@nil} \TO \dots
% \end{declcs}
%
% \begin{declcs}{ltx@carfour} \M{1} \M{2} \M{3} \M{4} \dots\ \cs{@nil}
% \TO \meta{1}\meta{2}\meta{3}\meta{4}\\
+% \cs{ltx@carfourth} \M{1} \M{2} \M{3} \M{4} \dots\ \cs{@nil}
+% \TO \meta{4}\\
% \cs{ltx@cdrfour} \M{1} \M{2} \M{3} \M{4} \dots\ \cs{@nil} \TO \dots
% \end{declcs}
%
% \begin{declcs}{ltx@CarNum} \M{num} \M{1} \dots\ \M{\meta{num}}
% \M{\meta{num}+1} \dots\ \cs{@nil}\\
% \TO \M{1} \dots\ \M{\meta{num}} \dots\\
+% \cs{ltx@CarNumth} \M{num} \M{1} \dots\ \M{\meta{num}}
+% \M{\meta{num}+1} \dots\ \cs{@nil}\\
+% \TO \M{\meta{num}} \dots\\
% \cs{ltx@CdrNum} \M{num} \M{1} \dots\ \M{\meta{num}}
% \M{\meta{num}+1} \dots\ \cs{@nil}\\
% \TO \M{\meta{num}+1} \dots
% \end{declcs}
-% Macros \cs{ltx@CarNum} and \cs{ltx@CdrNum} are expandable
-% in exact two expansion steps.
+%
+% Macros with uppercase letters are expandable in two expansion steps.
+% Changes in version 2011/11/09 v1.22:
+% \begin{itemize}
+% \item
+% Macros \cs{ltx@carsecond}, \cs{ltx@carthird}, \cs{ltx@carfourth},
+% \cs{ltx@CarNumth} added.
+% \item
+% Macros \cs{ltx@cdr}, \cs{ltx@cdrtwo}, \cs{ltx@cdrthree}, \cs{ltx@cdrfour},
+% \cs{ltx@CdrNum} are expandable in two expansion steps and retain
+% spaces and braces after the first gobbled arguments.
+% \end{itemize}
%
% \subsection{Tail recursion}
%
@@ -499,9 +526,17 @@ and the derived files
% \end{declcs}
% The \meta{addition} is appended to the parameterless macro \meta{cmd}.
% If \meta{cmd} is undefined or has the meaning \cs{relax}, then
-% it will be initialized as empty macro before. Due to a bug \meta{addition}
+% it will be initialized as empty macro beforehand. Due to a bug \meta{addition}
% must not contain \cs{par} before version 2010/10/25 v1.9.
%
+% \begin{declcs}{ltx@GlobalPrependToMacro} \M{cmd} \M{addition}\\
+% \cs{ltx@LocalPrependToMacro} \M{cmd} \M{addition}
+% \end{declcs}
+% The \meta{addition} is prepended to the parameterless macro \meta{cmd}.
+% If \meta{cmd} is undefined or has the meaning \cs{relax}, then
+% it will be initialized as empty macro beforehand. The macros
+% were added in version 2011/08/22 v1.21.
+%
% \subsection{Next character detection}
%
% \begin{declcs}{ltx@ifnextchar} \M{char} \M{yes} \M{no}
@@ -692,7 +727,7 @@ and the derived files
\fi
\expandafter\x\csname ver@ltxcmds.sty\endcsname
\ProvidesPackage{ltxcmds}%
- [2011/04/18 v1.20 LaTeX kernel commands for general use (HO)]%
+ [2011/11/09 v1.22 LaTeX kernel commands for general use (HO)]%
% \end{macrocode}
%
% \begin{macrocode}
@@ -1045,25 +1080,34 @@ and the derived files
%
% \subsection{List helpers}
%
-% \begin{macro}{\ltx@car}
+% \begin{macro}{\ltx@carzero}
% \begin{macrocode}
-\long\def\ltx@car#1#2\@nil{#1}
+\long\def\ltx@carzero#1\@nil{}%
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\ltx@cdr}
+% \begin{macro}{\LTXcmds@cdrzero}
% \begin{macrocode}
-\long\def\ltx@cdr#1#2\@nil{#2}
+\long\def\LTXcmds@cdrzero#1\@nil{#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@cdrzero}
+% \begin{macrocode}
+\def\ltx@cdrzero{%
+ \romannumeral\LTXcmds@cdrzero\ltx@zero
+}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\ltx@carzero}
+% \begin{macro}{\ltx@car}
% \begin{macrocode}
-\long\def\ltx@carzero#1\@nil{}%
+\long\def\ltx@car#1#2\@nil{#1}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\ltx@cdrzero}
+% \begin{macro}{\ltx@cdr}
% \begin{macrocode}
-\long\def\ltx@cdrzero#1\@nil{#1}%
+\long\def\ltx@cdr#1{%
+ \romannumeral\LTXcmds@cdrzero\ltx@zero
+}
% \end{macrocode}
% \end{macro}
%
@@ -1072,9 +1116,16 @@ and the derived files
\long\def\ltx@cartwo#1#2#3\@nil{#1#2}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\ltx@carsecond}
+% \begin{macrocode}
+\long\def\ltx@carsecond#1#2#3\@nil{#2}
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\ltx@cdrtwo}
% \begin{macrocode}
-\long\def\ltx@cdrtwo#1#2#3\@nil{#3}
+\long\def\ltx@cdrtwo#1#2{%
+ \romannumeral\LTXcmds@cdrzero\ltx@zero
+}
% \end{macrocode}
% \end{macro}
%
@@ -1083,9 +1134,16 @@ and the derived files
\long\def\ltx@carthree#1#2#3#4\@nil{#1#2#3}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\ltx@carthird}
+% \begin{macrocode}
+\long\def\ltx@carthird#1#2#3#4\@nil{#3}
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\ltx@cdrthree}
% \begin{macrocode}
-\long\def\ltx@cdrthree#1#2#3#4\@nil{#4}
+\long\def\ltx@cdrthree#1#2#3{%
+ \romannumeral\LTXcmds@cdrzero\ltx@zero
+}
% \end{macrocode}
% \end{macro}
%
@@ -1094,9 +1152,16 @@ and the derived files
\long\def\ltx@carfour#1#2#3#4#5\@nil{#1#2#3#4}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\ltx@carfourth}
+% \begin{macrocode}
+\long\def\ltx@carfourth#1#2#3#4#5\@nil{#4}
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\ltx@cdrfour}
% \begin{macrocode}
-\long\def\ltx@cdrfour#1#2#3#4#5\@nil{#5}
+\long\def\ltx@cdrfour#1#2#3#4{%
+ \romannumeral\LTXcmds@cdrzero\ltx@zero
+}
% \end{macrocode}
% \end{macro}
%
@@ -1140,18 +1205,33 @@ and the derived files
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\ltx@CdrNum}
+% \begin{macro}{\ltx@CarNumth}
% \begin{macrocode}
-\def\ltx@CdrNum#1{%
- \romannumeral0%
- \expandafter\expandafter\expandafter\LTXcmds@CdrNum
- \ltx@GobbleNum{#1}%
+\def\ltx@CarNumth#1{%
+ \romannumeral
+ \expandafter\expandafter\expandafter
+ \LTXcmds@CarNumth
+ \ltx@GobbleNum{#1}{}%
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\LTXcmds@CdrNum}
+% \begin{macro}{\LTXcmds@CarNumth}
% \begin{macrocode}
-\long\def\LTXcmds@CdrNum#1\@nil{ #1}%
+\long\def\LTXcmds@CarNumth#1#2\@nil{%
+ \ltx@zero
+ #1%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ltx@CdrNum}
+% \begin{macrocode}
+\def\ltx@CdrNum#1{%
+ \romannumeral%
+ \expandafter\expandafter\expandafter\ltx@cdrzero
+ \expandafter\expandafter\expandafter\ltx@zero
+ \ltx@GobbleNum{#1}%
+}
% \end{macrocode}
% \end{macro}
%
@@ -1569,6 +1649,45 @@ and the derived files
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\ltx@GlobalPrependToMacro}
+% \begin{macrocode}
+\long\def\ltx@GlobalPrependToMacro#1#2{%
+ \ifx\ltx@undefined#1%
+ \let#1\ltx@empty
+ \else
+ \ifx\relax#1%
+ \let#1\ltx@empty
+ \fi
+ \fi
+ \begingroup
+ \ltx@LocToksA{#2}%
+ \ltx@LocToksB\expandafter{#1}%
+ \xdef#1{\the\ltx@LocToksA\the\ltx@LocToksB}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ltx@LocalPrependToMacro}
+% \begin{macrocode}
+\long\def\ltx@LocalPrependToMacro#1#2{%
+ \global\let\LTXcmds@gtemp#1%
+ \ifx\ltx@undefined\LTXcmds@gtemp
+ \global\let\LTXcmds@gtemp\ltx@empty
+ \else
+ \ifx\relax\LTXcmds@gtemp
+ \global\letLTXcmds@gtemp\ltx@empty
+ \fi
+ \fi
+ \begingroup
+ \ltx@LocToksA{#2}%
+ \ltx@LocToksB\expandafter{\LTXcmds@gtemp}%
+ \xdef\LTXcmds@gtemp{\the\ltx@LocToksA\the\ltx@LocToksB}%
+ \endgroup
+ \let#1\LTXcmds@gtemp
+}
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Next character detection}
%
% \begin{macro}{\ltx@ifnextchar}
@@ -2056,7 +2175,7 @@ $ \next
\expandafter\ifx\csname RequirePackage\endcsname\relax
\input ltxcmds.sty\relax
\else
- \RequirePackage{ltxcmds}[2011/04/18]%
+ \RequirePackage{ltxcmds}[2011/11/09]%
\fi
\catcode`\@=11 %
\def\msg#{\immediate\write16}%
@@ -2243,7 +2362,7 @@ X=%
\expandafter\ifx\csname RequirePackage\endcsname\relax
\input ltxcmds.sty\relax
\else
- \RequirePackage{ltxcmds}[2011/04/18]%
+ \RequirePackage{ltxcmds}[2011/11/09]%
\fi
\def\msg#{\immediate\write16}
\def\TestY{\Y}
@@ -2363,7 +2482,7 @@ X=%
\expandafter\ifx\csname RequirePackage\endcsname\relax
\input ltxcmds.sty\relax
\else
- \RequirePackage{ltxcmds}[2011/04/18]%
+ \RequirePackage{ltxcmds}[2011/11/09]%
\fi
\def\msg#{\immediate\write16}
\def\space{ }
@@ -2437,7 +2556,7 @@ X=%
\expandafter\ifx\csname RequirePackage\endcsname\relax
\input ltxcmds.sty\relax
\else
- \RequirePackage{ltxcmds}[2011/04/18]%
+ \RequirePackage{ltxcmds}[2011/11/09]%
\fi
\def\msg#{\immediate\write16}
% make box 0 void
@@ -2534,7 +2653,7 @@ X=%
\input ltxcmds.sty\relax
\input eolgrab.sty\relax
\else
- \RequirePackage{ltxcmds}[2011/04/18]%
+ \RequirePackage{ltxcmds}[2011/11/09]%
\RequirePackage{eolgrab}[2011/01/12]%
\fi
\def\msg#{\immediate\write16}
@@ -2700,6 +2819,85 @@ X=%
%</test-nextchar>
% \end{macrocode}
%
+% \subsection{Test for list helpers}
+%
+% \begin{macrocode}
+%<*test-carcdr>
+\catcode`\{=1 %
+\catcode`\}=2 %
+\catcode`\#=6 %
+\catcode`\@=11 %
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input ltxcmds.sty\relax
+ \input eolgrab.sty\relax
+\else
+ \RequirePackage{ltxcmds}[2011/11/09]%
+ \RequirePackage{eolgrab}[2011/01/12]%
+\fi
+\def\msg#{\immediate\write16}
+\def\space{ }
+\long\def\Test#1#2#3{%
+ \begingroup
+ \def\TestExpected{#3}%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter\TestResult
+ \expandafter\expandafter\expandafter{%
+ #1#2\@nil
+ }%
+ \ifx\TestResult\TestExpected
+ \else
+ \msg{\string\TestExpected: [\meaning\TestExpected]}%
+ \msg{\string\TestResult: \space\space[\meaning\TestResult]}%
+ \errmessage{Test failed!}%
+ \fi
+ \endgroup
+}
+\Test\ltx@carzero{abc}{}
+\Test\ltx@carzero{}{}
+\Test\ltx@carzero{\par\par}{}
+\Test\ltx@cdrzero{}{}
+\Test\ltx@cdrzero{abc}{abc}
+\Test\ltx@cdrzero{ \par}{ \par}
+\Test\ltx@cdrzero{\@empty}{\@empty}
+\Test\ltx@cdrzero{{}}{{}}
+\Test\ltx@car{abc}{a}
+\Test\ltx@car{\par}{\par}
+\Test\ltx@cdr{abc}{bc}
+\Test\ltx@cdr{a \par}{ \par}
+\Test\ltx@cdr{a\@empty}{\@empty}
+\Test\ltx@cartwo{abc}{ab}
+\Test\ltx@cartwo{\par\@empty}{\par\@empty}
+\Test\ltx@carsecond{abc}{b}
+\Test\ltx@carsecond{\@empty b\@empty}{b}
+\Test\ltx@carsecond{\par\par\par}{\par}
+\Test\ltx@cdrtwo{abc}{c}
+\Test\ltx@cdrtwo{ab \par}{ \par}
+\Test\ltx@cdrtwo{ab\@empty}{\@empty}
+\Test\ltx@cdrtwo{ab{}}{{}}
+\Test\ltx@cdrthree{abcdefg}{defg}
+\Test\ltx@cdrfour{abcdefg}{efg}
+\Test{\ltx@CdrNum{5}}{abcdefg}{fg}
+\Test{\ltx@CdrNum{0}}{\par}{\par}
+\Test{\ltx@CdrNum{0}}{\@empty}{\@empty}
+\Test{\ltx@CdrNum{0}}{{}}{{}}
+\Test{\ltx@CdrNum{0}}{ }{ }
+\Test{\ltx@CdrNum{2}}{abcd}{cd}
+\Test{\ltx@CdrNum{2}}{\vbox\par\hbox\par}{\hbox\par}
+\Test{\ltx@carthree}{abcdefg}{abc}
+\Test{\ltx@carfour}{abcdefg}{abcd}
+\Test{\ltx@CarNum{5}}{abcdefg}{abcde}
+\Test{\ltx@CarNum{2}}{\@empty\par}{\@empty\par}
+\Test\ltx@carthird{abcdefg}{c}
+\Test\ltx@carfourth{abcdefg}{d}
+\Test{\ltx@CarNumth{5}}{abcdefg}{e}
+\Test{\ltx@CarNumth{2}}{\@empty\@empty\@empty}{\@empty}
+\Test{\ltx@CarNumth{2}}{\par\par\par}{\par}
+\Test{\ltx@CarNumth{2}}{ab}{b}
+\csname @@end\endcsname\end
+%</test-carcdr>
+% \end{macrocode}
+%
% \section{Installation}
%
% \subsection{Download}
@@ -2767,6 +2965,7 @@ X=%
% test/ltxcmds-test-zapspace.tex & doc/latex/oberdiek/test/ltxcmds-test-zapspace.tex\\
% test/ltxcmds-test-ifboxempty.tex & doc/latex/oberdiek/test/ltxcmds-test-ifboxempty.tex\\
% test/ltxcmds-test-nextchar.tex & doc/latex/oberdiek/test/ltxcmds-test-nextchar.tex\\
+% test/ltxcmds-test-carcdr.tex & doc/latex/oberdiek/test/ltxcmds-test-carcdr.tex\\
% ltxcmds.dtx & source/latex/oberdiek/ltxcmds.dtx\\
% \end{tabular}^^A
% }^^A
@@ -2887,9 +3086,45 @@ X=%
%\end{verbatim}
% \end{quote}
%
+% \section{Catalogue}
+%
+% The following XML file can be used as source for the
+% \href{http://mirror.ctan.org/help/Catalogue/catalogue.html}{\TeX\ Catalogue}.
+% The elements \texttt{caption} and \texttt{description} are imported
+% from the original XML file from the Catalogue.
+% The name of the XML file in the Catalogue is \xfile{ltxcmds.xml}.
+% \begin{macrocode}
+%<*catalogue>
+<?xml version='1.0' encoding='us-ascii'?>
+<!DOCTYPE entry SYSTEM 'catalogue.dtd'>
+<entry datestamp='$Date$' modifier='$Author$' id='ltxcmds'>
+ <name>ltxcmds</name>
+ <caption>Some LaTeX kernel commands for general use.</caption>
+ <authorref id='auth:oberdiek'/>
+ <copyright owner='Heiko Oberdiek' year='2009-2011'/>
+ <license type='lppl1.3'/>
+ <version number='1.22'/>
+ <description>
+ This package exports some utility macros
+ from the LaTeX kernel into a separate namespace and
+ also makes them available for other formats such as plain TeX.
+ <p/>
+ The package is part of the <xref refid='oberdiek'>oberdiek</xref>
+ bundle.
+ </description>
+ <documentation details='Package documentation'
+ href='ctan:/macros/latex/contrib/oberdiek/ltxcmds.pdf'/>
+ <ctan file='true' path='/macros/latex/contrib/oberdiek/ltxcmds.dtx'/>
+ <miktex location='oberdiek'/>
+ <texlive location='oberdiek'/>
+ <install path='/macros/latex/contrib/oberdiek/oberdiek.tds.zip'/>
+</entry>
+%</catalogue>
+% \end{macrocode}
+%
% \begin{thebibliography}{9}
% \raggedright
-%
+%
% \bibitem{ifempty:schneck}
% Robert R. Schneck:
% \textit{Re: \cs{ifempty} solution %
@@ -2899,7 +3134,7 @@ X=%
% 2003-06-17.\\
% {\small
% \url{http://groups.google.com/group/comp.text.tex/msg/be03a159ec374895}}
-%
+%
% \bibitem{ifnull:diez}
% Ulrich Diez:
% \textit{Re: TeX refuses to strip outer braces in argument};
@@ -2908,7 +3143,7 @@ X=%
% 2010-11-12.\\
% {\small
% \url{http://groups.google.com/group/comp.text.tex/msg/803bd57221a04996}}
-%
+%
% \bibitem{ifstrempty:musa}
% Ahmed Musa:
% \textit{Re: TeX refuses to strip outer braces in argument};
@@ -2917,7 +3152,7 @@ X=%
% 2010-12-03.\\
% {\small
% \url{http://groups.google.com/group/comp.text.tex/msg/fbf7d61a0c3a807d}}
-%
+%
% \bibitem{ifstrempty:diez1}
% Ulrich Diez:
% \textit{Re: TeX refuses to strip outer braces in argument};
@@ -2926,7 +3161,7 @@ X=%
% 2010-12-03.\\
% {\small
% \url{http://groups.google.com/group/comp.text.tex/msg/0c230ee479487962}}
-%
+%
% \bibitem{ifstrempty:diez2}
% Ulrich Diez:
% \textit{Re: TeX refuses to strip outer braces in argument};
@@ -2935,7 +3170,7 @@ X=%
% 2010-12-03.\\
% {\small
% \url{http://groups.google.com/group/comp.text.tex/msg/bbef4263390d647b}}
-%
+%
% \bibitem{ifstrempty:diez3}
% Ulrich Diez:
% \textit{Re: TeX refuses to strip outer braces in argument};
@@ -2944,7 +3179,7 @@ X=%
% 2010-12-04.\\
% {\small
% \url{http://groups.google.com/group/comp.text.tex/msg/00dfd1ec103cd272}}
-%
+%
% \bibitem{ifstrempty:gl}
% GL:
% \textit{Re: TeX refuses to strip outer braces in argument};
@@ -2953,7 +3188,7 @@ X=%
% 2010-12-04.\\
% {\small
% \url{http://groups.google.com/group/comp.text.tex/msg/d3a75995c1cf267e}}
-%
+%
% \bibitem{ifstrempty:ho}
% Heiko Oberdiek:
% \textit{Re: TeX refuses to strip outer braces in argument};
@@ -2962,7 +3197,7 @@ X=%
% 2010-12-04.\\
% {\small
% \url{http://groups.google.com/group/comp.text.tex/msg/5f7a23e3ab70e347}}
-%
+%
% \bibitem{ifboxempty:dak}
% David Kastrup:
% \textit{How to detect if \cs{vbox} is empty};
@@ -2970,7 +3205,7 @@ X=%
% 2011-02-04.\\
% {\small
% \url{http://groups.google.com/group/comp.text.tex/msg/8d3cb89496a4d86d}}
-%
+%
% \end{thebibliography}
%
% \begin{History}
@@ -3095,6 +3330,20 @@ X=%
% \cs{ltx@ifnextchar} with conditional support (thanks GL for
% bug report).
% \end{Version}
+% \begin{Version}{2011/08/22 v1.21}
+% \item
+% \cs{ltx@GlobalPrependToMacro}, \cs{ltx@LocalPrependToMacro} added
+% (feature request of Martin M\"unch).
+% \end{Version}
+% \begin{Version}{2011/11/09 v1.22}
+% \item
+% \cs{ltx@carsecond}, \cs{ltx@carthird}, \cs{ltx@carfourth},
+% \cs{ltx@CarNumth} added.
+% \item
+% \cs{ltx@cdrzero}, \cs{ltx@cdr}, \cs{ltx@cdrtwo}, cs{ltx@cdrthree},
+% \cs{ltx@cdrfour}, \cs{ltx@CdrNum} modified to retain braces and spaces.
+% They are expandable in two expansion steps.
+% \end{Version}
% \end{History}
%
% \PrintIndex