summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/adtrees/adtreesdoc.tex
blob: d835371065e8004b2a0b8d01abe3b56a34ad6d31 (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
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
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
\documentclass{amsart}
\usepackage{amssymb}
\usepackage{color}
\usepackage{graphics}
\usepackage{adtrees}
\usepackage{url}

\begin{document}
\title{Adpositional Trees in \LaTeX}
\date{}
\author[Marco Benini]{Marco Benini}
\address[Marco Benini]{Dipartimento di Scienza e Alta Tecnologia\\ 
  Universit\`a degli Studi dell'Insubria\\
  via Valleggio 11, I-22100 Como, Italy}
\email{marco.benini@uninsubria.it}
\urladdr{http://marcobenini.wordpress.com}
\author[Federico Gobbo]{Federico Gobbo}
\address[Federico Gobbo]{Faculty of Humanities\\
  University of Amsterdam\\ 
  Spuistraat 210,NL-1012VT Amsterdam, The Netherlands}
\email{F.Gobbo@uva.nl}
\urladdr{http://federicogobbo.name}
\maketitle

% --------------------------
\section{Introduction}\label{sec:introduction}
Adpositional trees (adtrees, for short) are a formal way to represent
expressions in natural language. They have been defined, used, and
discussed in F.~Gobbo and M.~Benini, \textit{Constructive Adpositional
  Grammars: Foundations of Constructive Linguistics}, Cambridge
Scholar Press (2011). Since then, they have been used without
theoretical modifications in a number of applications.

This document describes the \LaTeX\/ package to draw adtrees. This
package is an improvement over the original one used to typeset all
the examples in the previously cited book. The present package
maintains the same graphical presentation with a number of
improvements, and an incompatible syntax. Also, the original package,
although never distributed, is no longer maintained.

This document describes all the features of the package. It is written
so that a user may start typesetting adtrees as soon as possible: all
the fundamental commands and macros are presented in
Section~\ref{sec:simple}. At the first reading, the subsequent
sections may be freely skipped.

Section~\ref{sec:centring} describes the next obvious step: how to put
an adtree inside your document, controlling the way to align it with
other objects. Section~\ref{sec:complex} explains how to control the
length of branches via the \verb|\unitlength| value. It also
introduces the variants of the fundamental commands to modify the
lengths of the branches in the adtree, the angle between them, or
both, either globally, locally, or recursively.

Section~\ref{sec:internal} describes the low-level definitions that
affect the construction of the various pieces composing
adtrees. Changing these definitions is intended for advanced users,
who want to modify the standard appearance of
adtrees. Section~\ref{sec:hints} concludes the description of the
graphical package, showing some special techniques to deal with
adtrees, and a couple of very low-level primitives of the package.

The final Section~\ref{sec:linear} describes the way to render adtrees
in a linear format. This is a minor feature which we discourage to
use, except for very special purposes.

% --------------------------
\section{Simple Adtrees}\label{sec:simple}
The installation of the package is standard: see the documentation on
your particular \TeX\/ system for the details. Using the package in a
document requires it to be invoked with
\verb|\usepackage{adtrees}|.\vspace{1.5ex}

The simplest adtree is composed by a single morpheme:
\begin{equation*}
  \ATm{Liza}{O}
\end{equation*}
which has been typeset by the command 
\begin{verbatim}
    \ATm{Liza}{O}
\end{verbatim}

Sometimes, a morpheme requires to specify attributes:
\begin{equation*}
  \ATm{Liza}{O}[proper noun][animated]
\end{equation*}
this behaviour is accomplished by the command
\begin{verbatim}
    \ATm{Liza}{O}[proper noun][animated]
\end{verbatim}

The general form of the \verb|\ATm| command is 
\begin{equation*}
  \verb|\ATm{| m \verb|}{| g \verb|}[| a_1 \verb|]| \cdots \verb|[|
    a_n \verb|]|
\end{equation*}
with $m$ the morpheme, $g$ its grammar character, and $a_1, \dots,
a_n$ its attributes, if any.  The attributes are optional, and there
can be any number of them. Also, notice how all the commands in the
package start with \verb|\AT|: the final \verb|m| stands for
\emph{morpheme}. This is a general naming rule: all the fundamental
command have the form \verb|\AT| followed by a single letter which
reminds its function. Variants of the fundamental commands use a
two-letter code, the first letter being the same as the fundamental
command, and the second letter reminding the variant.

% --------------------------
\subsection{Complex Adtrees}\label{subsec:complex}
A complex adtree is made by two adtrees, composed via an
\emph{adposition}, which is described by a morpheme together with the
grammar character of the resulting adtree, and the
\emph{trajectory}. The trajectory is an arrow, and it can be
$\leftarrow$, $\rightarrow$, or $\leftrightarrow$. The following three
examples are very similar to the ones in Figure 2.11 of Gobbo and
Benini (2011:24):
\begin{equation*}
  \ATr{to}{I_2^2}
  {\ATm{Kim}{O_2}}
  {\ATs{The box belongs}{I_1^2}}
  \qquad
  \ATl{$\epsilon$}{I_2^2}
  {\ATs{the box}{O_2}}
  {\ATs{Kim owns}{I_1^2}}
  \qquad 
  \ATb{on}{E>I_1^1}
  {\ATs{the box}{O}}
  {\ATs{Kim jumps}{I_1^1}}
\end{equation*}

These adtrees are typeset, respectively, by the commands
\begin{verbatim}
    \ATr{to}{I_2^2}
    {\ATm{Kim}{O_2}}
    {\ATs{The box belongs}{I_1^2}}

    \ATl{$\epsilon$}{I_2^2}
    {\ATm{the box}{O_2}}
    {\ATs{Kim owns}{I_1^2}}

    \ATb{on}{E>I_1^1}
    {\ATs{the box}{O_2}}
    {\ATs{Kim jumps}{I_1^1}}
\end{verbatim}\vspace{1.5ex}

The general format of these commands is
\begin{equation*}
  c \verb|{| a \verb|}{| g \verb|}[| x_1 \verb|]| \dots \verb|[| x_n 
  \verb|]{| L \verb|}{| R \verb|}|
\end{equation*}
with $c$ among \verb|\ATl|, \verb|ATr|, \verb|\ATb|; $a$ the
adposition: $g$ the grammar character of the whole construction; $x_1,
\dots, x_n$ the optional attributes of the construction; $L$ the left
adtree; and $R$ the right adtree. The adposition is typeset as normal
text, the grammar character in math mode with the roman typeface, so
that super- and sub-scripts can be freely used, and the trajectory is
defined by the command: \verb|\ATl| for the \emph{left} arrow,
\verb|\ATr| for the \emph{right} arrow, and \verb|\ATb| for the arrow
in \emph{both} direction, following the general naming rule.  The
attributes are optional and they are typeset as in the morpheme
construction.\vspace{1.5ex}

Actually, the \verb|\ATm| command is used to typeset proper morphemes,
while the \verb|\ATs| command is designed to typeset expressions which
can be expanded into an adtree. In fact, the \verb|s| letter stands
for \emph{summary}, following the general naming rule. The \verb|\ATs|
command has the same syntax as the \verb|\ATm| command, and it differs
just in the graphical appearance. So, it may take an arbitrary number
of attributes, and whatever applies to \verb|\ATm| holds for
\verb|\ATs|, too.

% --------------------------
\subsection{Epsilon Adpositions}\label{subsec:epsilon}
Since writing adtrees with the empty adposition, represented by the
$\epsilon$ symbol, is very common, the following commands are
provided: \verb|\ATle|, \verb|\ATre|, and \verb|\ATbe|, with \verb|e|
standing for \emph{empty} in the general naming convention. They
behave as the command without the trailing \verb|e|, but the
adposition is automatically typeset. Also, they share the same
syntax. So, the previous example
\begin{equation*}
  \ATle{I_2^2}
  {\ATs{the box}{O}}
  {\ATs{Kim owns}{I_1^2}}
\end{equation*}
can be typeset in a simplified way as
\begin{verbatim}
    \ATle{I_2^2}
    {\ATs{the box}{O}}
    {\ATs{Kim owns}{I_1^2}}
\end{verbatim}\vspace{1.5ex}

Similarly, because the so-called epsilon-transformations are common,
and they require to forget about adpositions and morphemes, which is
graphically marked by cancelling them with a stroke, the package
automatically includes the \verb|cancel| package by Donald Arseneau,
(available in CTAN, at
\url{http://mirror.ctan.org/macros/latex/contrib/cancel}). In
addition, to simplify the cancellation of empty adpositions, the
commands \verb|\ATrc| \verb|\ATlc| \verb|\ATbc| are provided, with
\verb|c| standing for \emph{cancel ed}. They work as their
counterparts with the trailing \verb|e|, sharing the same syntax. For
example,
\begin{equation*}
  \ATlc{I_2^2}
  {\ATs{\cancel{the apple}}{O}}
  {\ATs{Kim eats}{I_1^2}}
\end{equation*}
has been typeset by
\begin{verbatim}
    \ATlc{I_2^2}
    {\ATs{\cancel{the apple}}{O}}
    {\ATs{Kim eats}{I_1^2}}
\end{verbatim}

% --------------------------
\subsection{Overlapping subtrees}\label{subsec:overlapping}
When one has to write complex adtrees, it is often the case that there
are overlapping subtrees. To cope with these situations, the simplest
way is to prolong the left or the right branch of a node. This
behaviour can be accomplished with the \verb|\ATxl| and \verb|\ATxr|
commands, where \verb|x| stands for \emph{extends} and \verb|l| and
\verb|r| for \emph{left} and \emph{right}, respectively. They both
take a single argument which is the adtree being appended at the end
of the extended branch.  For example, the following adtree, similar to
the one in Figure~2.16 (Gobbo and Benini 2011:29):
\begin{equation*} 
  \unitlength.23ex
  \ATl{with}{I^3_3}[phrase]
  {\ATs{the key}{O}}
  {\ATre{I^3_2}
    {\ATxl{\ATs{the door}{O_2}}}
    {\ATs{will be opened}{I^3}}}
\end{equation*}
has been typeset by the following \LaTeX\/ code
\begin{verbatim}
    \ATl{with}{I^3_3}[phrase]
    {\ATs{the key}{O_3}}
    {\ATre{I^3_2}
      {\ATxl{\ATs{the door}{O_2}}}
      {\ATs{will be opened}{I^3}}}
\end{verbatim}

The example also shows how to put an attribute in the top adposition.
Normally, for reasons of space, adtrees use extensively summaries to
put in evidence only the linguistic phenomenon needed in that
moment. For example, the following adtree:
\begin{equation*} 
  \ATl{with}{I^3_3}
  {\ATs{the key}{O_3}}
  {\ATxr{\ATs{the door will be opened}{I^3_2}}}
\end{equation*}
has been typeset by the following \LaTeX\/ code
\begin{verbatim}
    \ATl{with}{I^3_3}
      {\ATs{the key}{O_3}}
      {\ATxr{\ATs{the door will be opened}{I^3_2}}}
\end{verbatim}
The example also shows a right-branch extension. Overlapping can be
also avoided in complex adtrees using advanced commands. See Section
\ref{sec:complex} for details.

% --------------------------
\subsection{Morphological adpositions}\label{subsec:mu}
Sometimes, for the sake of clarity, morphological relations should be
stated explicitly. For example, the following adtree:
\begin{equation*} 
  \unitlength.2ex
  \ATr{-ly}{E>I^3_2}
  {\ATm{quick-}{A}}
  {\ATre{I^3_2}
    {\ATxl{\ATs{the door}{O_2}}}
    {\ATs{will be opened}{I^3}}}
\end{equation*}
which has been typeset by the following \LaTeX\/ code
\begin{verbatim}
    \ATr{-ly}{E>I^3_2}
    {\ATm{quick-}{A}}
    {\ATre{I^3_2}
      {\ATxl{\ATs{the door}{O_2}}}
      {\ATs{will be opened}{I^3}}}
\end{verbatim}
could be made explicit, where the $\mu$ adposition indicates a
morphological relation. For example, the following adtree is
linguistically equivalent to the previous one:
\begin{equation*} 
  \unitlength.2ex
  \ATle{I^3_2}
  {\ATxl{\ATxl{\ATrmu{E}
        {\ATm{-ly}{E}}
        {\ATm{quick-}{A}}}}}
  {\ATre{I^3_2}
    {\ATxl{\ATs{the door}{O_2}}}
    {\ATs{will be opened}{I^3}}}
\end{equation*}
and it has been typeset by the following \LaTeX\/ code
\begin{verbatim}
    \ATle{I^3_2}
    {\ATxl{\ATxl{\ATrmu{E}
          {\ATm{-ly}{E}}
          {\ATm{quick-}{A}}}}}
    {\ATre{I^3_2}
      {\ATxl{\ATs{the door}{O_2}}}
      {\ATs{will be opened}{I^3}}}
\end{verbatim}
The package provides the commands \verb|\ATlmu|, \verb|\ATrmu|, and
\verb|\ATbmu|, analogous to the $\epsilon$ variants, to simplify the
typesetting of adtrees using the $\mu$ adposition.

% --------------------------
\section{Alignments and Centring}\label{sec:centring}
Drawing an adtree in a display is the simplest and most common way:
\begin{equation*}
  \ATl{with}{I^3_3}
  {\ATs{the key}{O_3}}
  {\ATre{I^3_2}
    {\ATxl{\ATs{the door}{O_2}}}
    {\ATs{will be opened}{I^3}}}
\end{equation*}
is generated by the following code
\begin{verbatim}
    \begin{equation*}
      \ATl{with}{I^3_3}
        {\ATs{the key}{O_3}}
        {\ATre{I^3_2}
          {\ATxl{\ATs{the door}{O_2}}}} 
          {\ATs{will be opened}{I^3}}}
    \end{equation*}
\end{verbatim}\vspace{1.5ex}

Putting an adtree in a figure environment reduces to write the
corresponding \LaTeX\/ display inside the content of the \verb|figure|
environment.

In general, we strongly encourages the user to use a robust display
environment, like \verb|equation*| or \verb|displaymath|, and to avoid
the \verb|center| environment. Advanced displays to align mathematical
material, as in AMS-\TeX\/, are another good and reliable option to
place adtrees in a page.\vspace{1.5ex}

An adtree fits exactly its enclosing box, that is
\begin{equation*}
  \fboxsep0pt
  \unitlength.3ex
    \fbox{\ATl{with}{I^3_3}
    {\ATs{the key}{O_3}}
    {\ATre{I^3_2}
      {\ATxl{\ATbe{O_2}{\ATm{the}{A}}{\ATm{door}{O}}}}
      {\ATs{will be opened}{I^3}}}}
\end{equation*}
If one looks closely (and that is why the adtree is so big), there is
half of the point in the root which lies outside the box. This is done
on purpose, to make easier to collate together adtrees.\vspace{1.5ex}

Writing a morpheme or a summary directly inside the text, like
\ATm{Gargoyle}{O}, produces a box whose baseline is exactly the
baseline of the morpheme. This makes the behaviour predictable, even
if the graphical appearance is quite terrible (like in this
paragraph). An adtree, like \ATre{I_2^2} {\ATm{the box}{O_2}}
{\ATbe{I_1^2}{\ATm{Kim}{O_1}}{\ATs{owns}{I^2}}}, behaves similarly,
because the baseline of the box is the baseline of the lowest morpheme
or summary in the whole tree, the one corresponding to the \emph{owns}
morpheme in the example.

So, at least in principle, since the user can rely on the size of the
enclosing box, and on the position of the baseline, it is possible to
align an adtree in whatever way one may desire. In our experience, the
only really common way one requires to move adtrees in the surrounding
text is to centre them: the package provides three commands to centre
an adtree horizontally, vertically, or both. These are
\verb|\ATvcentre|, \verb|\AThcentre|, and \verb|\ATcentre|,
respectively. For example
\begin{equation*}
  \ATvcentre{\ATl{with}{I^3_3}
    {\ATs{the key}{O_3}}
    {\ATre{I^3_2}
      {\ATxl{\ATs{the door}{O_2}}}
      {\ATs{will be opened}{I^3}}}} 
  \mathbin{\equiv}
  \ATvcentre{\ATl{with}{I^3_3}
    {\ATs{the key}{O_3}}
    {\ATre{I^3_2}
      {\ATs{the door}{O_2}}
      {\ATxr{\ATs{will be opened}{I^3}}}}}
\end{equation*}
has been generated by
\begin{verbatim}
    \ATvcentre{\ATl{with}{I^3_3}
      {\ATs{the key}{O_3}}
      {\ATre{I^3_2}
        {\ATxl{\ATs{the door}{O_2}}}
        {\ATs{will be opened}{I^3}}}} 
    \mathbin{\equiv}
    \ATvcentre{\ATl{with}{I^3_3}
      {\ATs{the key}{O_3}}
      {\ATre{I^3_2}
        {\ATs{the door}{O_2}}
      {\ATxr{\ATs{will be opened}{I^3}}}}}
\end{verbatim}

More sophisticated ways to place an adtree in the page are discussed
in Section~\ref{sec:hints}.

% --------------------------
\section{Dealing with Complex Adtrees}\label{sec:complex}
Simple adtrees are easily typeset using the previously described
commands. But, sooner or later, one has to typeset a complex adtree,
which does not fit into the page, or whose branches overlap, no matter
how we extend branches, or which looks awful because of a poor choice
of dimensions. In all these cases, there are a number of strategies
one may adopt.\vspace{1.5ex}

The simplest and crudest one is to change the length of branches. In
this respect, branches are drawn using the \LaTeX\/ \verb|picture|
environment, so the length of each branch is
$25\verb|\unitlength|$. The value of \verb|\unitlength| may be changed
globally, affecting the way all subsequent adtrees in a document are
typeset. Also, the value may be changed inside a surrounding group,
which affects only the adtree to be typeset, but not the rest of the
document. Finally, the value of \verb|\unitlength| can be changed
within the adtree, to affect the point where the change appears and
all the subtrees. Notice how there is no way to directly change the
value of \verb|\unitlength| in a single node: we will return on this
point later.

For example,
\begin{equation*}
  {\unitlength.3ex
    \ATl{with}{I^3_3}
    {\ATs{the key}{O_3}}
    {\ATre{I^3_2}
      {\ATs{the door}{O_2}}
      {\ATs{will be opened}{I^3}}} }
\end{equation*}
has been typeset by
\begin{verbatim}
      {\unitlength.3ex
        \ATl{with}{I^3_3}
        {\ATs{the key}{O_3}}
        {\ATre{I^3_2}
          {\ATs{the door}{O_2}}
          {\ATs{will be opened}{I^3}}} }
\end{verbatim}
adopting the strategy to affect all the branches in the adtree. Notice
how the outermost braces limit the scope of the change to the value of
\verb|\unitlength|.

On the contrary,
\begin{equation*}
  \ATl{with}{I^3_3}
  {\unitlength.12ex\ATxl{\ATbe{O_3}
    {\ATm{the}{A}}
    {\ATm{key}{O}}}}
  {\unitlength.33ex\ATre{I^3_2}
    {\ATs{the door}{O_2}}
    {\ATs{will be opened}{I^3}}}
\end{equation*}
modifies the length of all the branches in the left subtree to
\verb|3ex| (since $3 = 25 \cdot 0.12$), and to \verb|8.25ex| in the
right subtree
\begin{verbatim}
    \ATl{with}{I^3_3}
    {\unitlength.12ex\ATxl{\ATbe{O_3}
      {\ATm{the}{A}}
      {\ATm{key}{O}}}}
    {\unitlength.33ex\ATre{I^3_2}
      {\ATs{the door}{O_2}}
      {\ATs{will be opened}{I^3}}}
\end{verbatim}

The adposition, and the related arrow and grammar character are moved
accordingly, which is not pleasant in this example, although it is
what one usually wants when changing the value of \verb|\unitlength|
in the whole adtree. 

The right way to have the adposition always in the same place with
respect to the branches in a node, is to fix a suitable
\verb|\unitlength| for the whole adtree, and to extend locally, just
in the single node, its value. The exact technique is a bit complex,
and it will be explained by an example later. Usually, there is no
need to cope with these minor details, except for maniacs or for high
precision works.\vspace{1.5ex}

The length of branches can be changed locally to a single node,
without recursively affecting the subtrees, as it happens when we
change the value of \verb|\unitlength| inside a node, like in the
latest example. This can be achieved using the length variant of the
adtree drawing commands. There are also an angle variant, and a
variant affecting both the length and the angle.

The complete list of complex adtree drawing commands, with all the
variants is:
\begin{center}
  \begin{tabular}{cccc}\renewcommand{\arraystretch}{1.3}
    \textbf{base command} & \textbf{length variant} & \textbf{angle
      variant} & \textbf{combined variant}\\ 
    \hline\hline
    \multicolumn{4}{c}{{\huge\strut}\emph{plain adtrees}}\\
    \verb|\ATl| & \verb|\ATlL| & \verb|\ATlA| & \verb|\ATlLA|\\
    \verb|\ATr| & \verb|\ATrL| & \verb|\ATrA| & \verb|\ATrLA|\\
    \verb|\ATb| & \verb|\ATbL| & \verb|\ATbA| & \verb|\ATbLA|\\
    \hline
    \multicolumn{4}{c}{{\huge\strut}\emph{extensions}}\\
    \verb|\ATxl| & \verb|\ATxlL| & \verb|\ATxlA| & \verb|\ATxlLA|\\
    \verb|\ATxr| & \verb|\ATxrL| & \verb|\ATxrA| & \verb|\ATxrLA|\\
    \hline
    \multicolumn{4}{c}{{\huge\strut}\emph{adtrees with special
        adpositions}}\\ 
    \verb|\ATle| & \verb|\ATleL| & \verb|\ATleA| & \verb|\ATleLA|\\
    \verb|\ATlc| & \verb|\ATlcL| & \verb|\ATlcA| & \verb|\ATlcLA|\\
    \verb|\ATlmu| & \verb|\ATlmuL| & \verb|\ATlmuA| & \verb|\ATlmuLA|\\ 
    \verb|\ATre| & \verb|\ATreL| & \verb|\ATreA| & \verb|\ATreLA|\\
    \verb|\ATrc| & \verb|\ATrcL| & \verb|\ATrcA| & \verb|\ATrcLA|\\
    \verb|\ATrmu| & \verb|\ATrmuL| & \verb|\ATrmuA| & \verb|\ATrmuLA|\\ 
    \verb|\ATbe| & \verb|\ATbeL| & \verb|\ATbeA| & \verb|\ATbeLA|\\
    \verb|\ATbc| & \verb|\ATbcL| & \verb|\ATbcA| & \verb|\ATbcLA|\\
    \verb|\ATbmu| & \verb|\ATbmuL| & \verb|\ATbmuA| & \verb|\ATbmuLA|\\ 
    \hline
  \end{tabular}
\end{center}
The names of these commands are easy to remember: the length variant
has a trailing \verb|L|, the angle variant a trailing \verb|A|, and
the combined variant a trailing \verb|LA|.  

The syntax of the length variant is the same as the base command
except that there is an additional argument, the first one, which
contains the value for the local \verb|\unitlength|. In fact, the
length we specify has exactly the same effect of changing
\verb|\unitlength| just before the command, but the change does not
apply recursively.

It is worth remarking that, e.g., \verb|\ATlL{\unitlength}| is
equivalent to \verb|\ATl|, so to reduce the length of branches to
$90\%$ of their current value, it suffices the write something like
\verb|\ATrL{.9\unitlength}|.

Similarly, the syntax of the angle variant requires an additional
first argument which can be $60$, $90$, or $120$, representing the
angle between the branches: the default is $60$ degrees. Specifying
any other values resorts to the default.  

The combined variant requires two additional arguments, the length and
the angle, in this order, before any other parameter.

A hidden, very technical, feature of the package is that, whatever
follows the length in the \verb|L| argument gets evaluated inside the
group which generates the branches in the node. So, for those well
inside \LaTeX\/ mysteries, this feature can be used to tweak the
behaviour of the graphical engine.\vspace{1.5ex}

For example,
\begin{equation*}
  \ATlL{.4ex}{with}{I^3_3}
  {\ATbe{O_3}
    {\ATm{the}{A}}
    {\ATm{key}{O}}}
  {\ATreL{.25ex}{I^3_2}
    {\ATs{the door}{O_2}}
    {\ATs{will be opened}{I^3}}}
\end{equation*}
has been typeset by
\begin{verbatim}
    \ATlL{.4ex}{with}{I^3_3}
    {\ATbe{O_3}
      {\ATm{the}{A}}
      {\ATm{key}{O}}}
    {\ATreL{.25ex}{I^3_2}
      {\ATs{the door}{O_2}}
      {\ATs{will be opened}{I^3}}}
\end{verbatim}\vspace{1.5ex}

The \emph{trick} to have the adposition always in the same place we
speak before, is now easy to write, although slightly
cumbersome. Specifically, the trick is to choose a reasonable global
value for \verb|\unitlength| which affects all the adtree, and then to
locally extend the branches with the \verb|\ATxlL| and \verb|\ATxrL|
commands whenever there is a need. The sensible choice for
\verb|\unitlength| minimises the number of extensions, and nicely
place the adpositions. For example
\begin{verbatim}
    {\unitlength.32ex
      \ATl{with}{I^3_3}
      {\ATxlL{.1ex}
        {\ATbe{O_3}
          {\ATm{the}{A}}
          {\ATm{key}{O}}}}
      {\ATxrL{.2ex}
        {\ATre{I^3_2}
          {\ATs{the door}{O_2}}
          {\ATs{will be opened}{I^3}}}}}
\end{verbatim}
generates
\begin{equation*}
  {\unitlength.3ex
    \ATl{with}{I^3_3}
    {\ATxlL{.1ex}{\ATbe{O_3}
        {\ATm{the}{A}}
        {\ATm{key}{O}}}}
    {\ATxrL{.2ex}{\ATre{I^3_2}
        {\ATs{the door}{O_2}}
        {\ATs{will be opened}{I^3}}}}}
\end{equation*}\vspace{1.5ex}

Another possibility to change the geometry of adtrees is to modify the
angle between the branches. The commands to change the angle in the
whole document, or within any group, affecting just the content of the
group, are \verb|\ATnormalangle|, which sets the angle to $60$
degrees, the default, \verb|\ATwideangle|, which sets the angle to
$90$ degrees, and \verb|\ATextrawideangle|, which sets the angle to
$120$ degrees. These values are the only possible ones, also in the
angle variant of the commands, as said before. Moreover, the value
$60$, $90$, or $120$ passed to the angle variant of a command (or to
the combined variant) affect the node locally, as in the length
variants' case.

For example
\begin{equation*}
  {\ATwideangle\unitlength.3ex
    \ATl{with}{I^3_3}
    {\ATbe{O_3}
      {\ATm{the}{A}}
      {\ATm{key}{O}}}
    {\ATxrL{.2ex}{\ATre{I^3_2}
      {\ATs{the door}{O_2}}
      {\ATs{will be opened}{I^3}}}} }
\end{equation*}
has been typeset by
\begin{verbatim}
    {\ATwideangle\unitlength.3ex
      \ATl{with}{I^3_3}
      {\ATbe{O_3}
        {\ATm{the}{A}}
        {\ATm{key}{O}}}
      {\ATxrL{.2ex}{\ATre{I^3_2}
        {\ATs{the door}{O_2}}
        {\ATs{will be opened}{I^3}}}} }
\end{verbatim}

However, the following adtree
\begin{equation*}
  \ATlLA{.5ex}{120}{with}{I^3_3}
  {\ATbe{O_3}
    {\ATm{the}{A}}
    {\ATm{key}{O}}}
  {\ATreL{.25ex}{I^3_2}
    {\ATs{the door}{O_2}}
    {\ATs{will be opened}{I^3}}}
\end{equation*}
has been generated by
\begin{verbatim}
    \ATlLA{.5ex}{120}{with}{I^3_3}
    {\ATbe{O_3}
      {\ATm{the}{A}}
      {\ATm{key}{O}}}
    {\ATreL{.25ex}{I^3_2}
      {\ATs{the door}{O_2}}
      {\ATs{will be opened}{I^3}}}
\end{verbatim}

The placement of the adposition varies when the angle is changed: this
has been done on purpose to cope with the reduction in height which is
induced by a larger angle between the branches. Notice how the
reduction in height may cause the adposition part of the adtree to
fall beyond the base of the branches.

% --------------------------
\section{Internal Constructions}\label{sec:internal}
All the major parts of an adtree can be customised. This section
describes a number of definitions which are used to control the
spacing between the various parts of morpheme blocks, summaries, and
adposition blocks. Also, the boxes which are deputed to provide a
format to a single morpheme, a grammar character, or an attribute, are
described.\vspace{1.5ex}

The shape of the adposition block, which lies just below the root of a
node in the adtree, is synthetically described as:
\begin{equation*}
  {\unitlength2ex
    \begin{picture}(14,14)
      \thinlines
      \put( 0, 2){\line(1,0){14}}
      \put( 0, 4){\line(1,0){14}}
      \put( 0, 6){\line(1,0){14}}
      \put( 0, 8){\line(1,0){14}}
      \put( 0,10){\line(1,0){14}}
      \put( 0,12){\line(1,0){14}}
      \put( 7,13){\makebox(0,0){pre skip}}
      \put( 7,11){\makebox(0,0){$t$}}
      \put( 7, 9){\makebox(0,0){first intermediate skip}}
      \put( 7, 7){\makebox(0,0){$a$}}
      \put( 7, 5){\makebox(0,0){second intermediate skip}}
      \put( 7, 3){\makebox(0,0){$g + x$}}
      \put( 7, 1){\makebox(0,0){post skip}}
      \thicklines
      \put( 0, 0){\line(1,0){14}}
      \put( 0,14){\line(1,0){14}}
      \put( 0, 0){\line(0,1){14}}
      \put(14, 0){\line(0,1){14}}
    \end{picture}}
  \qquad\qquad\qquad
  \raisebox{6ex}{\ATb{$a$}{g}[x]{\ATm{}{}}{\ATm{}{}}}
\end{equation*}
Here, $t$ stands for the trajectory, one of $\leftarrow$,
$\rightarrow$, or $\leftrightarrow$, as in the exemplifying adtree
above; $a$ is the adposition; $g$ is the grammar character; $x$ is an
attribute. The various skips are \LaTeX\/ commands deputed to add
vertical space between the components.

These commands, together with their definition, are:
\begin{verbatim}
    \def\ATpreadpositionskip{\relax}
    \def\ATfirstinteradpositionskip{\vskip.3ex}
    \def\ATsecondinteradpositionskip{\vskip.3ex}
    \def\ATpostadpositionskip{\relax}
\end{verbatim}
They can be redefined globally, to affect all the adtrees following
the redefinition, or locally, within a group which limits the
scope. For example, the following adtree
\begin{equation*}
  {\def\ATpreadpositionskip{\vskip-2ex}
    \ATrL{.3ex}{to}{I_2^2}
    {\ATm{Kim}{O_2}}
    {\ATs{The box belongs}{I^2_1}}}
\end{equation*}
has been obtained by the code
\begin{verbatim}
    {\def\ATpreadpositionskip{\vskip-2ex}
      \ATrL{.3ex}{to}{I_2^2}
      {\ATm{Kim}{O_2}}
      {\ATs{The box belongs}{I^2_1}}}
\end{verbatim}

The \verb|L| hidden feature of the package, already introduces, allows
to redefine these commands within the scope of a single node, as in
the root of
\begin{equation*}
  \ATrL{\unitlength\def\ATpreadpositionskip{\vskip-2ex}}
  {to}{I_2^2}{\ATm{Kim}{O}}
  {\ATbe{I_1^2}{\ATs{The box}{O_1}}{\ATm{belongs}{I^2_1}}}
\end{equation*}
This effect is obtained by the following code
\begin{verbatim}
    \ATrL{\unitlength\def\ATpreadpositionskip{\vskip-2ex}}
    {to}{I_2^2}
    {\ATm{Kim}{O_2}}
    {\ATbe{I_1^2}{\ATs{The box}{O_1}}{\ATm{belongs}{I^2}}}
\end{verbatim}\vspace{1.5ex}

Attributes are managed so to form a unique block together with the
grammar character. This block is constructed by the \verb|\ATm| and
\verb|\ATs| commands, and inside the previously described adposition
block.

It is important to remark that, although the size of text is normal in
the case of the morpheme and summary blocks, and while it is small in
the case of the adposition block, the values of skips are not affected
by the size. Thus, we strongly suggest, if you want to change them, to
express these values in the \verb|ex| unit, which is the right unit to
measure vertical space in terms of the \emph{current} font size.

The structure of the attribute block is
\begin{equation*}
  {\unitlength2ex
    \begin{picture}(14,14)
      \thinlines
      \put( 0, 2){\line(1,0){14}}
      \put( 0, 4){\line(1,0){14}}
      \put( 0, 6){\line(1,0){14}}
      \put( 0, 8){\line(1,0){14}}
      \put( 0,10){\line(1,0){14}}
      \put( 0,12){\line(1,0){14}}
      \put( 7,13){\makebox(0,0){$g$}}
      \put( 7,11){\makebox(0,0){first skip}}
      \put( 7, 9){\makebox(0,0){$a_1$}}
      \put( 7, 7){\makebox(0,0){intermediate skip}}
      \put( 7, 5){\makebox(0,0){$\vdots$}}
      \put( 7, 3){\makebox(0,0){intermediate skip}}
      \put( 7, 1){\makebox(0,0){$a_n$}}
      \thicklines
      \put( 0, 0){\line(1,0){14}}
      \put( 0,14){\line(1,0){14}}
      \put( 0, 0){\line(0,1){14}}
      \put(14, 0){\line(0,1){14}}
    \end{picture}}
  \qquad\qquad\qquad
  {\def\ATAttributeBox#1{\strut\textsf{#1}}
    \raisebox{20ex}{\ATm{}{g}[\lbrack$a_1$\rbrack]
      [\vdots]
      [\lbrack$a_n$\rbrack]} }
\end{equation*}
Here, $g$ is the grammar character, while $a_1, \dots, a_n$ are the
various attributes. The commands defining the skips in this block are
\begin{verbatim}
    \def\ATfirstattrskip{\vskip.7ex}
    \def\ATinterattrskip{\vskip.5ex}
\end{verbatim}
These definitions can be changed globally or locally, within the scope
of a group. Also, in the case of attributes in the adposition block,
they can be redefined within the single node, with the same technique
as before.

It is worth remarking that any kind of material can be generated by
these commands, not only vertical space. For example
\begin{equation*}
  {\makeatletter
    \def\ATfirstattrskip{\vskip.5ex
      \hbox to\@ATlen{\hfil\tiny * * *\hfil}\nointerlineskip
      \vskip.3ex}
    \makeatother
    \ATbe{O}[determ]
    {\ATm{the}{A}}
    {\ATm{box}{O}}}
\end{equation*}
has been generated by
\begin{verbatim}
    {\makeatletter
      \def\ATfirstattrskip{\vskip.5ex
        \hbox to\@ATlen{\hfil\tiny * * *\hfil}\nointerlineskip
        \vskip.3ex}
      \makeatother
      \ATbe{O}[determ]
      {\ATm{the}{A}}
      {\ATm{box}{O}}}
\end{verbatim}\vspace{1.5ex}

Finally, morpheme and summary blocks are as follows:
\begin{equation*}
  {\unitlength2ex
    \begin{picture}(14,12)
      \thinlines
      \put( 0, 2){\line(1,0){14}}
      \put( 0, 4){\line(1,0){14}}
      \put( 0, 6){\line(1,0){14}}
      \put( 0, 8){\line(1,0){14}}
      \put( 0,10){\line(1,0){14}}
      \put( 7,11){\makebox(0,0){$\triangle$, if a summary}}
      \put( 7, 9){\makebox(0,0){pre skip}}
      \put( 7, 7){\makebox(0,0){$m$}}
      \put( 7, 5){\makebox(0,0){intermediate skip}}
      \put( 7, 3){\makebox(0,0){$g + x$}}
      \put( 7, 1){\makebox(0,0){post skip}}
      \thicklines
      \put( 0, 0){\line(1,0){14}}
      \put( 0,12){\line(1,0){14}}
      \put( 0, 0){\line(0,1){12}}
      \put(14, 0){\line(0,1){12}}
    \end{picture}}
  \qquad\qquad
  \raisebox{15ex}{\ATm{m}{g}[x]}
  \qquad
  \raisebox{14ex}{\ATs{m}{g}[x]}
\end{equation*}
Here, $m$ is the morpheme or expression, and $g$ is the grammar
character together with its attributes $x$. The commands defining the
skips in this block are
\begin{verbatim}
    \def\ATpremorphemeskip{\vskip.5ex}
    \def\ATintermorphemeskip{\vskip1ex}
    \def\ATpostmorphemeskip{\relax}
\end{verbatim}
Again, these definitions can be modified globally, or locally, within
a group that limits the scope of the change. It is worth remarking
that nesting an \verb|\ATm| or \verb|\ATs| command inside a complex
adtree provides a natural group. For example
\begin{equation*}
  \ATbe{O}
  {\def\ATpremorphemeskip{\vskip0ex}
    \def\ATintermorphemeskip{\vskip.2ex}
    \ATm{the}{A}}
  {\ATm{box}{O}}
\end{equation*}
has been typeset by
\begin{verbatim}
    \ATbe{O}
    {\def\ATpremorphemeskip{\vskip0ex}
      \def\ATintermorphemeskip{\vskip.2ex}
      \ATm{the}{A}}
    {\ATm{box}{O}}
\end{verbatim}\vspace{1.5ex}

Actually, the face of morphemes, adpositions, and expressions in
summaries is controlled by the following command:
\begin{verbatim}
    \def\ATMorphemeBox#1{#1\strut}
\end{verbatim}
The \verb|\strut| forces all the instances to have the same minimal
height and depth. So, to typeset all the morphemes and summaries in
italic, as in
\begin{equation*}
  {\def\ATMorphemeBox#1{\textit{#1}\strut}
    \ATb{in}{E>I_2^2}
    {\ATs{the house}{O}}
    {\ATs{Kim moves}{I^2_1}} }
\end{equation*}
the following code suffices
\begin{verbatim}
    {\def\ATMorphemeBox#1{\textit{#1}\strut}
      \ATb{in}{E>I_2^2}
      {\ATs{the house}{O}}
      {\ATs{Kim moves}{I^2_1}} }
\end{verbatim}\vspace{1.5ex}

Similarly, the face of grammar characters, wherever they appear, is
controlled by the command
\begin{verbatim}
    \def\ATGrammarCharacterBox#1{$\mathrm{#1}$}
\end{verbatim}
The same scoping rules apply as in the case of
\verb|\ATMorphemeBox|. So, for example, we can make the grammar
character of the left subtree to be \verb|\Huge|, as in
\begin{equation*}
  \ATb{in}{E>I_2^2}
  {\def\ATGrammarCharacterBox#1{\Huge$\mathrm{#1}$}
    \ATs{the house}{O}}
  {\ATs{Kim move}{I_1^2}}
\end{equation*}
by typing the following code
\begin{verbatim}
    \ATb{in}{E>I_2^2}
    {\def\ATGrammarCharacterBox#1{\Huge$\mathrm{#1}$}
      \ATs{the house}{O}}
    {\ATs{Kim moves}{I_1^2}}
\end{verbatim}\vspace{1.5ex}

Also attributes are typeset according to a command:
\begin{verbatim}
    \def\ATAttributeBox#1{\textsf{[#1]}}
\end{verbatim}
So, for example, the illustrating attribute block on the previous page
has been generated by the following code
\begin{verbatim}
    {\def\ATAttributeBox#1{\strut\textsf{#1}}
      \raisebox{20ex}{\ATm{}{g}[\lbrack$a_1$\rbrack]
        [\vdots]
        [\lbrack$a_n$\rbrack]} }
\end{verbatim}\vspace{1.5ex}

Finally, the symbol denoting a summary can be customised by changing
\begin{verbatim}
    \def\ATSummarySymbol{$\triangle$}
\end{verbatim}
It is important to remark that the top vertex of the triangle lies in
the middle of the top of the $\triangle$ character, providing a
natural point to join with the branches of adtrees. This fact should
be taken in account when changing the definition.

% --------------------------
\section{Hints and Tricks}\label{sec:hints}
There are a few last features which can be exploited in the
\verb|adtrees| package. These are the low-level commands to draw the
branches:
\begin{verbatim}
    \def\ATleftbranch#1#2{\line(#1,#2)}
    \def\ATrightbranch#1#2{\line(#1,#2)}
    \def\ATcircle{\circle*}
\end{verbatim}

The \verb|\ATleftbranch| and \verb|\ATrightbranch| commands draw the
left and the right branch of an adtree, respectively. Also, they draw
the extensions, when present. They can be redefined globally, locally
within the scope of a group, or locally within a node, using the
implicit scope of the length variant, as previously described by the
trick to equalise the position of adposition blocks.

For example,
\begin{equation*}
  \unitlength.2ex
  {\def\ATrightbranch#1#2{\color{red}\line(#1,#2)}
    \ATlL{\unitlength
      \def\ATleftbranch##1##2{\color{green}\line(##1,##2)}}
    {with}{I^3_3}
    {\ATs{the key}{O_3}}
    {\ATre{I^3_2}
      {\ATxl{\ATs{the door}{O_2}}}
      {\ATs{will be opened}{I^3}}} }
\end{equation*}
is obtained by making all the right branches red, and the topmost left
branch green:
\begin{verbatim}
    {\def\ATrightbranch#1#2{\color{red}\line(#1,#2)}
      \ATlL{\unitlength
        \def\ATleftbranch##1##2{\color{green}\line(##1,##2)}}
      {with}{I^3_3}
      {\ATs{the key}{O_3}}
      {\ATre{I^3_2}
        {\ATxl{\ATs{the door}{O_2}}}
        {\ATs{will be opened}{I^3}}} }
\end{verbatim}

Also, the following definition
\begin{verbatim}
    {\def\ATcircle#1{\relax}
      \ATl{with}{I^3_3}
      {\ATs{the key}{O_3}}
      {\ATre{I^3_2}
        {\ATxl{\ATs{the door}{O_2}}}
        {\ATs{will be opened}{I^3}}} }
\end{verbatim}
suppresses the points in the whole adtree
\begin{equation*}
  \unitlength.2ex
  {\def\ATcircle#1{\relax}
    \ATl{with}{I^3_3}
    {\ATs{the key}{O_3}}
    {\ATre{I^3_2}
      {\ATxl{\ATs{the door}{O_2}}}
      {\ATs{will be opened}{I^3}}} }
\end{equation*}

As a rather extreme and useless example, one can typeset the previous
adtree without showing the branches and making the points really huge
\begin{equation*}
  {\def\ATcircle#1{\circle*{8}}
    \def\ATleftbranch#1#2#3{\relax}
    \def\ATrightbranch#1#2#3{\relax}
    \unitlength.22ex
    \ATl{with}{I^3_3}
    {\ATs{the key}{O_3}}
    {\ATre{I^3_2}
      {\ATxl{\ATs{the door}{O_2}}}
      {\ATs{will be opened}{I^3}}} }
\end{equation*}
by the following code
\begin{verbatim}
    {\def\ATcircle#1{\circle*{8}}
      \def\ATleftbranch#1#2#3{\relax}
      \def\ATrightbranch#1#2#3{\relax}
      \unitlength.22ex
      \ATl{with}{I^3_3}
      {\ATs{the key}{O_3}}
      {\ATre{I^3_2}
        {\ATxl{\ATs{the door}{O_2}}}
        {\ATs{will be opened}{I^3}}} }
\end{verbatim}\vspace{1.5ex}

Another important aspect of the package is that every adtree lies in a
\TeX\/ box. It means that all the standard commands to manipulate
boxes are available.

For example
\begin{equation*}
  \rotatebox{-30}
  {\ATlcLA{.3ex}{90}{I_2^2}
    {\ATs{\cancel{the apple}}{O_2}}
    {\ATs{Kim eats}{I_1^2}}}
\end{equation*}
has been generated by
\begin{verbatim}
    \rotatebox{-30}
    {\ATlcLA{.3ex}{90}{I_2^2}
      {\ATs{\cancel{the apple}}{O_2}}
      {\ATs{Kim eats}{I_1^2}}}
\end{verbatim}

Sometimes, scaling a box is required:
\begin{equation*}
  \scalebox{1.5}
  {\ATlcLA{.3ex}{90}{I_2^2}
    {\ATs{\cancel{the apple}}{O_2}}
    {\ATs{Kim eats}{I_1^2}}}
\end{equation*}
has been generated by
\begin{verbatim}
    \scalebox{1.5}
    {\ATlcLA{.3ex}{90}{I_2^2}
      {\ATs{\cancel{the apple}}{O_2}}
      {\ATs{Kim eats}{I_1^2}}}
\end{verbatim}\vspace{1.5ex}

A final point is that, when the \verb|\smaller| command is available,
as in AMS-\TeX, changing the font size automatically makes the
adposition blocks to be \verb|\smaller| than the size of the normal
text, which is used to typeset the morpheme and summary blocks. For
example,
\begin{equation*}
  \hbox{\huge
    \ATlcLA{.3ex}{120}{I_2^2}
      {\ATs{\cancel{the apple}}{O_2}}
      {\ATs{Kim eats}{I_1^2}}}
\end{equation*}
which has been generated by
\begin{verbatim}
    {\huge
      \ATlcLA{.3ex}{120}{I_2^2}
        {\ATs{\cancel{the apple}}{O_2}}
        {\ATs{Kim eats}{I_1^2}}}
\end{verbatim}

When the \verb|smaller| command is not available, the size of the
adposition block is fixed to be \verb|\small|. This can be changed
modifying the (internal) command \verb|\@ATsmall|:
\begin{verbatim}
    \makeatletter
    \def\@ATsmall{\small}
    \makeatother
\end{verbatim}
Changing \verb|\small| in the above code, modifies the size of the
components of the adposition block. We suggest to avoid such a change,
except in a local group which contains a complete adtree.

% --------------------------
\section{Linear Adtrees}\label{sec:linear}
Adtrees can be rendered in a linear format. This is not graphically
pleasant, so we discourage users to adopt it.\vspace{1.5ex}

Nevertheless, it may be useful to have a very compact representation
of adtrees. This can be automatically obtained by prepending the
\verb|\ATlinearise| command to an adtree. For example
\begin{equation*}
  \ATlinearise{\ATlcL{.3ex}{I_2^2}[phrase]
    {\ATm{\cancel{something}}{O}[object][fruit]}
    {\ATs{Kim eats}{I_1^2}}}
\end{equation*}
is the same as
\begin{equation*}
  \ATlcL{.3ex}{I_2^2}[phrase]
  {\ATm{\cancel{something}}{O}[object][fruit]}
  {\ATs{Kim eats}{I_1^2}}
\end{equation*}
which shows how all the features of adtrees are rendered in the linear
format. 

The linear presentation has been generated by
\begin{verbatim}
    \ATlinearise{\ATlcL{.3ex}{I_2^2}[phrase]
      {\ATm{\cancel{something}}{O}[object][fruit]}
      {\ATs{Kim eats}{I_1^2}}}
\end{verbatim}
which differs from the code to draw the graphics presentation just for
\verb|\ATlinearise|.\vspace{1.5ex}

Declaring \verb|\ATLinear| in some point of the text makes linear all
the adtrees from that point on. To reestablish the standard behaviour
of graphical adtrees, one issues the command
\verb|\ATNormal|.\vspace{1.5ex} 

Linear adtrees are composed using the following commands
\begin{verbatim}
    \def\ATlinearadpositionblock#1#2#3{%
       {#2}${}^{\hbox{#1}}_{\hbox{#3}}$}
    \def\ATlinearfirstattribute#1#2{{#1}:{#2}}
    \def\ATlinearnextattribute#1#2{{#1};{#2}}
    \def\ATlinearsubtrees#1#2{(#1,\linebreak[0] #2)}
    \def\ATlinearmorphemeblock#1#2{{#1}${}_{\hbox{#2}}$}
    \def\ATlinearsummaryblock#1#2{({#1})${}_{\hbox{#2}}$}
\end{verbatim}
Their meaning should be intuitive after the explanations in
Section~\ref{sec:internal}. 

Also, it must be remarked that \verb|\ATMorphemeBox|,
\verb|\ATGrammarCharacterBox|, and \verb|\ATAttributeBox| are still
used to write the corresponding elements.\vspace{1.5ex}

Linear adtrees are useful when it is required to perform some
computation on an adtree inside \LaTeX, e.g., when trying to write a
macro which manipulates an argument which is an adtree. 

The reason is double: first, the linear format require far less
computation than the graphical rendering; and, second, the building
macros receive inputs which have not been heavily preprocessed to
prepare their graphical rendering, thus closer to what the user has
written in the source code.

For example, to list all the morpheme attributes occurring inside
\begin{equation*}
  \ATlL{.3ex}{with}{I^2_2}[phrase]
  {\ATs{the key}{O}[third actant]}
  {\ATre{I^2_1}
    {\ATxl{\ATs{the door}{O}[second actant]}}
    {\ATs{will be opened}{I^3}[governor]}}
\end{equation*}
we can execute
\begin{verbatim}
    {\def\ATlinearadpositionblock#1#2#3{\relax}
      \def\ATlinearfirstattribute#1#2{#2}
      \def\ATlinearnextattribute#1#2{[{#2}]}
      \def\ATlinearsubtrees{\relax}
      \def\ATlinearmorphemeblock#1{\relax}
      \def\ATlinearsummaryblock#1{\relax}
      \ATlinearise{\ATl{with}{I^2_2}[phrase]
        {\ATs{the key}{O}[third actant]}
        {\ATre{I^2_1}
          {\ATxl{\ATs{the door}{O}[second actant]}}
          {\ATs{will be opened}{I^2}[governor]}}} }
\end{verbatim}
which produces
\begin{equation*}
  {\def\ATlinearadpositionblock#1#2#3{\relax}
    \def\ATlinearfirstattribute#1#2{#2}
    \def\ATlinearnextattribute#1#2{[{#2}]}
    \def\ATlinearsubtrees{\relax}
    \def\ATlinearmorphemeblock#1{\relax}
    \def\ATlinearsummaryblock#1{\relax}
    \ATlinearise{\ATl{with}{I^2_2}[phrase]
      {\ATs{the key}{O}[third actant]}
      {\ATre{I^2_1}
        {\ATxl{\ATs{the door}{O}[second actant]}}
        {\ATs{will be opened}{I^2}[governor]}}} }
\end{equation*}
It is needless to say that such computations require a real \TeX\/
magician, who is able to understand (and, hopefully, improve) the code
of the package! Nevertheless, this opens the door to \LaTeX\/ macros
that operate on adtrees, treating them like data structures.\vfill

\end{document}