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
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
|
%%
%% This is file `synttree.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% synttree.dtx
%%
%% IMPORTANT NOTICE:
%%
%% For the copyright see the source file.
%%
%% Any modified versions of this file must be renamed
%% with new filenames distinct from synttree.sty.
%%
%% For distribution of the original source see the terms
%% for copying and modification in the file synttree.dtx.
%%
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% \CheckSum{753}
%% synttree.dtx
%% Package `synttree' for use with LaTeX 2e
%% Version 1.4.2
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%% Digits \0\1\2\3\4\5\6\7\8\9
%% Exclamation \! Double quote \" Hash (number) \#
%% Dollar \$ Percent \% Ampersand \&
%% Acute accent \' Left paren \( Right paren \)
%% Asterisk \* Plus \+ Comma \,
%% Minus \- Point \. Solidus \/
%% Colon \: Semicolon \; Less than \<
%% Equals \= Greater than \> Question mark \?
%% Commercial at \@ Left bracket \[ Backslash \\
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
%%
\def\@AfterFi#1\fi{\fi#1}
\def\@AfterElseFi#1\else#2\fi{\fi#1}
\def\MTr@latexdrawline(#1,#2)(#3,#4){%
{%
\count0=#1 \advance\count0 by #3 \divide\count0 2
\count1=#2 \advance\count1 by #4 \divide\count1 2
\qbezier(#1,#2)(\count0,\count1)(#3,#4)%
}%
}
\def\MTr@etexdrawline(#1,#2)(#3,#4){%
{%
\count0=\@wholewidth \divide\count0 by 4736
\special{pn \the\count0}%
\count0= #1\advance \count0 2368 \divide \count0 4736
\count1=-#2\advance \count1 -2368 \divide \count1 4736
\special{pa \the\count0 \space \the\count1}%
\count0= #3\advance \count0 2368 \divide \count0 4736
\count1=-#4\advance \count1 -2368 \divide \count1 4736
\special{pa \the\count0 \space \the\count1}%
\special{fp}%
}%
}
\DeclareOption{specials}{
\let\MTr@drawline\MTr@etexdrawline%
}
\DeclareOption{nospecials}{
\let\MTr@drawline\MTr@latexdrawline%
}
\ExecuteOptions{nospecials}%
\ProcessOptions%
\newcount\MTr@level
\newcount\MTr@numchildren
\newcount\MTr@maxlevel
\newcount\MTr@mybranchmult
\newif\ifMTr@mytriangle
\newif\ifMTr@uselabel
\newbox\MTr@labelbox
\newbox\MTr@treebox
\def\MTr@makechildcounter#1{%
\expandafter\newcount\csname MTr@child#1\endcsname%
}
\def\MTr@makechildstoreage#1{%
\expandafter\newsavebox\csname MTr@child#1box\endcsname%
\MTr@makechildcounter{#1x}%
\MTr@makechildcounter{#1y}%
\MTr@makechildcounter{#1v}%
\MTr@makechildcounter{#1w}%
\MTr@makechildcounter{#1height}%
\MTr@makechildcounter{#1depth}%
\MTr@makechildcounter{#1branchmult}%
\MTr@makechildcounter{#1picheight}%
\MTr@makechildcounter{#1triangle}%
}
\def\MTr@childparam#1#2{\csname MTr@child#1#2\endcsname}
\newcount\MTr@treev
\newcount\MTr@treew
\newcount\MTr@treeheight
\newcount\MTr@treedepth
\newcount\MTr@branchmult
\MTr@branchmult 1
\newif\ifMTr@triangle
\newcount\MTr@labeldepth
\newcount\MTr@labelheight
\newcount\MTr@labelhalfwidth
\newcount\MTr@morex
\newcount\MTr@parenty
\newcount\MTr@picwidth
\newcount\MTr@picheight
\newlength{\MTr@templength}
\newcount\MTr@loopcnta
\newcount\MTr@tempcnta
\newcount\MTr@tempcntb
\newcount\MTr@tempcntc
\newcount\MTr@branchheight%
\newcommand{\branchheight}[1]{%
\setlength{\MTr@templength}{#1}%
\MTr@branchheight\MTr@templength%
}
\branchheight{.5in}%
\newcount\MTr@trianglemultright%
\newcount\MTr@trianglemultleft%
\newcommand{\trianglebalance}[1]{%
\MTr@trianglemultleft100%
\MTr@trianglemultright#1%
\advance\MTr@trianglemultleft-#1%
}
\trianglebalance{50}%
\newcount\MTr@lineoffset
\setlength{\MTr@templength}{2pt}%
\MTr@lineoffset\MTr@templength%
\newlength{\MTr@minheight}
\setlength{\MTr@minheight}{8pt}%
\newcount\MTr@childsidesep
\newcommand{\childsidesep}[1]{%
\setlength{\MTr@templength}{#1}%
\MTr@childsidesep\MTr@templength%
\ignorespaces%
}
\childsidesep{1em}
\newcount\MTr@childattachsep
\newcommand{\childattachsep}[1]{%
\setlength{\MTr@templength}{#1}%
\MTr@childattachsep\MTr@templength%
\ignorespaces%
}
\childattachsep{0.5in}
\def\synttree{%
\@ifnextchar[{\MTr@synttree{0}}{\MTr@synttree}%]
}
\def\MTr@synttree#1{%
\MTr@maxlevel#1%
\unitlength 1sp%
\MTr@level=0%
\MTr@numchildren=0%
\MTr@uselabelfalse%
\MTr@parserightbracket%
}
\def\MTr@parserightbracket#1]{%
\MTr@parseleftbracket#1[:\END%
\advance\MTr@level by -1%
\MTr@dorightbracket%
\ifnum\MTr@level=0%
\unhbox\MTr@childibox{}%
\else
\@AfterFi{\MTr@parserightbracket}%
\fi%
}
\def\MTr@parseleftbracket#1[#2\END{%
\ifMTr@uselabel%
\MTr@bottomnodefalse%
\MTr@mytrianglefalse%
\MTr@parsedot#1.: \END%
\fi%
\ifx:#2%
\else%
\MTr@doleftbracket%
\advance\MTr@level by 1%
\@AfterFi{\MTr@parseleftbracket#2\END}%
\fi%
}
\def\MTr@parsedot#1.#2 #3\END{%
\ifx:#2%
\setbox\MTr@labelbox\hbox{\ignorespaces#1\unskip}%
\else
\ifx#2b\MTr@bottomnodetrue\else%
\ifx#2x\MTr@bottomnodetrue\MTr@mytriangletrue\else%
\ifx#2t\MTr@mytriangletrue\else%
\typeout{synttree Warning: unknown dot option #2 in tree}%
\fi\fi\fi%
\MTr@parsedot#3\END
\fi
}
\def\MTr@doleftbracket{%
\bgroup%
\MTr@numchildren=0%
\MTr@uselabeltrue%
}
\def\MTr@dorightbracket{%
\MTr@maketreebox%
\egroup%
\MTr@uselabelfalse%
\MTr@savecurrentchildbox%
}
\def\MTr@savecurrentchildbox{%
\advance\MTr@numchildren by 1
\ifnum\MTr@numchildren<1%
\typeout{synttree internal warning: There is no child box to save.}%
\else
\ifnum\MTr@numchildren>10%
\typeout{synttree warning: More than 10 child boxes.
Can this be true?}%
\fi
\MTr@savechildbox{\romannumeral\MTr@numchildren}%
\fi
}
\def\MTr@savechildbox#1{%
\expandafter
\ifx\csname MTr@child#1box\endcsname\relax%
\MTr@makechildstoreage{#1}%
\fi%
\setbox%
\csname MTr@child#1box\endcsname%
\hbox{\unhbox\MTr@treebox}%
\csname MTr@child#1v\endcsname\MTr@treev%
\csname MTr@child#1w\endcsname\MTr@treew%
\csname MTr@child#1x\endcsname\MTr@treev%
\csname MTr@child#1height\endcsname\MTr@treeheight%
\csname MTr@child#1depth\endcsname\MTr@treedepth%
\csname MTr@child#1branchmult\endcsname\MTr@branchmult%
\ifMTr@triangle%
\csname MTr@child#1triangle\endcsname 1%
\else%
\csname MTr@child#1triangle\endcsname 0%
\fi
}
\def\MTr@bottomnodetrue{%
\MTr@branchmult\MTr@maxlevel%
\advance\MTr@branchmult-\MTr@level%
\advance\MTr@branchmult 1%
\ifnum\MTr@branchmult<1%
\typeout{synttree Warning: Tree has more levels than indicated.}%
\typeout{>> Indicated: \the\MTr@maxlevel.}%
\typeout{>> Level now: \the\MTr@level.}%
\MTr@branchmult1%
\fi%
\MTr@mybranchmult\MTr@branchmult%
}
\def\MTr@bottomnodefalse{%
\MTr@mybranchmult1%
}
\def\MTr@setverticalchilddimens#1{%
\MTr@tempcnta-\MTr@branchheight%
\multiply\MTr@tempcnta\MTr@childparam{#1}{branchmult}%
\MTr@tempcntb-\MTr@tempcnta%
\advance\MTr@tempcntb\csname MTr@child#1depth\endcsname%
\advance\MTr@tempcnta-\MTr@labelheight%
\advance\MTr@tempcnta\csname MTr@child#1height\endcsname%
\csname MTr@child#1y\endcsname\MTr@tempcnta%
\csname MTr@child#1picheight\endcsname\MTr@tempcntb%
}
\def\MTr@adjustdistance#1#2{%
\MTr@tempcnta\MTr@childparam{#1}{w}%
\advance\MTr@tempcnta\MTr@childsidesep%
\advance\MTr@tempcnta\csname MTr@child#2v\endcsname%
\ifnum\MTr@tempcnta<\MTr@childattachsep%
\MTr@tempcnta\MTr@childattachsep%
\fi%
\csname MTr@child#2x\endcsname\MTr@childparam{#1}{x}%
\advance\csname MTr@child#2x\endcsname\MTr@tempcnta%
}
\def\MTr@setparentdimens#1#2{%
\MTr@tempcnta\MTr@childparam{#2}{x}%
\advance \MTr@tempcnta -\MTr@childparam{#1}{x}%
\divide\MTr@tempcnta 2%
\MTr@treev\MTr@tempcnta%
\MTr@treew\MTr@treev%
\advance \MTr@treev \csname MTr@child#1x\endcsname%
\advance \MTr@treew \csname MTr@child#2w\endcsname%
\MTr@morex\MTr@labelhalfwidth%
\advance\MTr@morex-\MTr@treev%
\ifnum\MTr@morex<0\MTr@morex0\fi%
\ifnum\MTr@treew<\MTr@labelhalfwidth
\MTr@treew\MTr@labelhalfwidth
\fi%
\ifnum\MTr@treev<\MTr@labelhalfwidth
\MTr@treev\MTr@labelhalfwidth
\fi%
\MTr@picwidth\MTr@treev%
\advance\MTr@picwidth\MTr@treew%
}
\def\MTr@setpictureparameters{%
\global\MTr@treedepth\MTr@picheight%
\advance\MTr@picheight\MTr@labelheight%
\global\MTr@treeheight\MTr@labelheight%
\MTr@parenty-\MTr@labelheight%
\advance\MTr@parenty-\MTr@labeldepth%
\advance\MTr@parenty-\MTr@lineoffset%
\global\MTr@treev\MTr@treev%
\global\MTr@treew\MTr@treew%
}
\def\MTr@drawlabel{%
\put(\MTr@treev,0){%
\makebox(0,0)[t]{%
\rule{0pt}{\MTr@minheight}%
\usebox{\MTr@labelbox}}}%
}
\def\MTr@drawchild#1{%
\MTr@tempcnta\MTr@childparam{#1}{x}
\advance\MTr@tempcnta-\MTr@childparam{#1}{v}
\put(\MTr@tempcnta,\MTr@childparam{#1}{y}){%
\makebox(0,0)[tl]{%
\usebox{\csname MTr@child#1box\endcsname}}}%
}
\def\MTr@drawchildline#1{
\MTr@tempcnta\MTr@childparam{#1}{y}
\advance\MTr@tempcnta\MTr@lineoffset%
\expandafter
\ifnum\csname MTr@child#1triangle\endcsname=1%
\MTr@drawchildlinetriangle{#1}%
\else%
\MTr@drawchildlineline{#1}%
\fi%
}
\def\MTr@drawchildlineline#1{%
\put(0,0){\MTr@drawline%
(\MTr@treev,\MTr@parenty)%
(\MTr@childparam{#1}{x},\MTr@tempcnta)}%
}
\def\MTr@drawchildlinetriangle#1{%
\MTr@tempcntb\MTr@childparam{#1}{x}%
\MTr@tempcntc\MTr@tempcntb%
\advance\MTr@tempcntb \MTr@childparam{#1}{w}%
\advance\MTr@tempcntc -\MTr@childparam{#1}{v}%
\put(0,0){\MTr@drawline%
(\MTr@treev,\MTr@parenty)%
(\MTr@tempcntc,\MTr@tempcnta)}%
\put(0,0){\MTr@drawline%
(\MTr@treev,\MTr@parenty)%
(\MTr@tempcntb,\MTr@tempcnta)}%
\put(0,0){\MTr@drawline%
(\MTr@tempcntc,\MTr@tempcnta)%
(\MTr@tempcntb,\MTr@tempcnta)}%
}
\def\MTr@maketreebox{%
\MTr@labelheight\ht\MTr@labelbox%
\ifnum\MTr@labelheight<\MTr@minheight\MTr@labelheight\MTr@minheight\fi%%
\MTr@labeldepth\dp\MTr@labelbox%
\MTr@labelhalfwidth\wd\MTr@labelbox%
\divide\MTr@labelhalfwidth 2%
\ifnum\MTr@numchildren=0%
\global\setbox\MTr@treebox\hbox{\MTr@outputlabel}%
\fi%
\ifnum\MTr@numchildren>0%
\global\setbox\MTr@treebox\hbox{\MTr@outputchildren{\the\MTr@numchildren}}%
\fi%
\global\MTr@branchmult\MTr@mybranchmult%
\ifMTr@mytriangle%
\global\MTr@triangletrue%
\else%
\global\MTr@trianglefalse%
\fi%
}
\def\MTr@outputlabel{%
\global\MTr@treeheight\MTr@labelheight%
\global\MTr@treedepth\MTr@labeldepth%
\ifMTr@mytriangle%
\MTr@treew\MTr@labelhalfwidth%
\MTr@treev\MTr@labelhalfwidth%
\multiply\MTr@treew \MTr@trianglemultright%
\multiply\MTr@treev \MTr@trianglemultleft%
\divide\MTr@treew 50%
\divide\MTr@treev 50%
\global\MTr@treew\MTr@treew%
\global\MTr@treev\MTr@treev%
\else%
\global\MTr@treew\MTr@labelhalfwidth%
\global\MTr@treev\MTr@labelhalfwidth%
\fi%
\MTr@picwidth\wd\MTr@labelbox%
\MTr@picheight\MTr@treeheight%
\advance\MTr@picheight\MTr@treedepth%
\begin{picture}%
(\MTr@picwidth,\MTr@picheight)%
(-\MTr@treev,-\MTr@picheight)%
%\put(-\MTr@treev,-\MTr@picheight){\framebox(\MTr@picwidth,\MTr@picheight){}}%
\put(-\MTr@treev,0){%
\makebox(0,0)[tl]{%
\rule{0pt}{\MTr@minheight}%
\usebox{\MTr@labelbox}}}%
\end{picture}%
}
\def\MTr@outputchildren#1{%
\ifnum#1>1
\MTr@loopcnta 1
\loop
\edef\MTr@temp{\romannumeral\MTr@loopcnta}%
\ifnum\MTr@loopcnta<#1
\advance \MTr@loopcnta by 1
\MTr@adjustdistance{\MTr@temp}{\romannumeral\MTr@loopcnta}%
\repeat
\fi
\MTr@setparentdimens{i}{\romannumeral#1}%
\MTr@picheight 0%
\MTr@loopcnta #1
\loop
\edef\MTr@temp{\romannumeral\MTr@loopcnta}%
\advance\MTr@childparam{\MTr@temp}{x}\MTr@morex%
\MTr@setverticalchilddimens{\romannumeral\MTr@loopcnta}%
\ifnum\MTr@childparam{\MTr@temp}{picheight}>\MTr@picheight%
\MTr@picheight\MTr@childparam{\MTr@temp}{picheight}%
\fi%
\advance \MTr@loopcnta by -1 \ifnum\MTr@loopcnta>0 \repeat
\MTr@setpictureparameters%
\begin{picture}(\MTr@picwidth,\MTr@picheight)(0,-\MTr@picheight)%
%\put(0,-\MTr@picheight){\framebox(\MTr@picwidth,\MTr@picheight){}}%
\MTr@drawlabel%
\MTr@loopcnta #1
\loop
\expandafter\MTr@drawchild{\romannumeral\MTr@loopcnta}%
\expandafter\MTr@drawchildline{\romannumeral\MTr@loopcnta}
\advance \MTr@loopcnta by -1 \ifnum\MTr@loopcnta>0 \repeat
\end{picture}%
}
\endinput
%%
%% End of file `synttree.sty'.
|