diff options
author | Karl Berry <karl@freefriends.org> | 2015-09-20 22:31:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-09-20 22:31:12 +0000 |
commit | 9280f63533af6460c33dbfcf486a5e5368afed53 (patch) | |
tree | 4d9646df783056a13bfdfe201d510c6fe07c5858 /Master/texmf-dist/tex/generic/multiexpand/multiexpand.sty | |
parent | bf941dd6fd9a67534bf00d114908c151b5fd1606 (diff) |
multiexpand (20sep15)
git-svn-id: svn://tug.org/texlive/trunk@38416 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/multiexpand/multiexpand.sty')
-rw-r--r-- | Master/texmf-dist/tex/generic/multiexpand/multiexpand.sty | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/multiexpand/multiexpand.sty b/Master/texmf-dist/tex/generic/multiexpand/multiexpand.sty new file mode 100644 index 00000000000..7bbad01a38f --- /dev/null +++ b/Master/texmf-dist/tex/generic/multiexpand/multiexpand.sty @@ -0,0 +1,90 @@ +%% +%% This is file `multiexpand.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% multiexpand.dtx (with options: `package') +%% ---------------------------------------------------------------- +%% multiexpand --- trigger multiple expansions in one expansion step. +%% E-mail: blflatex@gmail.com +%% Released under the LaTeX Project Public License v1.3c or later +%% See http://www.latex-project.org/lppl.txt +%% ---------------------------------------------------------------- +%% +\begingroup +\catcode `\@=11 +\gdef \MultiExpand {\romannumeral \multiexpand } +\gdef \MultiExpandAfter {\romannumeral \multiexpandafter } +\expandafter \ifx \csname numexpr\endcsname \relax +\long \gdef \multiexpand@gobble #1{} +\gdef \multiexpand {\multiexpand@aux \multiexpand@ } +\gdef \multiexpandafter {\multiexpand@aux \multiexpand@after } +\long \gdef \multiexpand@aux #1#2% + {\expandafter \multiexpand@test \number #2;#1} +\gdef \multiexpand@test #1;#2% + {% + \ifnum #1>0 + \multiexpand@reverse #1{?\multiexpand@reverse@end }?;;#2% + \fi + 0 % + } +\gdef \multiexpand@reverse #1#2;% + {\multiexpand@gobble #1\multiexpand@reverse #2;#1} +\gdef \multiexpand@reverse@end #1;?#2#3;#4#50 + {#5\multiexpand@iterate #41#3;} +\gdef \multiexpand@iterate #1#21#3% + {% + \ifx ;#3\multiexpand@end \fi + \ifx 0#3\multiexpand@zero \fi + \expandafter \multiexpand@iterate + \expandafter #1% + \number 1#2% + \ifcase #3 \or 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or 8\fi + #1% + } +\gdef \multiexpand@zero #1#2\number 1#3\ifcase #4\fi #5% + {#1\multiexpand@iterate #59#31} +\gdef \multiexpand@end #1#2\ifcase #3\fi #4{#10 } +\gdef \multiexpand@ #1;{#1\expandafter ;} +\gdef \multiexpand@after #1;{#1\expandafter ;\expandafter } +\else +\gdef \multiexpand@ #1;% + {% + \ifnum #1<2 \multiexpand@end \fi + \expandafter \multiexpand@ + \the \numexpr #1-1\expandafter ;% + } +\gdef \multiexpand@after #1;% + {% + \ifnum #1<2 \multiexpand@end \fi + \expandafter \multiexpand@after + \the \numexpr #1-1\expandafter ;\expandafter + } +\gdef \multiexpand@end #1#2#3;{#10#2 } +\long \gdef \multiexpand #1% + {\expandafter \multiexpand@ \the \numexpr #1;} +\long \gdef \multiexpandafter #1% + {\expandafter \multiexpand@after \the \numexpr #1;} +\fi +\endgroup +%% +%% Copyright (C) 2011-2015 by Bruno Le Floch <blflatex@gmail.com> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License (LPPL), either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in the file: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This work is "maintained" (as per LPPL maintenance status) by +%% Bruno Le Floch. +%% +%% This work consists of the file multiexpand.dtx +%% and the derived files multiexpand.ins, +%% multiexpand.pdf and +%% multiexpand.sty. +%% +%% +%% End of file `multiexpand.sty'. |