-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexpandafter.tex
More file actions
79 lines (62 loc) · 1.2 KB
/
expandafter.tex
File metadata and controls
79 lines (62 loc) · 1.2 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
\documentclass{jsarticle}
\makeatletter
\def\testA{{A}{B}}
\def\testB#1{[#1]}
\def\testC{\testB\testA}
\def\testD{D}
\def\testE{E}
\def\testF{F}
\makeatother
\begin{document}
\tracingonline=1
\tracingmacros=1
\tracingcommands=1
1
%[A]B
\expandafter\expandafter\testC
%\expandafter\testB\testA
%\testB{A}{B}
%
2
%[AB]
\expandafter\expandafter\expandafter\testC
%\expandafter\testC
%\testC
%\testB\testA
%
%
3
%[AB]
\expandafter\expandafter\expandafter\expandafter\testC
%\expandafter\expandafter\testB\testA
%\expandafter\expandafter[\testA]
%\expandafter\expandafter[{A}{B}]
%
%?
%\expandafter[\testA]
%[{A}{B}]
%
4
%D[A]B
\expandafter\testD\expandafter\expandafter\testC
%\testD\expandafter\testB\testA
%D\expandafter\testB\testA
%D\testB{A}{B}
%D[A]{B}
%->正
%?
%\testD\expandafter\testB\testA
%\testD\expandafter[\testA] %expandafterで抑制されたやつは後回しという考え方
%\testD\expandafter[{A}{B}]
%D[{A}{B}]
%->誤
5
%DEF
\expandafter\testD\expandafter\expandafter\testE\testF
%\testE -> \testD -> \testFの順に展開されている
%\testD\expandafter E\testF
%D\expandafter E\testF
%DEF
%
%一回展開したら、まだ展開していないところまで戻る?
\end{document}