summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/etextools/etextools.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/etextools/etextools.sty')
-rw-r--r--Master/texmf-dist/tex/latex/etextools/etextools.sty18
1 files changed, 17 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/latex/etextools/etextools.sty b/Master/texmf-dist/tex/latex/etextools/etextools.sty
index 50b65479f09..f6d54d4572d 100644
--- a/Master/texmf-dist/tex/latex/etextools/etextools.sty
+++ b/Master/texmf-dist/tex/latex/etextools/etextools.sty
@@ -178,6 +178,9 @@
%% \showcs { csname }
\providecommand*\showcs[1]{\expandafter\show\csname#1\endcsname}
+%% \showthecs { csname }
+\providecommand*\showthecs[1]{\expandafter\showthe\csname#1\endcsname}
+
%% \meaningcs { csname }
\providecommand\meaningcs[1]{\romannumeral-`\q
\csname\ifcsdef{#1}{ettl@meaningcs\endcsname{#1}}
@@ -275,6 +278,19 @@
oftwo\endcsname}
\def\ettl@ifxsingle#1#2#3#4{\ettl@nbk#1//{\ifx#1#2#3\else#4\fi}{#4}//}
+%% \iffirsttoken token { string }{ true }{ false }
+\providecommand\iffirsttoken[2]{\romannumeral\csname rmn@%
+ \ettl@nbk#2//%
+ {\ettl@nbk#1//%
+ {\expandnexttwo\ettl@ifx{\ettl@car#2\@nil}{\ettl@car#1\@nil}{first}{second}}
+ {\if @\detokenize{#1}@secondoftwo\ettl@csname\fi
+ \ettl@firstspace{#2}{first}{second}}//}%
+ {\ettl@nbk#1//%
+ {\if @\detokenize{#2}@secondoftwo\ettl@csname\fi
+ \ettl@firstspace{#1}{first}{second}}
+ {\if @\detokenize{#1#2}@first\else second\fi}}//%
+ oftwo\endcsname}
+
%% \ifOneToken{ token }{ true }{ false }
\newcommand\ifOneToken[1]{\romannumeral\csname rmn@\ettl@firstspace{#1}
{\ettl@nbk#1//{second}{\if @\detokenize{#1}@second\else first\fi}//}
@@ -840,7 +856,7 @@
\expandafter##7\expandafter{\number\numexpr##1+1}{##2}##4##5//{##7}{##8}/End^^a7List/}
#1\protected\def#7{\@ifchar*%
{\@ifchar+{\ettl@forloop{\expandafter#2\expandafter*\expandafter+}{[####1]####2}}
- {\ettl@forloop{\expandafter#2\expandafter*\expandafter+}{####1}}}
+ {\ettl@forloop{\expandafter#2\expandafter*}{####1}}}
{\@ifchar+{\@ifchar*%
{\ettl@forloop{\expandafter#2\expandafter*\expandafter+}{[####1]####2}}
{\ettl@forloop{\expandafter#2\expandafter+}{[####1]####2}}}