Debian Codegraph @

texmf-dist/doc/latex/ecltree/ecltreesample.tex

raw
1 \documentclass{article}
2 \usepackage{epic,eepic,ecltree}
3
4 \title{A tree macro}
5
6 \author{Hideki ISOZAKI\\NTT Basic Research Labs \& Stanford Univ.}
7
8 \date{Nov. 30, 1990}
9
10
11 \addtolength{\textwidth}{12pt}
12
13 \begin{document}
14
15 \maketitle
16
17
18 \section{Setup}
19
20 Include epic.sty and ecltree.sty\footnote{Electrical Communications Labs}
21 in your document as below:
22 \begin{verbatim}
23 \documentclass{article}
24 \usepackage{epic,ecltree}
25 \end{verbatim}
26 If your printer driver accepts tpic commands,
27 you should specify eepic.sty after epic.sty.
28 \begin{verbatim}
29 \usepackage{epic,eepic,ecltree}
30 \end{verbatim}
31 As eepic.sty redefines some macros defined in epic.sty,
32 Do not reverse this order.
33
34 \section{bundle environment}
35
36 A tree is drawn by {\it bundle} environment.
37 The {\it bundle} environment has one argument.
38 This argument specifies the top node label.
39 Leaves should be specified by \verb|\chunk| in this environment.
40
41 If you write
42 \begin{verbatim}
43 \begin{bundle}{xxx}
44 \chunk{aaa}
45 \chunk{bbb}
46 \chunk{ccc}
47 \end{bundle}
48 \end{verbatim}
49 you get
50 \begin{bundle}{xxx}
51 \chunk{aaa}
52 \chunk{bbb}
53 \chunk{ccc}
54 \end{bundle}.
55
56 You can nest the {\it bundle} environment.
57 If you write
58 \begin{verbatim}
59 \begin{bundle}{xxx}
60 \chunk{aaa}
61 \chunk{
62 \begin{bundle}{yyy}
63 \chunk{bbb}
64 \chunk{ddd}
65 \end{bundle}}
66 \chunk{ccc}
67 \end{bundle}
68 \end{verbatim}
69 you get
70 \begin{bundle}{xxx}
71 \chunk{aaa}
72 \chunk{
73 \begin{bundle}{yyy}
74 \chunk{bbb}
75 \chunk{ddd}
76 \end{bundle}}
77 \chunk{ccc}
78 \end{bundle}.
79
80 \section{Line attribute}
81
82 You can draw not only solid lines but also
83 dotted lines and dash lines.
84 epic.sty and eepic.sty define several commands for them.
85 If you want to use
86 \begin{verbatim}
87 \dashline[65]{3}(x1,y1)(x2,y2)
88 \end{verbatim}
89 to draw lines, use \verb|\drawwith| command
90 before (or in) the bundle environment.
91 \begin{verbatim}
92 \drawwith{\dashline[65]{3}}
93 \end{verbatim}
94
95 \drawwith{\dashline[65]{3}}
96 Then you get
97 \begin{bundle}{xxx}
98 \chunk{aaa}
99 \chunk{
100 \begin{bundle}{yyy}
101 \chunk{bbb}
102 \chunk{ddd}
103 \end{bundle}}
104 \chunk{ccc}
105 \end{bundle}.
106
107 The argument of \verb|\drawwith| is evaluated
108 at \verb|\end{bundle}|. Hence, if you write
109 \begin{verbatim}
110 \begin{bundle}{xxx}
111 \chunk{aaa}
112 \chunk{
113 \begin{bundle}{yyy}
114 \drawwith{\drawline}
115 \chunk{bbb}
116 \drawwith{\dashline[65]{3}}
117 \chunk{ddd}
118 \end{bundle}}
119 \drawwith{\dottedline{3}}
120 \chunk{ccc}
121 \end{bundle}
122 \end{verbatim}
123 you get
124 \begin{bundle}{xxx}
125 \chunk{aaa}
126 \chunk{
127 \begin{bundle}{yyy}
128 \drawwith{\drawline}
129 \chunk{bbb}
130 \drawwith{\dashline[65]{3}}
131 \chunk{ddd}
132 \end{bundle}}
133 \drawwith{\dottedline{3}}
134 \chunk{ccc}
135 \end{bundle}.
136
137 You can nest the \verb|\drawwith|. If you write
138 \begin{verbatim}
139 \drawwith{\drawwith{\drawwith{\dottedline{3}}\drawline}\dashline{3}}
140 \begin{bundle}{xxx}
141 \chunk{aaa}
142 \chunk{
143 \begin{bundle}{yyy}
144 \chunk{bbb}
145 \chunk{ddd}
146 \chunk{eee}
147 \end{bundle}}
148 \chunk{ccc}
149 \chunk{fff}
150 \end{bundle}
151 \end{verbatim}
152 you get
153 \drawwith{\drawwith{\drawwith{\dottedline{3}}\drawline}\dashline{3}}
154 \begin{bundle}{xxx}
155 \chunk{aaa}
156 \chunk{
157 \begin{bundle}{yyy}
158 \chunk{bbb}
159 \chunk{ddd}
160 \chunk{eee}
161 \end{bundle}}
162 \chunk{ccc}
163 \chunk{fff}
164 \end{bundle}.
165 Thus the nested \verb|\drawwith| is used in the reverse order.
166
167 \section{Edge labels}
168
169 You can write edge labels. They should be specified as the optional
170 argument of \verb|\chunk|. Note that the width of an edge label
171 is neglected. If you write
172 \drawwith{\drawline}
173 \begin{verbatim}
174 \begin{bundle}{xxx}
175 \chunk[left]{aaa}
176 \chunk{
177 \begin{bundle}{yyy}
178 \chunk{bbb}
179 \chunk{ddd}
180 \end{bundle}}
181 \chunk[right]{ccc}
182 \end{bundle}
183 \end{verbatim}
184 you get
185 \begin{bundle}{xxx}
186 \chunk[left]{aaa}
187 \chunk{
188 \begin{bundle}{yyy}
189 \chunk{bbb}
190 \chunk{ddd}
191 \end{bundle}}
192 \chunk[right]{ccc}
193 \end{bundle}.
194
195
196 \section{Spacing}
197
198 The {\it bundle} environment
199 has three parameters for spacing.
200
201 \begin{itemize}
202
203 \item \verb|\GapDepth| means minimum height of gaps between
204 adjacent nodes.
205
206 \item \verb|\GapWidth| means minimum width of gaps between
207 adjacent nodes.
208
209 \item \verb|\EdgeLabelSep| means height of an edge label
210 from the lower node of the edge.
211
212 \end{itemize}
213
214 You should set these parameters before the {\tt bundle} environment
215 if you dislike default values.
216
217 If you write
218 \begin{verbatim}
219 \begin{bundle}{xxx}
220 \chunk{aaa}
221 \chunk{
222 \setlength{\GapDepth}{5pt}
223 \setlength{\GapWidth}{5pt}
224 \begin{bundle}{yyy}
225 \chunk{bbb}
226 \chunk{ddd}
227 \end{bundle}}
228 \chunk{ccc}
229 \end{bundle}
230 \end{verbatim}
231 you get
232 \begin{bundle}{xxx}
233 \chunk{aaa}
234 \chunk{
235 \setlength{\GapDepth}{5pt}
236 \setlength{\GapWidth}{5pt}
237 \begin{bundle}{yyy}
238 \chunk{bbb}
239 \chunk{ddd}
240 \end{bundle}}
241 \chunk{ccc}
242 \end{bundle}.
243
244
245
246
247 \end{document}
248