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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
|
%%
%% This is file `scsnowman.sty', part of scsnowman package.
%% Maintained on GitHub:
%% https://github.com/aminophen/scsnowman
%%
%% Copyright (c) 2015-2018 Hironobu Yamashita
%% Email : h.y.acetaminophen[a t]gmail.com
%% GitHub : https://github.com/aminophen
%% Blog : http://acetaminophen.hatenablog.com/
%% Twitter : @aminophen
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{scsnowman}[2018/06/07 v1.2d Snowman variants using TikZ]
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{sctkzsym-base}}
\ProcessOptions\relax
\RequirePackage{sctkzsym-base}[2017/08/08]
%
% make document snowman (joke)
\ifsctkzsym@document
\def\makedocumentsnowman{%
\ifx\documentclass\@notprerr
% Already after \begin{document}, throw an error
\def\sctkzsym@documentsnowman{%
\PackageError{scsnowman}{%
Use of \noexpand\makedocumentsnowman too late!\MessageBreak
Try using before \string\begin{document}}{%
I'll try to stop processing, but
this attempt can fail.\MessageBreak\@ehc}%
% If the above error is ignored, there's no way to
% exit successfully in all cases. So, try to continue
% processing by ignoring all LaTeX errors.
% TeX errors still remain; therefore, \makedocumentsnowman
% in internal vertical mode or math mode will fail.
\let\@latex@error\@gobbletwo\par
\scsnowman[init,scale=14,hat,muffler,buttons,snow]%
\scsnowman[init,scale=14,hat,muffler,buttons,arms]%
\scsnowman[init,scale=14,body,hat,muffler,buttons,snow]%
\end{document}}%
\else\ifx\documentclass\@twoclasseserror
\ifx\AtBeginDocument\@firstofone
% In preamble, inside \AtBeginDocument; avoid infinite loop
\def\sctkzsym@documentsnowman{%
\centering
\scsnowman[init,scale=14,hat,muffler,buttons,snow]%
\scsnowman[init,scale=14,hat,muffler,buttons,arms]%
\scsnowman[init,scale=14,body,hat,muffler,buttons,snow]%
\end{document}}%
\else
% In preamble; start document
\def\sctkzsym@documentsnowman{%
\pagestyle{empty}%
\begin{document}%
\centering
\scsnowman[init,scale=14,hat,muffler,buttons,snow]%
\scsnowman[init,scale=14,hat,muffler,buttons,arms]%
\scsnowman[init,scale=14,body,hat,muffler,buttons,snow]%
\end{document}}%
\fi
\else
% Before \documentclass{...}; load class and start document
\def\sctkzsym@documentsnowman{%
\documentclass{minimal}%
\begin{document}%
\centering
\scsnowman[init,scale=18,hat,muffler,buttons,snow]%
\scsnowman[init,scale=18,hat,muffler,buttons,arms]%
\scsnowman[init,scale=18,body,hat,muffler,buttons,snow]%
\end{document}}%
\fi\fi
\sctkzsym@documentsnowman
}
\fi
%
% change QED symbol (joke)
\ifsctkzsym@qed
\def\sctkzsym@snowman@qedsymbol{\scsnowman[init,hat=true,muffler=red]}
\newcommand{\makeqedsnowman}{%
\ifx\qedsymbol\sctkzsym@snowman@qedsymbol\else
\let\sctkzsym@saved@qedsymbol\qedsymbol
\let\qedsymbol\sctkzsym@snowman@qedsymbol
\fi
}
\fi
%
% change item label (joke)
\ifsctkzsym@item
\def\sctkzsym@snowman@labelitemi{\scsnowman[init,hat=true,muffler=red]}
\def\sctkzsym@snowman@labelitemii{\scsnowman[init,hat=true,muffler=blue]}
\def\sctkzsym@snowman@labelitemiii{\scsnowman[init,hat=true,muffler=green]}
\def\sctkzsym@snowman@labelitemiv{\scsnowman[init,hat=true,muffler=yellow]}
\newcommand{\makeitemsnowman}{%
\ifx\labelitemi\sctkzsym@snowman@labelitemi\else
\let\sctkzsym@saved@labelitemi\labelitemi
\let\sctkzsym@saved@labelitemii\labelitemii
\let\sctkzsym@saved@labelitemiii\labelitemiii
\let\sctkzsym@saved@labelitemiv\labelitemiv
\let\labelitemi\sctkzsym@snowman@labelitemi
\let\labelitemii\sctkzsym@snowman@labelitemii
\let\labelitemiii\sctkzsym@snowman@labelitemiii
\let\labelitemiv\sctkzsym@snowman@labelitemiv
\fi
}
\fi
%
%------------------------------- ZR something BEGIN
% change enumerate label using \scsnowmannumeral (joke)
% (this feature is `scsnowman'-specific, so the name-space
% is intentionally set to \scsnowman@...)
% unique token
\def\scsnowman@end{\scsnowman@end@}
\let\scsnowman@eight\relax
%% \scsnowman@scan@option\CScontinue{<prologue>}
\def\scsnowman@scan@option#1#2{%
\scsnowman@scan@option@a#2[]\scsnowman@end#1%
}
\def\scsnowman@scan@option@a#1[#2]#3\scsnowman@end#4{%
#4{#2}%
}
\def\enumsnowman#1#{%
\scsnowman@scan@option\scsnowman@enumsnowman{#1}%
}
\def\scsnowman@enumsnowman#1#2{%
\scsnowmanNumeral{#1}{\@nameuse{c@#2}}%
}
% For use with \pagenumbering.
\def\@enumsnowman{%
\scsnowmanNumeral{}%
}
\def\scsnowmannumeral#1#{%
\scsnowman@scan@option\scsnowmanNumeral{#1}%
}
% \scsnowmanNumeral{<option>}{<number>}
% change 8 to snowman in counters (joke)
% (this feature is `scsnowman'-specific, so the name-space
% is intentionally set to \scsnowman@...)
% internal entry point
\newcommand*\scsnowmanNumeral[2]{%
\expandafter\scsnowman@@numeral\number#2\relax\scsnowman@end{#1}%
}
\def\scsnowman@@numeral#1\relax#2\scsnowman@end#3{%
\scsnowman@numeral{#3}{#1}%
}
\DeclareRobustCommand*\scsnowman@numeral[2]{%
\begingroup
\def\scsnowman@eight{\scsnowman[#1]}%
\scsnowman@numeral@a#28\scsnowman@end
\endgroup
}
\def\scsnowman@numeral@a#18#2\scsnowman@end{%
\ifx\scsnowman@end#2\scsnowman@end
#1%
\else
#1\scsnowman@eight
\scsnowman@numeral@a#2\scsnowman@end
\fi
}
\providecommand*\pdfstringdefPreHook{}
\g@addto@macro\pdfstringdefPreHook{%
\let\scsnowman@eight\scsnowman@hy@eight
\let\scsnowman@numeral\scsnowman@hy@numeral
}
\def\scsnowman@hy@numeral#1#2{% #1 is ignored
\scsnowman@numeral@a#28\scsnowman@end
}
\DeclareTextCommand{\scsnowman@hy@eight}{PU}{\9046\003}% U+2603
\DeclareTextCommand{\scsnowman@hy@eight}{PD1}{8}%fallback
\ifx\forcecjktoken\@undefined\else %upTeX
\begingroup
\kansujichar8="2603
\xdef\scsnowman@hy@eight{\kansuji8}
\endgroup
\fi
%------------------------------- ZR something END
%
% key initialization
\newcommand\sctkzsym@snowman@initkeys{%
\def\sctkzsym@snowman@init{false}%
\def\sctkzsym@snowman@scale{1}%
\def\sctkzsym@snowman@shape{normal}%
\def\sctkzsym@snowman@body{false}%
\def\sctkzsym@snowman@eyes{true}% default on
\def\sctkzsym@snowman@nose{false}%
\def\sctkzsym@snowman@mouthshape{smile}%
\def\sctkzsym@snowman@mouth{true}% default on
\def\sctkzsym@snowman@sweat{false}%
\def\sctkzsym@snowman@hat{false}%
\def\sctkzsym@snowman@arms{false}%
\def\sctkzsym@snowman@muffler{false}%
\def\sctkzsym@snowman@buttons{false}%
\def\sctkzsym@snowman@snow{false}%
\def\sctkzsym@snowman@note{false}%
\def\sctkzsym@snowman@adjustbaseline{false}%
\def\sctkzsym@snowman@mikan{false}%
\def\sctkzsym@snowman@leaf{false}%
\def\sctkzsym@snowman@broom{false}%
}
\newcommand{\sctkzsym@snowman@defaultkeys}{%
\sctkzsym@snowman@initkeys
}
\sctkzsym@snowman@defaultkeys
%
% key definitions
\sctkzsym@define@key@withbool{snowman}{init}
\sctkzsym@define@key@wodefault{snowman}{scale}
\sctkzsym@define@key@wodefault{snowman}{shape}
\sctkzsym@define@key@withbool{snowman}{body}
\sctkzsym@define@key@withbool{snowman}{eyes}
\sctkzsym@define@key@withbool{snowman}{nose}
\sctkzsym@define@key@withword{snowman}{mouthshape}{smile,frown,tight}
\sctkzsym@define@key@withbool{snowman}{mouth}
\sctkzsym@define@key@withbool{snowman}{sweat}
\sctkzsym@define@key@withbool{snowman}{hat}
\sctkzsym@define@key@withbool{snowman}{arms}
\sctkzsym@define@key@withbool{snowman}{muffler}
\sctkzsym@define@key@withbool{snowman}{buttons}
\sctkzsym@define@key@withbool{snowman}{snow}
\sctkzsym@define@key@withbool{snowman}{note}
\sctkzsym@define@key@withbool{snowman}{adjustbaseline}
\sctkzsym@define@key@withbool{snowman}{mikan}
\sctkzsym@define@key@withbool{snowman}{leaf}
\sctkzsym@define@key@withbool{snowman}{broom}
%
% definition of \scsnowman[...]
\DeclareRobustCommand\scsnowman[1][]{%
% key initialization using default
\sctkzsym@snowman@defaultkeys
% read <key>=<value>
\setkeys{sctkzsym@snowman}{#1}%
% check init; if init=true, initialize and read keys again
\sctkzsym@hndl@key@onlybool{snowman}{init}%
\ifsctkzsym@snowman@init
\sctkzsym@snowman@initkeys
\setkeys{sctkzsym@snowman}{#1,init=false}%
\fi
%
% check body; determine whether "black snowman" or "white snowman"
\sctkzsym@hndl@key@withbool{snowman}{body}%
\ifsctkzsym@snowman@body % "black snowman"; black snow; white eyes/mouth/stroke
\def\sctkzsym@snowman@bodystroke{\sctkzsym@snowman@body}%
\def\sctkzsym@snowman@bodyfill{\sctkzsym@snowman@body}%
\def\sctkzsym@snowman@bodypath{\path[draw=\sctkzsym@snowman@bodystroke,fill=\sctkzsym@snowman@bodyfill]}%
\def\sctkzsym@snowman@snowstroke{\sctkzsym@snowman@snow}%
\def\sctkzsym@snowman@snowfill{\sctkzsym@snowman@snow}%
\def\sctkzsym@snowman@snowpath{\path[draw=\sctkzsym@snowman@snowstroke,fill=\sctkzsym@snowman@snowfill]}%
\def\sctkzsym@snowman@eyefill{\sctkzsym@defaultanticolor}%
\def\sctkzsym@snowman@nosestroke{\sctkzsym@defaultanticolor}%
\def\sctkzsym@snowman@nosefill{\sctkzsym@snowman@nose}%
\def\sctkzsym@snowman@mouthstroke{\sctkzsym@defaultanticolor}%
\def\sctkzsym@snowman@sweatstroke{\sctkzsym@defaultanticolor}%
\def\sctkzsym@snowman@sweatfill{\sctkzsym@snowman@sweat}%
\def\sctkzsym@snowman@mufflerstroke{\sctkzsym@defaultanticolor}%
\def\sctkzsym@snowman@mufflerfill{\sctkzsym@snowman@muffler}%
\def\sctkzsym@snowman@buttonstroke{\sctkzsym@defaultanticolor}%
\def\sctkzsym@snowman@buttonfill{\sctkzsym@snowman@buttons}%
\else % "white snowman"; white snow; black eyes/mouth/stroke; bodystroke should be there
\def\sctkzsym@snowman@bodystroke{\sctkzsym@defaultcolor}%
\def\sctkzsym@snowman@bodyfill{}%
\def\sctkzsym@snowman@bodypath{\path[draw=\sctkzsym@snowman@bodystroke]}%
\def\sctkzsym@snowman@snowstroke{\sctkzsym@snowman@snow}%
\def\sctkzsym@snowman@snowfill{}%
\def\sctkzsym@snowman@snowpath{\path[draw=\sctkzsym@snowman@snowstroke]}%
\def\sctkzsym@snowman@eyefill{\sctkzsym@defaultcolor}%
\def\sctkzsym@snowman@nosestroke{\sctkzsym@snowman@nose}%
\def\sctkzsym@snowman@nosefill{\sctkzsym@snowman@nose}%
\def\sctkzsym@snowman@mouthstroke{\sctkzsym@defaultcolor}%
\def\sctkzsym@snowman@sweatstroke{\sctkzsym@snowman@sweat}%
\def\sctkzsym@snowman@sweatfill{\sctkzsym@defaultanticolor}%
\def\sctkzsym@snowman@mufflerstroke{\sctkzsym@snowman@muffler}%
\def\sctkzsym@snowman@mufflerfill{\sctkzsym@snowman@muffler}%
\def\sctkzsym@snowman@buttonstroke{\sctkzsym@snowman@buttons}%
\def\sctkzsym@snowman@buttonfill{\sctkzsym@snowman@buttons}%
\fi
% check eyes (currently eyes=<color> not supported; falling back to default-(anti)color)
\sctkzsym@hndl@key@withbool{snowman}{eyes}%
\def\sctkzsym@snowman@eyepath{\path[fill=\sctkzsym@snowman@eyefill]}%
% check nose
\sctkzsym@hndl@key@withbool{snowman}{nose}%
\def\sctkzsym@snowman@nosepath{\path[draw=\sctkzsym@snowman@nosestroke,fill=\sctkzsym@snowman@nosefill]}%
% check mouth (currently mouth=<color> not supported; falling back to default-(anti)color)
\sctkzsym@hndl@key@withword{snowman}{mouthshape}%
\sctkzsym@hndl@key@withbool{snowman}{mouth}%
\def\sctkzsym@snowman@mouthpath{\path[draw=\sctkzsym@snowman@mouthstroke]}%
% check sweat
\sctkzsym@hndl@key@withbool{snowman}{sweat}%
\def\sctkzsym@snowman@sweatpath{\path[draw=\sctkzsym@snowman@sweatstroke,fill=\sctkzsym@snowman@sweatfill]}%
% check hat
\sctkzsym@hndl@key@withbool{snowman}{hat}%
\def\sctkzsym@snowman@hatstroke{\sctkzsym@snowman@hat}%
\def\sctkzsym@snowman@hatfill{\sctkzsym@snowman@hat}%
\def\sctkzsym@snowman@hatpath{\path[draw=\sctkzsym@snowman@hatstroke,fill=\sctkzsym@snowman@hatfill]}%
% check arms
\sctkzsym@hndl@key@withbool{snowman}{arms}%
\def\sctkzsym@snowman@armsstroke{\sctkzsym@snowman@arms}%
\def\sctkzsym@snowman@armsfill{\sctkzsym@snowman@arms}%
\def\sctkzsym@snowman@armspath{\path[draw=\sctkzsym@snowman@armsstroke,fill=\sctkzsym@snowman@armsfill]}%
% check muffler
\sctkzsym@hndl@key@withbool{snowman}{muffler}%
\def\sctkzsym@snowman@mufflerpath{\path[draw=\sctkzsym@snowman@mufflerstroke,fill=\sctkzsym@snowman@mufflerfill]}%
% check buttons
\sctkzsym@hndl@key@withbool{snowman}{buttons}%
\def\sctkzsym@snowman@buttonpath{\path[draw=\sctkzsym@snowman@buttonstroke,fill=\sctkzsym@snowman@buttonfill]}%
% check snow
\sctkzsym@hndl@key@withbool{snowman}{snow}%
% check note
\sctkzsym@hndl@key@withbool{snowman}{note}%
\def\sctkzsym@snowman@notefill{\sctkzsym@snowman@note}%
\def\sctkzsym@snowman@notepath{\path[fill=\sctkzsym@snowman@notefill]}%
% check adjustbaseline
\sctkzsym@hndl@key@onlybool{snowman}{adjustbaseline}%
% check mikan/leaf
\sctkzsym@hndl@key@withbool{snowman}{mikan}%
\sctkzsym@hndl@key@withbool{snowman}{leaf}%
\def\sctkzsym@snowman@mikanstroke{\sctkzsym@snowman@mikan}%
\def\sctkzsym@snowman@mikanfill{\sctkzsym@snowman@mikan}%
\def\sctkzsym@snowman@mikanpath{\path[draw=\sctkzsym@snowman@mikanstroke,fill=\sctkzsym@snowman@mikanfill]}%
\def\sctkzsym@snowman@leafstroke{\sctkzsym@snowman@leaf}%
\def\sctkzsym@snowman@leaffill{\sctkzsym@snowman@leaf}%
\def\sctkzsym@snowman@leafpath{\path[draw=\sctkzsym@snowman@leafstroke,fill=\sctkzsym@snowman@leaffill]}%
% check broom
\sctkzsym@hndl@key@withbool{snowman}{broom}%
\def\sctkzsym@snowman@broomstroke{\sctkzsym@snowman@broom}%
\def\sctkzsym@snowman@broompath{\path[draw=\sctkzsym@snowman@broomstroke]}%
%
% drawing snowman
\set@sctkzsym@coord@scl{\sctkzsym@snowman@scale}%
\ifdim\sctkzsym@coord@scl<\z@\set@sctkzsym@coord@scl{-\sctkzsym@snowman@scale}\fi%
%
%%%%% input from def file
%
\expandafter\ifx\csname sctkzsym@snowman@shape@\sctkzsym@snowman@shape\endcsname\relax
\PackageError{scsnowman}{%
Unsupported value `\sctkzsym@snowman@shape' for shape}\@ehc
\else
\csname sctkzsym@snowman@shape@\sctkzsym@snowman@shape\endcsname
\fi
%
%%%%%
%
% key initialization using default
\sctkzsym@snowman@defaultkeys
}
%
% definition of \scsnowmandefault{...}
\newcommand{\scsnowmandefault}[1]{%
\renewcommand{\sctkzsym@snowman@defaultkeys}{%
% key initialization
\sctkzsym@snowman@initkeys
% read <key>=<value> (init=true is silently ignored)
\setkeys{sctkzsym@snowman}{#1,init=false}%
}%
\sctkzsym@snowman@defaultkeys
}
%
% definition of \usescsnowmanlibrary{...}
\newcommand{\usescsnowmanlibrary}[1]{%
\edef\@tempa{\zap@space#1 \@empty}%
\@for\@tempa:=\@tempa\do{%
\chardef\sctkzsym@catcode=\catcode`\@\relax
\makeatletter\input{scsnowman-\@tempa.def}%
\catcode`\@=\sctkzsym@catcode\relax}%
}
\@onlypreamble\usescsnowmanlibrary
%
% load shape definitions
\usescsnowmanlibrary{normal}% default
%
\endinput
%%
%% End of file `scsnowman.sty'.
|