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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
{\color{red!90!black}
\begin{verbatim}
\newcondition{defined}{}
\newcondition{paper}{a4,a5,b5}
\setcondition{paper={a5,b5}}
\end{verbatim}
}
{
\newcondition{defined}{}
\newcondition{paper}{a4,a5,b5}
\setcondition{paper={a5,b5}}
\def\cdcmdtest#1->#2 /{\textcolor{red!90!black}{\detokenize{#1}}:~ #1 \newline}
\parindent=0pt\ttfamily
\cdcmdtest\conditionif[*]{t}{f}->t /
\cdcmdtest\conditionif[defined]{t}{f}->t /
\cdcmdtest\conditionif[defined=]{t}{f}->f /
\cdcmdtest\conditionif[defined=*]{t}{f}->t /
\cdcmdtest\conditionif[defined=a]{t}{f}->f /
\cdcmdtest\conditionif[paper={a5,a0},undefined]{t}{f}->t /
\cdcmdtest\conditionif*[*]{t}{f}->t /
\cdcmdtest\conditionif*[defined]{t}{f}->t /
\cdcmdtest\conditionif*[defined={,,}]{t}{f}->f /
\cdcmdtest\conditionif*[defined=*]{t}{f}->t /
\cdcmdtest\conditionif*[defined=a]{t}{f}->f /
\cdcmdtest\conditionif*[paper={a5,a0},undefined]{t}{f}->f /
\cdcmdtest\conditionif*[*,undefined]{t}{f}->f /
\cdcmdtest\conditionif*[paper={a5,b5}]{t}{f}->t /
\cdcmdtest\conditionif*[paper={a5,,b5}]{t}{f}->t /
\cdcmdtest\conditionif*[paper={a5,b6,a5}]{t}{f}->f /
\cdcmdtest\conditionif*[paper={a5,{ },45}]{t}{f}->f /
\cdcmdtest\conditionif*[*,defined,paper={a5,b5}]{t}{f}->t /
}
{\color{red!90!black}
\begin{verbatim}
\def\truetext{true} \def\falsetext{false}
\edef\testa{\econditionif[*]{true}{false}}
\ifx\testa\truetext t\else f\fi
\ifx\testa\falsetext t\else f\fi
\strcmp {\econditionif[*]{true}{false}} {true}
\strcmp {\econditionif[*]{true}{false}} {false}
\strcmp {\testa} {\truetext}
\strcmp {\testa} {\falsetext}
\end{verbatim}
}
\def\truetext{true} \def\falsetext{false}
\edef\testa{\econditionif[*]{true}{false}}
\ifx\testa\truetext t\else f\fi
\ifx\testa\falsetext t\else f\fi
\strcmp{\econditionif[*]{true}{false}}{true}
\strcmp{\econditionif[*]{true}{false}}{false}
\strcmp{\testa}{\truetext}
\strcmp{\testa}{\falsetext}
{\color{red!90!black}
\begin{verbatim}
\conditioncase{
{paper=a3} {a3}
{paper=a4} {a4}
{paper,defined} {pd}
}
\end{verbatim}
}
\conditioncase{
{paper=a3} {a3}
{paper=a4} {a4}
{paper,defined} {pd}
}
{\color{red!90!black}
\begin{verbatim}
\conditioncaseTF{
{paper=a3} {a3}
{paper=a4} {a4}
{paper,defined} {pd}
}{true}{false}
\end{verbatim}
}
\conditioncaseTF{
{paper=a3} {a3}
{paper=a4} {a4}
{paper,defined} {pd}
}{true}{false}
{\color{red!90!black}
\begin{verbatim}
\conditioncase!{
{paper=a3} {a3}
{paper=a4} {a4}
{paper,defined} {pd}
}
\end{verbatim}
}
\conditioncase!{
{paper=a3} {a3}
{paper=a4} {a4}
{paper,defined} {pd}
}
{\color{red!90!black}
\begin{verbatim}
\conditioncaseTF!{
{paper=a3} {a3}
{paper=a4} {a4}
{paper,defined} {pd}
}{true}{false}
\end{verbatim}
}
\conditioncaseTF!{
{paper=a3} {a3}
{paper=a4} {a4}
{paper,defined} {pd}
}{true}{false}
{\color{red!90!black}
\begin{verbatim}
\newconditioncommand\longprotectedcdcmd{longprotectedcdcmd}
\newconditioncommand\longprotectedcdcmdi[1]{longprotectedcdcmdi<#1>}
\newconditioncommand\longprotectedcdcmdio[1][DFT]{longprotectedcdcmdio<#1>}
\newconditioncommand*\shortprotectedcdcmd{shortprotectedcdcmd}
\newconditioncommand*\shortprotectedcdcmdi[1]{shortprotectedcdcmdi<#1>}
\newconditioncommand*\shortprotectedcdcmdio[1][DFT]{shortprotectedcdcmdio<#1>}
\setcondition{paper={a4,a5}}
\longprotectedcdcmd{*}
\longprotectedcdcmdi{*}{1\par arg}
\longprotectedcdcmdio{*}
\longprotectedcdcmdio{*}[1opt]
\longprotectedcdcmdio{paper=a4}[1opt a4]
\longprotectedcdcmdio+{paper={a4,a7}}[1opt a4a7]
\shortprotectedcdcmd{*}
\shortprotectedcdcmdi{*}{1\par arg}
\shortprotectedcdcmdio{*}
\shortprotectedcdcmdio{*}[1opt]
\shortprotectedcdcmdio{paper=a4}[1opt a4]
\shortprotectedcdcmdio+{paper={a4,a7}}[1opt a4a7]
\end{verbatim}
}
\newconditioncommand\longprotectedcdcmd{longprotectedcdcmd}
\newconditioncommand\longprotectedcdcmdi[1]{longprotectedcdcmdi<#1>}
\newconditioncommand\longprotectedcdcmdio[1][DFT]{longprotectedcdcmdio<#1>}
\newconditioncommand*\shortprotectedcdcmd{shortprotectedcdcmd}
\newconditioncommand*\shortprotectedcdcmdi[1]{shortprotectedcdcmdi<#1>}
\newconditioncommand*\shortprotectedcdcmdio[1][DFT]{shortprotectedcdcmdio<#1>}
{\ttfamily\setcondition{paper={a4,a5}}\obeylines
\longprotectedcdcmd{*}
\longprotectedcdcmdi{*}{1\par arg}
\longprotectedcdcmdio{*}
\longprotectedcdcmdio{*}[1opt]
\longprotectedcdcmdio{paper=a4}[1opt a4]
\longprotectedcdcmdio+{paper={a4,a7}}[1opt a4a7]
\shortprotectedcdcmd{*}
\shortprotectedcdcmdi{*}{1arg}
\shortprotectedcdcmdio{*}
\shortprotectedcdcmdio{*}[1opt]
\shortprotectedcdcmdio{paper=a4}[1opt a4]
\shortprotectedcdcmdio+{paper={a4,a7}}[1opt a4a7]
}
|