summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/ecltree/ecltreesample.tex
blob: ef0b9746cc43ece05e5443285a537f33a7c61197 (plain)
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
\documentclass{article}
\usepackage{epic,eepic,ecltree}

\title{A tree macro}

\author{Hideki ISOZAKI\\NTT Basic Research Labs \& Stanford Univ.}

\date{Nov. 30, 1990}


\addtolength{\textwidth}{12pt}

\begin{document}

\maketitle


\section{Setup}

Include epic.sty and ecltree.sty\footnote{Electrical Communications Labs}
in your document as below:
\begin{verbatim}
\documentclass{article}
\usepackage{epic,ecltree}
\end{verbatim}
If your printer driver accepts tpic commands,
you should specify eepic.sty after epic.sty.
\begin{verbatim}
\usepackage{epic,eepic,ecltree}
\end{verbatim}
As eepic.sty redefines some macros defined in epic.sty,
Do not reverse this order.

\section{bundle environment}

A tree is drawn by {\it bundle} environment.
The {\it bundle} environment has one argument.
This argument specifies the top node label.
Leaves should be specified by \verb|\chunk| in this environment.

If you write
\begin{verbatim}
\begin{bundle}{xxx}
\chunk{aaa}
\chunk{bbb}
\chunk{ccc}
\end{bundle}
\end{verbatim}
you get
\begin{bundle}{xxx}
\chunk{aaa}
\chunk{bbb}
\chunk{ccc}
\end{bundle}.

You can nest the {\it bundle} environment.
If you write
\begin{verbatim}
\begin{bundle}{xxx}
\chunk{aaa}
\chunk{
        \begin{bundle}{yyy}
        \chunk{bbb}
        \chunk{ddd}
        \end{bundle}}
\chunk{ccc}
\end{bundle}
\end{verbatim}
you get
\begin{bundle}{xxx}
\chunk{aaa}
\chunk{
        \begin{bundle}{yyy}
        \chunk{bbb}
        \chunk{ddd}
        \end{bundle}}
\chunk{ccc}
\end{bundle}.

\section{Line attribute}

You can draw not only solid lines but also
dotted lines and dash lines.
epic.sty and eepic.sty define several commands for them.
If you want to use
\begin{verbatim}
\dashline[65]{3}(x1,y1)(x2,y2)
\end{verbatim}
to draw lines, use \verb|\drawwith| command
before (or in) the bundle environment.
\begin{verbatim}
\drawwith{\dashline[65]{3}}
\end{verbatim}

\drawwith{\dashline[65]{3}}
Then you get
\begin{bundle}{xxx}
\chunk{aaa}
\chunk{
        \begin{bundle}{yyy}
        \chunk{bbb}
        \chunk{ddd}
        \end{bundle}}
\chunk{ccc}
\end{bundle}.

The argument of \verb|\drawwith| is evaluated
at \verb|\end{bundle}|. Hence, if you write
\begin{verbatim}
\begin{bundle}{xxx}
\chunk{aaa}
\chunk{
        \begin{bundle}{yyy}
        \drawwith{\drawline}
        \chunk{bbb}
        \drawwith{\dashline[65]{3}}
        \chunk{ddd}
        \end{bundle}}
\drawwith{\dottedline{3}}
\chunk{ccc}
\end{bundle}
\end{verbatim}
you get
\begin{bundle}{xxx}
\chunk{aaa}
\chunk{
        \begin{bundle}{yyy}
        \drawwith{\drawline}
        \chunk{bbb}
        \drawwith{\dashline[65]{3}}
        \chunk{ddd}
        \end{bundle}}
\drawwith{\dottedline{3}}
\chunk{ccc}
\end{bundle}.

You can nest the \verb|\drawwith|. If you write
\begin{verbatim}
\drawwith{\drawwith{\drawwith{\dottedline{3}}\drawline}\dashline{3}}
\begin{bundle}{xxx}
\chunk{aaa}
\chunk{
        \begin{bundle}{yyy}
        \chunk{bbb}
        \chunk{ddd}
        \chunk{eee}
        \end{bundle}}
\chunk{ccc}
\chunk{fff}
\end{bundle}
\end{verbatim}
you get
\drawwith{\drawwith{\drawwith{\dottedline{3}}\drawline}\dashline{3}}
\begin{bundle}{xxx}
\chunk{aaa}
\chunk{
        \begin{bundle}{yyy}
        \chunk{bbb}
        \chunk{ddd}
        \chunk{eee}
        \end{bundle}}
\chunk{ccc}
\chunk{fff}
\end{bundle}.
Thus the nested \verb|\drawwith| is used in the reverse order.

\section{Edge labels}

You can write edge labels. They should be specified as the optional
argument of \verb|\chunk|. Note that the width of an edge label
is neglected. If you write
\drawwith{\drawline}
\begin{verbatim}
\begin{bundle}{xxx}
\chunk[left]{aaa}
\chunk{
        \begin{bundle}{yyy}
        \chunk{bbb}
        \chunk{ddd}
        \end{bundle}}
\chunk[right]{ccc}
\end{bundle}
\end{verbatim}
you get
\begin{bundle}{xxx}
\chunk[left]{aaa}
\chunk{
        \begin{bundle}{yyy}
        \chunk{bbb}
        \chunk{ddd}
        \end{bundle}}
\chunk[right]{ccc}
\end{bundle}.


\section{Spacing}

The {\it bundle} environment
has three parameters for spacing.

\begin{itemize}

\item \verb|\GapDepth| means minimum height of gaps between
adjacent nodes.

\item \verb|\GapWidth| means minimum width of gaps between
adjacent nodes.

\item \verb|\EdgeLabelSep| means height of an edge label
from the lower node of the edge.

\end{itemize}

You should set these parameters before the {\tt bundle} environment
if you dislike default values.

If you write
\begin{verbatim}
\begin{bundle}{xxx}
\chunk{aaa}
\chunk{
        \setlength{\GapDepth}{5pt}
        \setlength{\GapWidth}{5pt}
        \begin{bundle}{yyy}
        \chunk{bbb}
        \chunk{ddd}
        \end{bundle}}
\chunk{ccc}
\end{bundle}
\end{verbatim}
you get
\begin{bundle}{xxx}
\chunk{aaa}
\chunk{
        \setlength{\GapDepth}{5pt}
        \setlength{\GapWidth}{5pt}
        \begin{bundle}{yyy}
        \chunk{bbb}
        \chunk{ddd}
        \end{bundle}}
\chunk{ccc}
\end{bundle}.




\end{document}