summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/oberdiek/ltxcmds.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/oberdiek/ltxcmds.dtx')
-rw-r--r--macros/latex/contrib/oberdiek/ltxcmds.dtx879
1 files changed, 1 insertions, 878 deletions
diff --git a/macros/latex/contrib/oberdiek/ltxcmds.dtx b/macros/latex/contrib/oberdiek/ltxcmds.dtx
index 974a994380..7de6b53dfe 100644
--- a/macros/latex/contrib/oberdiek/ltxcmds.dtx
+++ b/macros/latex/contrib/oberdiek/ltxcmds.dtx
@@ -69,13 +69,6 @@
% Installation:
% TDS:tex/generic/oberdiek/ltxcmds.sty
% TDS:doc/latex/oberdiek/ltxcmds.pdf
-% TDS:doc/latex/oberdiek/test/ltxcmds-test1.tex
-% TDS:doc/latex/oberdiek/test/ltxcmds-test-gobble.tex
-% TDS:doc/latex/oberdiek/test/ltxcmds-test-ifempty.tex
-% 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>
@@ -155,10 +148,6 @@ and the derived files
% \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
@@ -198,21 +187,6 @@ and the derived files
% \fi
%
%
-% \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
-% Lower-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
-% Digits \0\1\2\3\4\5\6\7\8\9
-% Exclamation \! Double quote \" Hash (number) \#
-% Dollar \$ Percent \% Ampersand \&
-% Acute accent \' Left paren \( Right paren \)
-% Asterisk \* Plus \+ Comma \,
-% Minus \- Point \. Solidus \/
-% Colon \: Semicolon \; Less than \<
-% Equals \= Greater than \> Question mark \?
-% Commercial at \@ Left bracket \[ Backslash \\
-% Right bracket \] Circumflex \^ Underscore \_
-% Grave accent \` Left brace \{ Vertical bar \|
-% Right brace \} Tilde \~}
%
% \GetFileInfo{ltxcmds.drv}
%
@@ -2062,851 +2036,7 @@ $ \next
\LTXcmds@AtEnd%
%</package>
% \end{macrocode}
-%
-% \section{Test}
-%
-% \subsection{Catcode checks for loading}
-%
-% \begin{macrocode}
-%<*test1>
-% \end{macrocode}
-% \begin{macrocode}
-\catcode`\{=1 %
-\catcode`\}=2 %
-\catcode`\#=6 %
-\catcode`\@=11 %
-\expandafter\ifx\csname count@\endcsname\relax
- \countdef\count@=255 %
-\fi
-\expandafter\ifx\csname @gobble\endcsname\relax
- \long\def\@gobble#1{}%
-\fi
-\expandafter\ifx\csname @firstofone\endcsname\relax
- \long\def\@firstofone#1{#1}%
-\fi
-\expandafter\ifx\csname loop\endcsname\relax
- \expandafter\@firstofone
-\else
- \expandafter\@gobble
-\fi
-{%
- \def\loop#1\repeat{%
- \def\body{#1}%
- \iterate
- }%
- \def\iterate{%
- \body
- \let\next\iterate
- \else
- \let\next\relax
- \fi
- \next
- }%
- \let\repeat=\fi
-}%
-\def\RestoreCatcodes{}
-\count@=0 %
-\loop
- \edef\RestoreCatcodes{%
- \RestoreCatcodes
- \catcode\the\count@=\the\catcode\count@\relax
- }%
-\ifnum\count@<255 %
- \advance\count@ 1 %
-\repeat
-
-\def\RangeCatcodeInvalid#1#2{%
- \count@=#1\relax
- \loop
- \catcode\count@=15 %
- \ifnum\count@<#2\relax
- \advance\count@ 1 %
- \repeat
-}
-\def\RangeCatcodeCheck#1#2#3{%
- \count@=#1\relax
- \loop
- \ifnum#3=\catcode\count@
- \else
- \errmessage{%
- Character \the\count@\space
- with wrong catcode \the\catcode\count@\space
- instead of \number#3%
- }%
- \fi
- \ifnum\count@<#2\relax
- \advance\count@ 1 %
- \repeat
-}
-\def\space{ }
-\expandafter\ifx\csname LoadCommand\endcsname\relax
- \def\LoadCommand{\input ltxcmds.sty\relax}%
-\fi
-\def\Test{%
- \RangeCatcodeInvalid{0}{47}%
- \RangeCatcodeInvalid{58}{64}%
- \RangeCatcodeInvalid{91}{96}%
- \RangeCatcodeInvalid{123}{255}%
- \catcode`\@=12 %
- \catcode`\\=0 %
- \catcode`\%=14 %
- \LoadCommand
- \RangeCatcodeCheck{0}{36}{15}%
- \RangeCatcodeCheck{37}{37}{14}%
- \RangeCatcodeCheck{38}{47}{15}%
- \RangeCatcodeCheck{48}{57}{12}%
- \RangeCatcodeCheck{58}{63}{15}%
- \RangeCatcodeCheck{64}{64}{12}%
- \RangeCatcodeCheck{65}{90}{11}%
- \RangeCatcodeCheck{91}{91}{15}%
- \RangeCatcodeCheck{92}{92}{0}%
- \RangeCatcodeCheck{93}{96}{15}%
- \RangeCatcodeCheck{97}{122}{11}%
- \RangeCatcodeCheck{123}{255}{15}%
- \RestoreCatcodes
-}
-\Test
-\csname @@end\endcsname
-\end
-% \end{macrocode}
-% \begin{macrocode}
-%</test1>
-% \end{macrocode}
-%
-% \subsection{Test \cs{ltx@GobbleNum}}
-%
-% \begin{macrocode}
-%<*test-gobble>
-\catcode`\{=1 %
-\catcode`\}=2 %
-\catcode`\#=6 %
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input ltxcmds.sty\relax
-\else
- \RequirePackage{ltxcmds}[2016/05/16]%
-\fi
-\catcode`\@=11 %
-\def\msg#{\immediate\write16}%
-\msg{[Test \string\ltx@GobbleNum]}%
-\long\def\Test#1=#2\\{%
- \edef\StrA{\ltx@GobbleNum#1}%
- \expandafter\expandafter\expandafter\def
- \expandafter\expandafter\expandafter\StrAA
- \expandafter\expandafter\expandafter{\ltx@GobbleNum#1}%
- \edef\StrB{#2}%
- \ifx\StrA\StrB
- \ifx\StrAA\StrB
- \msg{* ok.}%
- \else
- \msg{StrAA: \StrAA}%
- \msg{StrB: \StrB}%
- \errhelp{Test: #1=#2}%
- \errmessage{Test (two expansions) failed}%
- \fi
- \else
- \msg{StrA: \StrA}%
- \msg{StrB: \StrB}%
- \errhelp{Test: #1=#2}%
- \errmessage{Test (edef) failed!}%
- \fi
-}
-\Test0abc=abc\\
-\Test1abc=bc\\
-\Test2abc=c\\
-\Test3abcd=d\\
-\Test4abcde=e\\
-\Test5abcdef=f\\
-\Test6abcdefg=g\\
-\Test7abcdefgh=h\\
-\Test8abcdefghi=i\\
-\Test9abcdefghij=j\\
-\Test{10}0123456789X=X\\
-\Test{12}abcdefghijklm=m\\
-\Test{700}%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-X=X\\
-\Test{-1}abc=abc\\
-\Test2\par\par\relax=\relax\\
-
-\begingroup
- \count1=2 %
- \Test{\count1}abc=c\\%
-\endgroup
-
-\ltx@IfUndefined{numexpr}{%
-}{%
- \Test{1+1}abc=c\\%
-}
-
-\msg{[Test \string\ltx@CdrNum]}%
-\long\def\Test#1=#2\\{%
- \edef\StrA{\ltx@CdrNum#1\@nil}%
- \expandafter\expandafter\expandafter\def
- \expandafter\expandafter\expandafter\StrAA
- \expandafter\expandafter\expandafter{\ltx@CdrNum#1\@nil}%
- \edef\StrB{#2}%
- \ifx\StrA\StrB
- \ifx\StrAA\StrB
- \msg{* ok.}%
- \else
- \msg{StrAA: \meaning\StrAA}%
- \msg{StrB: \meaning\StrB}%
- \errhelp{Test: #1=#2}%
- \errmessage{Test (two expansions) failed}%
- \fi
- \else
- \msg{StrA: \StrA}%
- \msg{StrB: \StrB}%
- \errhelp{Test: #1=#2}%
- \errmessage{Test (edef) failed!}%
- \fi
-}
-\Test0abc=abc\\
-\Test1abc=bc\\
-\Test2abc=c\\
-\Test3abcd=d\\
-\Test4abcde=e\\
-\Test5abcdef=f\\
-\Test6abcdefg=g\\
-\Test7abcdefgh=h\\
-\Test8abcdefghi=i\\
-\Test9abcdefghij=j\\
-\Test{10}0123456789X=X\\
-\Test{12}abcdefghijklm=m\\
-\Test{700}%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-X=X\\
-\Test{-1}abc=abc\\
-\Test2\par\par\relax=\relax\\
-
-\msg{[Test \string\ltx@CarNum]}%
-\long\def\Test#1=#2\\{%
- \edef\StrA{\ltx@CarNum#1\@nil}%
- \expandafter\expandafter\expandafter\def
- \expandafter\expandafter\expandafter\StrAA
- \expandafter\expandafter\expandafter{\ltx@CarNum#1\@nil}%
- \edef\StrB{#2}%
- \ifx\StrA\StrB
- \ifx\StrAA\StrB
- \msg{* ok.}%
- \else
- \msg{StrAA: \meaning\StrAA}%
- \msg{StrB: \meaning\StrB}%
- \errhelp{Test: #1=#2}%
- \errmessage{Test (two expansions) failed}%
- \fi
- \else
- \msg{StrA: \StrA}%
- \msg{StrB: \StrB}%
- \errhelp{Test: #1=#2}%
- \errmessage{Test (edef) failed!}%
- \fi
-}
-\Test0abc=\\
-\Test1abc=a\\
-\Test2abc=ab\\
-\Test3abc=abc\\
-\Test3abcd=abc\\
-\Test4abcde=abcd\\
-\Test{10}0123456789X=0123456789\\
-\Test{12}abcdefghijklm=abcdefghijkl\\
-\Test{700}%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-X=%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-0123456789012345678901234567890123456789012345678901234567890123456789%
-\\
-\Test{-1}abc=\\
-\Test2\par\par\relax=\par\par\\
-\csname @@end\endcsname\end
-%</test-gobble>
-% \end{macrocode}
-%
-% \subsection{Test \cs{ltx@ifempty}}
-%
-% \begin{macrocode}
-%<*test-ifempty>
-\catcode`\{=1 %
-\catcode`\}=2 %
-\catcode`\#=6 %
-\catcode`\@=11 %
-\errorcontextlines=1000 %
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input ltxcmds.sty\relax
-\else
- \RequirePackage{ltxcmds}[2016/05/16]%
-\fi
-\def\msg#{\immediate\write16}
-\def\TestY{\Y}
-\def\TestN{\N}
-\msg{* \string\ltx@ifempty}
-\long\def\test#1{%
- \begingroup
- % Calculate expected test result via macro definition
- \def\Stuff{#1}%
- \ifx\Stuff\ltx@empty
- \def\StuffEmpty{\Y}%
- \else
- \def\StuffEmpty{\N}%
- \fi
- % Test \ltx@ifempty
- \expandafter\expandafter\expandafter\def
- \expandafter\expandafter\expandafter\TestEmpty
- \expandafter\expandafter\expandafter{%
- \ltx@ifempty{#1}{\Y}{\N}%
- }%
- \ifx\StuffEmpty\TestEmpty
- \msg{* Test OK}%
- \else
- \ltx@IfUndefined{detokenize}{}{%
- \msg{Stuff: [\detokenize{\Stuff}]}%
- }%
- \errmessage{Test failed!}%
- \fi
- \endgroup
-}
-\test{}
-\test{a}
-\test{abc}
-\test{\par}
-\test{ }
-\test{\if}
-\test{{\if}}
-\test{\else}
-\test{{\else}}
-\test{\fi}
-\test{{}\fi}
-\test{\or\ifcase}
-\test{{}}
-\test{{a}}
-\test{{}abc}
-\test{{\par}}
-\test{{}\par}
-% \end{macrocode}
-% \begin{macrocode}
-\def\SpaceTwo#1{%
- \def\SpaceTwo{#1#1}%
-}\SpaceTwo{ }
-\msg{* \string\ltx@ifblank}
-\long\def\test#1{%
- \begingroup
- % Calculate expected test result via macro definition
- \def\Stuff{#1}%
- \ifx\Stuff\ltx@empty
- \def\StuffEmpty{\Y}%
- \else
- \ifx\Stuff\ltx@space
- \def\StuffEmpty{\Y}%
- \else
- \ifx\Stuff\SpaceTwo
- \def\StuffEmpty{\Y}%
- \else
- \def\StuffEmpty{\N}%
- \fi
- \fi
- \fi
- % Test \ltx@ifblank
- \expandafter\expandafter\expandafter\def
- \expandafter\expandafter\expandafter\TestEmpty
- \expandafter\expandafter\expandafter{%
- \ltx@ifblank{#1}{\Y}{\N}%
- }%
- \ifx\StuffEmpty\TestEmpty
- \msg{* Test OK}%
- \else
- \ltx@IfUndefined{detokenize}{}{%
- \msg{Stuff: [\detokenize{\Stuff}]}%
- }%
- \errmessage{Test failed!}%
- \fi
- \endgroup
-}
-\test{}
-\test{a}
-\test{\if}
-\test{\else}
-\test{\fi}
-\test{ \fi}
-\test{\par}
-\test{ \par}
-\test{{}}
-\test{ {}}
-\def\x#1{%
- \test{#1#1}%
- \test{#1#1{}}%
- \test{#1#1\par}%
- \test{#1#1\else}%
-}\x{ }
-\csname @@end\endcsname\end
-%</test-ifempty>
-% \end{macrocode}
-%
-% \subsection{Test \cs{ltx@zap@space}}
-%
-% \begin{macrocode}
-%<*test-zapspace>
-\catcode`\{=1 %
-\catcode`\}=2 %
-\catcode`\#=6 %
-\catcode`\@=11 %
-\errorcontextlines=1000 %
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input ltxcmds.sty\relax
-\else
- \RequirePackage{ltxcmds}[2016/05/16]%
-\fi
-\def\msg#{\immediate\write16}
-\def\space{ }
-\def\empty{}
-\msg{* \string\ltx@zapspace}
-\long\def\test#1#2{%
- \begingroup
- \def\TestInput{#1}%
- \def\TestExpected{#2}%
- % Test \ltx@zapspace
- \expandafter\expandafter\expandafter\def
- \expandafter\expandafter\expandafter\TestResult
- \expandafter\expandafter\expandafter{%
- \ltx@zapspace{#1}%
- }%
- \ifx\TestResult\TestExpected
- \msg{* Test OK}%
- \else
- \ltx@onelevel@sanitize\TestInput
- \ltx@onelevel@sanitize\TestExpected
- \ltx@onelevel@sanitize\TestResult
- \msg{* Input: \space\space\space[\TestInput]}%
- \msg{ \space Result: \space\space[\TestResult]}%
- \msg{ \space Expected: [\TestExpected]}%
- \errmessage{Test failed!}%
- \fi
- \endgroup
-}
-\long\def\etest#1#2{%
- \begingroup
- \edef\x{\endgroup
- \noexpand\test{#1}{#2}%
- }%
- \x
-}
-\catcode`\~=13 %
-\let~\noexpand
-% \end{macrocode}
-% \begin{macrocode}
-\test{}{}
-\test{{}}{{}}
-\test{ {}}{{}}
-\test{{ }}{{ }}
-\test{{} }{{}}
-\test{ {} }{{}}
-\test{ { } }{{ }}
-\test{a {b} c}{a{b}c}
-\test{a bb ccc}{abbccc}
-\test{{a} {bb} {ccc}}{{a}{bb}{ccc}}
-\test{\par}{\par}
-\test{\if}{\if}
-\test{\space}{\space}
-\etest{\par\space\par}{\par\par}
-\etest{~\empty\space~\empty}{~\empty~\empty}
-\etest{~\fi\space~\else\space}{~\fi~\else}
-% \end{macrocode}
-% \begin{macrocode}
-\csname @@end\endcsname\end
-%</test-zapspace>
-% \end{macrocode}
-%
-% \subsection{Test \cs{ltx@IfBoxEmpty}}
-%
-% \begin{macrocode}
-%<*test-ifboxempty>
-\catcode`\{=1 %
-\catcode`\}=2 %
-\catcode`\#=6 %
-\catcode`\@=11 %
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input ltxcmds.sty\relax
-\else
- \RequirePackage{ltxcmds}[2016/05/16]%
-\fi
-\def\msg#{\immediate\write16}
- % make box 0 void
-\begingroup
- \setbox0=\box0 %
-\endgroup
-\ifvoid0 %
-\else
- \errmessage{Voiding box 0 failed}%
-\fi
-\setbox2=\box0 %
-\def\test#1#2{%
- \@test{#1}{#2}%
- \@@test{#1}{#2}%
- \chardef\x=#1%
- \@test\x{#2}%
- \@@test\x{#2}%
-}
-\def\@test#1#2{%
- \begingroup
- \setbox9=\hbox{%
- \def\TestExpected{#2}%
- \ltx@IfBoxEmpty{#1}{%
- \def\TestResult{Y}%
- }{%
- \def\TestResult{N}%
- }%
- \ifx\TestExpected\TestResult
- \msg{* Test passed.}%
- \else
- \errmessage{Test failed!}%
- \fi
- }%
- \ifdim\wd9=0pt %
- \else
- \errmessage{Unwanted space?}%
- \fi
- \endgroup
-}
-\def\@@test#1#2{%
- \begingroup
- \setbox9=\hbox{%
- \def\TestExpected{#2}%
- \ifvoid#1\def\TestExpected{Y}\fi
- \ltx@IfBoxVoidOrEmpty{#1}{%
- \def\TestResult{Y}%
- }{%
- \def\TestResult{N}%
- }%
- \ifx\TestExpected\TestResult
- \msg{* Test passed.}%
- \else
- \errmessage{Test failed!}%
- \fi
- }%
- \ifdim\wd9=0pt %
- \else
- \errmessage{Unwanted space?}%
- \fi
- \endgroup
-}
-\test0N
-\test2N
-\setbox0=\hbox{}
-\test0Y
-\setbox2=\hbox{}
-\test2Y
-\setbox0=\vbox{}
-\test0Y
-\setbox2=\vbox{}
-\test0Y
-\setbox0=\hbox{ }%
-\test0N
-\setbox2=\hbox{ }%
-\test2N
-\setbox0=\hbox{\penalty1}%
-\test0N
-\setbox2=\hbox{\penalty1}%
-\test2N
-\csname @@end\endcsname\end
-%</test-ifboxempty>
-% \end{macrocode}
-%
-% \subsection{Test for next character detection}
-%
-% \begin{macrocode}
-%<*test-nextchar>
-\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}[2016/05/16]%
- \RequirePackage{eolgrab}[2011/01/12]%
-\fi
-\def\msg#{\immediate\write16}
-\begingroup
- \def\x#1{%
- \endgroup
- \let\TestSpaceToken= #1\relax
- }%
-\x{ }
-\def\TestSpace{ }
-\begingroup
- \lccode32=65 % space -> A
-\lowercase{%
- \endgroup
- \def\TestSpaceA{ }%
-}
-\def\TestCatch{%
- \eolgrab\@TestCatch
-}
-\def\@TestCatch#1{%
- \begingroup
- \def\x{#1}%
- \ifx\x\ltx@empty
- \else
- \ltx@onelevel@sanitize\x
- \errmessage{Unparsed stuff on line [\x]}%
- \fi
- \endgroup
-}
-\def\TestCmdM#1{%
- \TestCheckType{M}%
- \TestCatch
-}
-\def\TestCmdOM[#1]#2{%
- \TestCheckType{O}%
- \TestCatch
-}
-\def\TestCheckType#1{%
- \if\TestCmdType#1\relax
- \else
- \errmessage{Wrong type #1, expected: \TestCmdType}%
- \fi
-}
-\def\TestCmd#1{%
- \def\TestCmdType{#1}%
- \ltx@ifnextchar[\TestCmdOM\TestCmdM
-}
-\def\TestCmdExp#1{%
- \expandafter\TestCmd\expandafter#1%
-}
-\outer\def\TestOuter{}
-\TestCmd O[o]{m}
-\TestCmd M{m}
-\TestCmd O [o]{m}
-\TestCmd M {m}
-\def\x#1{\def\x{#1#1}}\x{ }
-\TestCmdExp O\x[o]{m}
-\TestCmdExp M\x{m}
-\def\x#1{\def\x{#1#1#1#1}}\x{ }
-\TestCmdExp O\x[o]{m}
-\TestCmdExp M\x{m}
-\def\x{\TestSpaceToken}
-\TestCmdExp O\x[o]{m}
-\TestCmdExp M\x{m}
-\def\x{\TestSpaceToken\TestSpaceToken\TestSpaceToken}
-\TestCmdExp O\x[o]{m}
-\TestCmdExp M\x{m}
-\TestCmd M\TestSpace
-\TestOuter
-\TestCmd M \TestSpace
-\TestOuter
-\TestCmd M\iftrue
-\TestOuter
-\TestCmd M\iffalse
-\TestOuter
-\TestCmd M\else
-\TestOuter
-\TestCmd M\fi
-\TestOuter
-\TestCmd M \iftrue
-\TestOuter
-\TestCmd M \iffalse
-\TestOuter
-\TestCmd M \else
-\TestOuter
-%
-\def\TestCmd#1{%
- \def\TestCmdType{#1}%
- \ltx@ifnextchar@nospace[\TestCmdOM\TestCmdM
-}
-\TestCmd O[o]{m}
-\TestCmd M{m}
-\TestCmd M [
-\TestOuter
-\TestCmd M {m}
-\TestCmd M\iftrue
-\TestOuter
-\TestCmd M\iffalse
-\TestOuter
-\TestCmd M\else
-\TestCmd M\fi
-\TestOuter
-\TestOuter
-%
-\def\TestCmd#1{%
- \def\TestCmdType{#1}%
- \ltx@ifnextchar(\TestCmdPM\TestCmdM
-}
-\def\TestCmdPM(#1)#2{%
- \TestCheckType{P}%
- \TestCatch
-}
-\TestCmd P(p){m}
-\TestCmd M{m}
-\TestCmd P (p){m}
-\TestCmd M {m}
-%
-\def\TestCmd#1{%
- \def\TestCmdType{#1}%
- \ltx@ifnextchar{ }\TestCmdSM\TestCmdM
-}
-\def\TestCmdSM#1#{%
- \TestCheckType{S}%
- \begingroup
- \let\x= #1\relax
- \ifx\x\TestSpaceToken
- \else
- \errmessage{unexpected space token: \meaning#1}%
- \fi
- \endgroup
- \def\TestCmdType{M}%
- \TestCmdM
-}
-\TestCmd S {m}
-\TestCmd M{m}
-\def\x#1{\def\x{#1#1}}\x{ }
-\TestCmdExp S\x{m}
-%
-\def\TestCmd#1{%
- \def\TestCmdType{#1}%
- \ltx@ifnextchar\iffalse\TestCmdIM\TestCmdM
-}
-\def\TestCmdIM\iffalse#1{%
- \TestCheckType{I}%
- \TestCatch
-}
-\TestCmd M\iftrue
-\TestOuter
-\TestCmd M \iftrue
-\TestCmd I\iffalse\iffalse
-\TestCmd I \iffalse\iffalse
-\TestOuter
-%
-\def\TestCmd#1{%
- \def\TestCmdType{#1}%
- \ltx@ifnextchar@nospace\iffalse\TestCmdIM\TestCmdM
-}
-\TestCmd M\iftrue
-\TestOuter
-\TestCmd I\iffalse\iffalse
-\TestOuter
-\csname @@end\endcsname\end
-%</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}[2016/05/16]%
- \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}
+%% \section{Installation}
%
% \subsection{Download}
%
@@ -2955,13 +2085,6 @@ X=%
% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
% ltxcmds.sty & tex/generic/oberdiek/ltxcmds.sty\\
% ltxcmds.pdf & doc/latex/oberdiek/ltxcmds.pdf\\
-% test/ltxcmds-test1.tex & doc/latex/oberdiek/test/ltxcmds-test1.tex\\
-% test/ltxcmds-test-gobble.tex & doc/latex/oberdiek/test/ltxcmds-test-gobble.tex\\
-% test/ltxcmds-test-ifempty.tex & doc/latex/oberdiek/test/ltxcmds-test-ifempty.tex\\
-% 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