summaryrefslogtreecommitdiff
path: root/info/translations/pst-jtree/de/08-bells.tex
blob: 35e09037adc55c9bd1def66e9baf21ba6d6aa4e4 (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
\section Glocken und Pfeifen

\vskip-1ex
\subsection {\sl baretopadjust}

Die Grundlinie einer von |\jtree...\endjtree| erstellen Box is f\"ur gew\"ohnlich die Grundlinie ihres Wurzellabels (root labels). Falls allerdings das root label leer ist, senkt es die Grundlinie zu tief ab, zumindest f\"ur meinen Geschmack. Ein Vergleich:

\bigskip
\qquad a.\quad \jtree \start {A} :{B} {C}.\endjtree
\hfil b.\quad \jtree[baretopadjust=0] \start :{B} {C}.\endjtree
\bigskip
\jTree\ nimmt die richtige Entscheidung wahr und erh\"oht das Baumdiagramm, wenn das root label leer ist, durch die Anzahl, die mit dem Parameter \index*{baretopadjust}|baretopadjust| spezifiziert wird. Die Standardeinstellung ist 1.4ex, aber man kann es einstellen, wie man will. So sieht die Standardeinstellung aus:
\bigskip
\qquad a.\quad \jtree \start {A} :{B} {C}.\endjtree
\hfil b.\quad \jtree[baretopadjust=1.4ex] \start :{B} {C}.\endjtree

\subsection {\sl treevshift}

\jTree\ also provides the parameter
\index*{treevshift}|treevshift|, which is set to 0 by default. It
is independent of |baretopadjust| and can be used to move the
tree diagram up and down, if desired.

\cd \leavevmode\raise1.2em\hbox{\tac|
$\to$\qquad
\jtree[treevshift=1.2em]
\! = {A} :{B} {C}.
\endjtree
|endtac}\hfil
$\to$\qquad
\jtree[treevshift=1.2em]
\! = {A} :{B} {C}.\endjtree
\dc

\subsection {\sl \index{everytree}}

If you say, for example,
|\psset{everytree={\psset{style=treestyle}}}|, and if you have
defined |treestyle| using PSTricks style definition, then
your trees will done in that style.  Setting |everytree| sets a
token list |\jteverytree| which is inserted at the beginning of
every |\jtree|\dots|\endjtree| construction.  It is grouped, so
that its scope is limited to the tree construction.
\smallskip
If you want, you can set |\jteverytree| directly.  The same is
true, by the way, for |everylabel|, which uses the token list
|\jteverylabel|.

\subsection \index{Custom branches}

\jTree\ ordinarily draws branches using the PSTricks macro
|\psline|.  It does this in an indirect way.  It actually calls
the macro |\branch@type| to do the drawing; and \jTree\ contains
the line |\let\branch@type=\psline|.  If the user says
|\psset{branch=\customline}|, then |\branch@type| is made
|\customline| instead of |\psline| with the usual locality. If
|\customline| is suitably defined then it will be
used to draw branches.  A few alternative macros for drawing
branches are included in \jTree.  The enterprising user might
want to define appropriate zigzag or coil macros, following the
PSTricks model.  \jTree\ provides |\blank|, |\brokenbranch|, and
|\etcbranch|.\index*{branch}\index*{+blank}\index*{+brokenbranch}%,
\index*{+etcbranch}

\cd \tac|
\jtree[xunit=3em,yunit=2em]
\! = {root}
<left>[branch=\blank]{A}
^<right>[branch=\brokenbranch]{B}
<right>[branch=\etcbranch].
\endjtree
|endtac \qquad\hfil
\jtree[xunit=3em,yunit=2em] \start {root}
<left>[branch=\blank]{A} ^<right>[branch=\brokenbranch]{B}
<right>[branch=\etcbranch].
\endjtree
\dc

The proportion of the ``etc branch'' that is dotted is controlled
by a parameter index*{etcratio}|etcratio|.  \jTree\ says |\psset{etcratio=.75}|,
but the user is free to change this if desired.  The style for
the dotted portion is defined by
\medskip
\quad|\newpsstyle{etc}{nodesepB=0,nodesepA=1pt,linestyle=dotted,|\par
\qquad |linewidth=1.2pt,dotsep=2pt}|
\medskip
The user can change (i.e. overwrite) this, if desired.

\jTree\ has the macro definition:
\medskip
\quad |\def\etc{[branch=\etcbranch,scaleby=.7]}|
\medskip
So you can write:

\cd \tac|
\jtree \! = :{A} :{B}
   <left>{C} ^<right>\etc.
\endjtree
|endtac \hfil
\jtree \! = :{A} :{B} <left>{C} ^<right>\etc.
\endjtree
\dc


\subsection The pseudo-parameters {\sl dirA\/} and {\sl dirB}

\everymath={}%
%
\index*{dirA, dirB}%
Suppose, for example, that you want to use |\nccurve| to draw a
curve which leaves the point A in a direction towards the point
which is displaced from A by $(1,-2)$ (ps-units).  You need to
set |angleA| to the appropriate value.  This is complicated,
because the x-scale and the y-scale may be different.  The
pseudo-parameter |dirA| is provided to accomplish this.
\hbox{|\psset{dirA=(1:-2)}|} will cause |angleA| to be set to the
appropriate value.  It is called a pseudo-parameter (my
terminology) because
\hbox{|\psset{dirA=(1:-2)}|} is executed for its effect on the parameter
|angleA|, not |dirA|.  Note the use of the colon, which keeps
|\psset| from getting confused.
\smallskip
Use of |dirA| below ensures that the ``curved branch'' lines up
with the straight ones.  Note that the curve is made fairly stiff
(a high value of |ncurv|) so that it bows out sufficiently.

\cd \tac|
\jtree
\! = @A1 <right> :{B} :{C} {D}@A2 .
\nccurve[dirA=(-1:-1),angleB=200,
   ncurv=2,nodesepB=.5ex]{A1}{A2}
\endjtree
|endtac \hfill
\jtree \! = @A1 <right> :{B} :{C} {D}@A2 .
\nccurve[dirA=(-1:-1),angleB=200,
   ncurv=2,nodesepB=.5ex]{A1}{A2}
\endjtree\kern1em
\dc

Of course, |dirB| works the same way for |angleB|.

\def\andthen{\kern1pt:\enspace}

\endinput

\subsection Complete list of \jTree\ parameters

|labelgapt|, |labelgapb|, |labelgap|\andthen The center of the
top of the label box is placed a distance |labelgapt| below the
previous termination point.  The termination point of the label
box is placed a distance |labelgapb| below the bottom edge of the
label box. |labelgap| is a pseudo-parameter, used for its effect.
|\psset{labelgap=�x\/�}| has the effect
|\psset{labelgapt=�x\/�,labelgapb=�x\/�}|.

\medskip
|scaleby|\andthen |\psset{scaleby=�x\enspace y\/�}| has the effect
of scaling all branches, triangles, and vartriangles by {\sl x\/}
horizontally and {\sl y\/} vertically.  If {\sl y\/} is omitted,
scaling by {\sl x\/} in both directions is carried out.

\medskip
|everytree|\andthen
The effect of
|\psset{everytree=�$\alpha$�}| is
|\jteverytree={�$\alpha$�}|.  This token list is inserted every
time that |\jtree| is invoked.

\medskip
|everylabel|\andthen
The effect of
|\psset{everylabel=�$\alpha$�}| is
|\jteverylabel={�$\alpha$�}|.  This token list is inserted every
time that a label box is created, unless cancelled by |\omit|.

\medskip
|treevshift|, |baretopadjust|\thinspace:\enspace These parameters
control the relation between the baseline of the assembled tree
and the baseline of the root label.  The baseline of the root
label is a distance $\sl d=v+b\mskip2mu$ above the baseline of
the tree, where $\sl v$ is |treevshift|; and $\sl b$ is
|baretopadjust| if the root label has 0 height, otherwise is~0.

\medskip
|triratio|\andthen This determines the termination point of
triangles, and the skew of vartriangles.  See Chapter~5 for
discussion.

\medskip
|branch|\andthen The control sequence |\branch@type| is used to
draw the connections in branches.  {\sl pst-jtree\/} contains
|\let\branch@type=\psline|.  The effect of
|\psset{branch=\usermacro}| is |\let\branch@type=\usermacro|. It
is assumed that |\usermacro| has the argument structure\smallskip
\hfil|\def\usermacro(#1,#2)(#3,#4){|\dots
\smallskip

\medskip
|etcratio|\andthen {\sl pst-jtree\/} provides the macro
|\etcbranch| as an alternative to |\psline|.  It draws a line
which begins as a solid line but ends as a dotted line.  Its use
is to indicate an elided tree tail.  |etcratio| determines what
fraction of the line is dotted.

\medskip
|dirA|, |dirB|\andthen These are pseudo-parameters, used to set
the parameters |angleA| and |angleB|, respectively.
|\psset{dirA=(�a\/�:�b\/�)}| sets angleA so that
the direction corresponding to angleA is the same as the
direction corresponding to the vector $\sl\langle a,b\rangle$.
Setting |dirB| has a similar effect on |angleB|.