summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/multiexpand/multiexpand.sty
blob: e69945c3c9fb42672962e8dc8171a4a7aeb1bab4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
%%
%% 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\relax%
\gdef\ME@use#1{#1}%
\gdef\MultiExpand{\romannumeral\multiexpand}%
\gdef\MultiExpandAfter{\romannumeral\multiexpandafter}%
\xdef\ME@endroman#1{0\noexpand\expandafter\space}%
\xdef\ME@endroman@after#1{0\noexpand\expandafter\space\noexpand\expandafter}%
\long\gdef\multiexpand#1{%
  \ifnum#1<2 \expandafter \ME@endroman%
  \else      \expandafter \ME@use%
  \fi%
  {\expandafter \multiexpand \expandafter {%
      \number\numexpr#1-1\expandafter}}%
}%
\long\gdef\multiexpandafter#1{%
  \ifnum#1<2 \expandafter\ME@endroman@after%
  \else      \expandafter \ME@use%
  \fi%
  {\expandafter \multiexpandafter \expandafter {%
      \number\numexpr#1-1\expandafter}\expandafter}%
}%
\endgroup
%% 
%% Copyright (C) 2011-2013 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'.