| 1 |
\documentclass{amsart} |
| 2 |
\usepackage{amssymb} |
| 3 |
\usepackage{color} |
| 4 |
\usepackage{graphics} |
| 5 |
\usepackage{adtrees} |
| 6 |
\usepackage{url} |
| 7 |
\usepackage{microtype} |
| 8 |
|
| 9 |
\begin{document} |
| 10 |
\title{Adpositional Trees in \LaTeX} |
| 11 |
\date{} |
| 12 |
\author[Marco Benini]{Marco Benini} |
| 13 |
\address[Marco Benini]{Dipartimento di Scienza e Alta Tecnologia\\ |
| 14 |
Universit\`a degli Studi dell'Insubria\\ |
| 15 |
via Valleggio 11, I-22100 Como, Italy} |
| 16 |
\email{[email protected]} |
| 17 |
\urladdr{http://marcobenini.wordpress.com} |
| 18 |
\author[Federico Gobbo]{Federico Gobbo} |
| 19 |
\address[Federico Gobbo]{Faculty of Humanities\\ |
| 20 |
University of Amsterdam\\ |
| 21 |
Spuistraat 134,NL-1012VT Amsterdam, The Netherlands} |
| 22 |
\email{[email protected]} |
| 23 |
\urladdr{http://federicogobbo.name} |
| 24 |
\maketitle |
| 25 |
|
| 26 |
% -------------------------- |
| 27 |
\section{Introduction}\label{sec:introduction} |
| 28 |
Adpositional trees (adtrees, for short) are a formal way to represent |
| 29 |
expressions in natural language. They have been defined, used, and |
| 30 |
discussed in F.~Gobbo and M.~Benini, \textit{Constructive Adpositional |
| 31 |
Grammars: Foundations of Constructive Linguistics}, Cambridge |
| 32 |
Scholar Press (2011). Since then, they have been used without |
| 33 |
theoretical modifications in a number of applications. |
| 34 |
|
| 35 |
This document describes the \LaTeX\/ package to draw adtrees. It is |
| 36 |
written so that a user may start typesetting adtrees as soon as |
| 37 |
possible: all the fundamental commands and macros are presented in |
| 38 |
Section~\ref{sec:simple}. At the first reading, the subsequent |
| 39 |
sections may be freely skipped. |
| 40 |
|
| 41 |
Section~\ref{sec:centring} describes the next obvious step: how to put |
| 42 |
an adtree inside your document, controlling the way to align it with |
| 43 |
other objects. Section~\ref{sec:complex} explains how to control the |
| 44 |
length of branches via the \verb|\unitlength| value. It also |
| 45 |
introduces the variants of the fundamental commands to modify the |
| 46 |
lengths of the branches in the adtree, the angle between them, or |
| 47 |
both, either globally, locally, or recursively. |
| 48 |
|
| 49 |
Section~\ref{sec:internal} describes the low-level definitions that |
| 50 |
affect the construction of the various pieces composing |
| 51 |
adtrees. Changing these definitions is intended for advanced users, |
| 52 |
who want to modify the standard appearance of |
| 53 |
adtrees. Section~\ref{sec:hints} concludes the description of the main |
| 54 |
graphical package, showing some special techniques to deal with |
| 55 |
adtrees, and a couple of very low-level primitives of the package. |
| 56 |
|
| 57 |
Sections~\ref{sec:pathlike} and~\ref{sec:tabular} describe two |
| 58 |
alternatives way to compose adtrees. the former shows a |
| 59 |
\emph{path-like} format which is useful when keeping the order of |
| 60 |
morphemes in the original sentence is important; the latter is a |
| 61 |
textual rendering of an adtree as a piece of indented text. |
| 62 |
|
| 63 |
The final Section~\ref{sec:linear} describes the way to render adtrees |
| 64 |
in a linear format. This is a minor feature which we discourage to |
| 65 |
use, except for very special purposes. |
| 66 |
|
| 67 |
% -------------------------- |
| 68 |
\clearpage |
| 69 |
\section{Simple Adtrees}\label{sec:simple} |
| 70 |
The installation of the package is standard: see the documentation on |
| 71 |
your particular \TeX\/ system for the details. It reduces to put the |
| 72 |
\verb|.sty| file in a sensible place. Using the package in a document |
| 73 |
requires it to be invoked with |
| 74 |
\verb|\usepackage{adtrees}| in the preamble.\vspace{1.5ex} |
| 75 |
|
| 76 |
The simplest adtree is composed by a single morpheme: |
| 77 |
\begin{equation*} |
| 78 |
\ATm{Liza}{O} |
| 79 |
\end{equation*} |
| 80 |
which has been typeset by the command |
| 81 |
\begin{verbatim} |
| 82 |
\ATm{Liza}{O} |
| 83 |
\end{verbatim} |
| 84 |
|
| 85 |
Sometimes, a morpheme requires to specify attributes: |
| 86 |
\begin{equation*} |
| 87 |
\ATm{Liza}{O}[proper noun][animated] |
| 88 |
\end{equation*} |
| 89 |
this behaviour is accomplished by the command |
| 90 |
\begin{verbatim} |
| 91 |
\ATm{Liza}{O}[proper noun][animated] |
| 92 |
\end{verbatim} |
| 93 |
|
| 94 |
The general form of the \verb|\ATm| command is |
| 95 |
\begin{equation*} |
| 96 |
\verb|\ATm{| m \verb|}{| g \verb|}[| a_1 \verb|]| \cdots \verb|[| |
| 97 |
a_n \verb|]| |
| 98 |
\end{equation*} |
| 99 |
with $m$ the morpheme, $g$ its grammar character, and $a_1, \dots, |
| 100 |
a_n$ its attributes, if any. The attributes are optional, and there |
| 101 |
can be any number of them. Also, notice how all the commands in the |
| 102 |
package start with \verb|\AT|: the final \verb|m| stands for |
| 103 |
\emph{morpheme}. This is a general naming rule: all the fundamental |
| 104 |
command have the form \verb|\AT| followed by a single letter which |
| 105 |
reminds its function. Variants of the fundamental commands use a |
| 106 |
two-letter code, the first letter being the same as the fundamental |
| 107 |
command, and the second letter reminding the variant. |
| 108 |
|
| 109 |
% -------------------------- |
| 110 |
\subsection{Complex Adtrees}\label{subsec:complex} |
| 111 |
A complex adtree is made by two adtrees, composed via an |
| 112 |
\emph{adposition}, which is described by a morpheme together with the |
| 113 |
grammar character of the resulting adtree, and the |
| 114 |
\emph{trajectory}. The trajectory is an arrow, and it can be |
| 115 |
$\leftarrow$, $\rightarrow$, or $\leftrightarrow$. The following three |
| 116 |
examples are very similar to the ones in Figure 2.11 of Gobbo and |
| 117 |
Benini (2011): |
| 118 |
\begin{equation*} |
| 119 |
\ATr{to}{I_2^2} |
| 120 |
{\ATm{Kim}{O_2}} |
| 121 |
{\ATs{The box belongs}{I_1^2}} |
| 122 |
\qquad |
| 123 |
\ATl{$\epsilon$}{I_2^2} |
| 124 |
{\ATs{the box}{O_2}} |
| 125 |
{\ATs{Kim owns}{I_1^2}} |
| 126 |
\qquad |
| 127 |
\ATb{on}{E>I_1^1} |
| 128 |
{\ATs{the box}{O}} |
| 129 |
{\ATs{Kim jumps}{I_1^1}} |
| 130 |
\end{equation*} |
| 131 |
|
| 132 |
These adtrees are typeset, respectively, by the commands |
| 133 |
\begin{verbatim} |
| 134 |
\ATr{to}{I_2^2} |
| 135 |
{\ATm{Kim}{O_2}} |
| 136 |
{\ATs{The box belongs}{I_1^2}} |
| 137 |
|
| 138 |
\ATl{$\epsilon$}{I_2^2} |
| 139 |
{\ATm{the box}{O_2}} |
| 140 |
{\ATs{Kim owns}{I_1^2}} |
| 141 |
|
| 142 |
\ATb{on}{E>I_1^1} |
| 143 |
{\ATs{the box}{O_2}} |
| 144 |
{\ATs{Kim jumps}{I_1^1}} |
| 145 |
\end{verbatim}\vspace{1.5ex} |
| 146 |
|
| 147 |
The general format of these commands is |
| 148 |
\begin{equation*} |
| 149 |
c \verb|{| a \verb|}{| g \verb|}[| x_1 \verb|]| \dots \verb|[| x_n |
| 150 |
\verb|]{| L \verb|}{| R \verb|}| |
| 151 |
\end{equation*} |
| 152 |
with $c$ among \verb|\ATl|, \verb|ATr|, \verb|\ATb|; $a$ the |
| 153 |
adposition: $g$ the grammar character of the whole construction; $x_1, |
| 154 |
\dots, x_n$ the optional attributes of the construction; $L$ the left |
| 155 |
adtree; and $R$ the right adtree. The adposition is typeset as normal |
| 156 |
text, the grammar character in math mode with the roman typeface, so |
| 157 |
that super- and sub-scripts can be freely used, and the trajectory is |
| 158 |
defined by the command: \verb|\ATl| for the \emph{left} arrow, |
| 159 |
\verb|\ATr| for the \emph{right} arrow, and \verb|\ATb| for the arrow |
| 160 |
in \emph{both} direction, following the general naming rule. The |
| 161 |
attributes are optional and they are typeset as in the morpheme |
| 162 |
construction.\vspace{1.5ex} |
| 163 |
|
| 164 |
Actually, the \verb|\ATm| command is used to typeset proper morphemes, |
| 165 |
while the \verb|\ATs| command is designed to typeset expressions which |
| 166 |
can be expanded into an adtree. In fact, the \verb|s| letter stands |
| 167 |
for \emph{summary}, following the general naming rule. The \verb|\ATs| |
| 168 |
command has the same syntax as the \verb|\ATm| command, and it differs |
| 169 |
just in the graphical appearance. So, it may take an arbitrary number |
| 170 |
of attributes, and whatever applies to \verb|\ATm| holds for |
| 171 |
\verb|\ATs|, too. |
| 172 |
|
| 173 |
% -------------------------- |
| 174 |
\subsection{Epsilon Adpositions}\label{subsec:epsilon} |
| 175 |
Since writing adtrees with the empty adposition, represented by the |
| 176 |
$\epsilon$ symbol, is very common, the following commands are |
| 177 |
provided: \verb|\ATle|, \verb|\ATre|, and \verb|\ATbe|, with \verb|e| |
| 178 |
standing for \emph{empty} in the general naming convention. They |
| 179 |
behave as the command without the trailing \verb|e|, but the |
| 180 |
adposition is automatically typeset. Also, they share the same |
| 181 |
syntax. So, the previous example |
| 182 |
\begin{equation*} |
| 183 |
\ATle{I_2^2} |
| 184 |
{\ATs{the box}{O}} |
| 185 |
{\ATs{Kim owns}{I_1^2}} |
| 186 |
\end{equation*} |
| 187 |
can be typeset in a simplified way as |
| 188 |
\begin{verbatim} |
| 189 |
\ATle{I_2^2} |
| 190 |
{\ATs{the box}{O}} |
| 191 |
{\ATs{Kim owns}{I_1^2}} |
| 192 |
\end{verbatim}\vspace{1.5ex} |
| 193 |
|
| 194 |
Similarly, because the so-called epsilon-transformations are common, |
| 195 |
and they require to forget about adpositions and morphemes, which is |
| 196 |
graphically marked by cancelling them with a stroke, the package |
| 197 |
automatically includes the \verb|cancel| package by Donald Arseneau, |
| 198 |
(available in CTAN, at |
| 199 |
\url{http://mirror.ctan.org/macros/latex/contrib/cancel}). In |
| 200 |
addition, to simplify the cancellation of empty adpositions, the |
| 201 |
commands \verb|\ATrc| \verb|\ATlc| \verb|\ATbc| are provided, with |
| 202 |
\verb|c| standing for \emph{cancel ed}. They work as their |
| 203 |
counterparts with the trailing \verb|e|, sharing the same syntax. For |
| 204 |
example, |
| 205 |
\begin{equation*} |
| 206 |
\ATlc{I_2^2} |
| 207 |
{\ATs{\cancel{the apple}}{O}} |
| 208 |
{\ATs{Kim eats}{I_1^2}} |
| 209 |
\end{equation*} |
| 210 |
has been typeset by |
| 211 |
\begin{verbatim} |
| 212 |
\ATlc{I_2^2} |
| 213 |
{\ATs{\cancel{the apple}}{O}} |
| 214 |
{\ATs{Kim eats}{I_1^2}} |
| 215 |
\end{verbatim} |
| 216 |
|
| 217 |
% -------------------------- |
| 218 |
\subsection{Overlapping subtrees}\label{subsec:overlapping} |
| 219 |
When one has to write complex adtrees, it is often the case that there |
| 220 |
are overlapping subtrees. To cope with these situations, the simplest |
| 221 |
way is to prolong the left or the right branch of a node. This |
| 222 |
behaviour can be accomplished with the \verb|\ATxl| and \verb|\ATxr| |
| 223 |
commands, where \verb|x| stands for \emph{extends} and \verb|l| and |
| 224 |
\verb|r| for \emph{left} and \emph{right}, respectively. They both |
| 225 |
take a single argument which is the adtree being appended at the end |
| 226 |
of the extended branch. For example, the following adtree, similar to |
| 227 |
the one in Figure~2.16 (Gobbo and Benini 2011): |
| 228 |
\begin{equation*} |
| 229 |
\unitlength.23ex |
| 230 |
\ATl{with}{I^3_3}[phrase] |
| 231 |
{\ATs{the key}{O}} |
| 232 |
{\ATre{I^3_2} |
| 233 |
{\ATxl{\ATs{the door}{O_2}}} |
| 234 |
{\ATs{will be opened}{I^3}}} |
| 235 |
\end{equation*} |
| 236 |
has been typeset by the following \LaTeX\/ code |
| 237 |
\begin{verbatim} |
| 238 |
\ATl{with}{I^3_3}[phrase] |
| 239 |
{\ATs{the key}{O_3}} |
| 240 |
{\ATre{I^3_2} |
| 241 |
{\ATxl{\ATs{the door}{O_2}}} |
| 242 |
{\ATs{will be opened}{I^3}}} |
| 243 |
\end{verbatim} |
| 244 |
|
| 245 |
The example also shows how to put an attribute in the top adposition. |
| 246 |
Normally, for reasons of space, adtrees use extensively summaries to |
| 247 |
put in evidence only the linguistic phenomenon needed in that |
| 248 |
moment. For example, the following adtree: |
| 249 |
\begin{equation*} |
| 250 |
\ATl{with}{I^3_3} |
| 251 |
{\ATs{the key}{O_3}} |
| 252 |
{\ATxr{\ATs{the door will be opened}{I^3_2}}} |
| 253 |
\end{equation*} |
| 254 |
has been typeset by the following \LaTeX\/ code |
| 255 |
\begin{verbatim} |
| 256 |
\ATl{with}{I^3_3} |
| 257 |
{\ATs{the key}{O_3}} |
| 258 |
{\ATxr{\ATs{the door will be opened}{I^3_2}}} |
| 259 |
\end{verbatim} |
| 260 |
The example also shows a right-branch extension. Overlapping can be |
| 261 |
also avoided in complex adtrees using advanced commands. See Section |
| 262 |
\ref{sec:complex} for details. |
| 263 |
|
| 264 |
% -------------------------- |
| 265 |
\subsection{Morphological adpositions}\label{subsec:mu} |
| 266 |
Sometimes, for the sake of clarity, morphological relations should be |
| 267 |
stated explicitly. For example, the following adtree: |
| 268 |
\begin{equation*} |
| 269 |
% \unitlength.3ex |
| 270 |
\ATr{-ly}{E>I^3_2} |
| 271 |
{\ATm{quick-}{A}} |
| 272 |
{\ATre{I^3_2} |
| 273 |
{\ATxl{\ATs{the door}{O_2}}} |
| 274 |
{\ATs{will be opened}{I^3}}} |
| 275 |
\end{equation*} |
| 276 |
which has been typeset by the following \LaTeX\/ code |
| 277 |
\begin{verbatim} |
| 278 |
\ATr{-ly}{E>I^3_2} |
| 279 |
{\ATm{quick-}{A}} |
| 280 |
{\ATre{I^3_2} |
| 281 |
{\ATxl{\ATs{the door}{O_2}}} |
| 282 |
{\ATs{will be opened}{I^3}}} |
| 283 |
\end{verbatim} |
| 284 |
could be made explicit, where the $\mu$ adposition indicates a |
| 285 |
morphological relation. For example, the following adtree is |
| 286 |
linguistically equivalent to the previous one: |
| 287 |
\begin{equation*} |
| 288 |
\unitlength.2ex |
| 289 |
\ATle{I^3_2} |
| 290 |
{\ATxl{\ATxl{\ATrmu{E} |
| 291 |
{\ATm{-ly}{E}} |
| 292 |
{\ATm{quick-}{A}}}}} |
| 293 |
{\ATre{I^3_2} |
| 294 |
{\ATxl{\ATs{the door}{O_2}}} |
| 295 |
{\ATs{will be opened}{I^3}}} |
| 296 |
\end{equation*} |
| 297 |
and it has been typeset by the following \LaTeX\/ code |
| 298 |
\begin{verbatim} |
| 299 |
\ATle{I^3_2} |
| 300 |
{\ATxl{\ATxl{\ATrmu{E} |
| 301 |
{\ATm{-ly}{E}} |
| 302 |
{\ATm{quick-}{A}}}}} |
| 303 |
{\ATre{I^3_2} |
| 304 |
{\ATxl{\ATs{the door}{O_2}}} |
| 305 |
{\ATs{will be opened}{I^3}}} |
| 306 |
\end{verbatim} |
| 307 |
The package provides the commands \verb|\ATlmu|, \verb|\ATrmu|, and |
| 308 |
\verb|\ATbmu|, analogous to the $\epsilon$ variants, to simplify the |
| 309 |
typesetting of adtrees using the $\mu$ adposition. |
| 310 |
|
| 311 |
% -------------------------- |
| 312 |
\clearpage |
| 313 |
\section{Alignments and Centring}\label{sec:centring} |
| 314 |
Drawing an adtree in a display is the simplest and most common way: |
| 315 |
\begin{equation*} |
| 316 |
\unitlength.18ex |
| 317 |
\ATl{with}{I^3_3} |
| 318 |
{\ATs{the key}{O_3}} |
| 319 |
{\ATre{I^3_2} |
| 320 |
{\ATxl{\ATs{the door}{O_2}}} |
| 321 |
{\ATs{will be opened}{I^3}}} |
| 322 |
\end{equation*} |
| 323 |
is generated by the following code |
| 324 |
\begin{verbatim} |
| 325 |
\begin{equation*} |
| 326 |
\unitlength.18ex |
| 327 |
\ATl{with}{I^3_3} |
| 328 |
{\ATs{the key}{O_3}} |
| 329 |
{\ATre{I^3_2} |
| 330 |
{\ATxl{\ATs{the door}{O_2}}}} |
| 331 |
{\ATs{will be opened}{I^3}}} |
| 332 |
\end{equation*} |
| 333 |
\end{verbatim}\vspace{1.5ex} |
| 334 |
|
| 335 |
Putting an adtree in a figure environment reduces to write the |
| 336 |
corresponding \LaTeX\/ display inside the content of the \verb|figure| |
| 337 |
environment. |
| 338 |
|
| 339 |
In general, we strongly encourages the user to use a robust display |
| 340 |
environment, like \verb|equation*| or \verb|displaymath|, and to avoid |
| 341 |
the \verb|center| environment. Advanced displays to align mathematical |
| 342 |
material, as in the \AmS\ suite, are another good and reliable option |
| 343 |
to place adtrees in a page.\vspace{1.5ex} |
| 344 |
|
| 345 |
An adtree fits exactly its enclosing box, that is |
| 346 |
\begin{equation*} |
| 347 |
\fboxsep0pt |
| 348 |
\unitlength.18ex |
| 349 |
\fbox{\ATl{with}{I^3_3} |
| 350 |
{\ATs{the key}{O_3}} |
| 351 |
{\ATre{I^3_2} |
| 352 |
{\ATxl{\ATbe{O_2}{\ATm{the}{A}}{\ATm{door}{O}}}} |
| 353 |
{\ATs{will be opened}{I^3}}}} |
| 354 |
\end{equation*} |
| 355 |
If one looks closely (and that is why the adtree is so big), there is |
| 356 |
half of the point in the root which lies outside the box. This is done |
| 357 |
on purpose, to make easier to collate together adtrees.\vspace{1.5ex} |
| 358 |
|
| 359 |
Writing a morpheme or a summary directly inside the text, like |
| 360 |
\fbox{\ATm{Gargoyle}{O}}, produces a box whose baseline is exactly the |
| 361 |
baseline of the morpheme. This makes the behaviour predictable, even |
| 362 |
if the graphical appearance is quite terrible (like in this |
| 363 |
paragraph). An adtree, like \fbox{\ATre{I_2^2} {\ATm{the box}{O_2}} |
| 364 |
{\ATbe{I_1^2}{\ATm{Kim}{O_1}}{\ATs{owns}{I^2}}}}, behaves similarly, |
| 365 |
because the baseline of the box is the baseline of the lowest morpheme |
| 366 |
or summary in the whole tree, the one corresponding to the \emph{owns} |
| 367 |
morpheme in the example. |
| 368 |
|
| 369 |
So, at least in principle, since the user can rely on the size of the |
| 370 |
enclosing box, and on the position of the baseline, it is possible to |
| 371 |
align an adtree in whatever way one may desire. In our experience, the |
| 372 |
only really common way one requires to move adtrees in the surrounding |
| 373 |
text is to centre them: the package provides three commands to centre |
| 374 |
an adtree horizontally, vertically, or both. These are |
| 375 |
\verb|\ATvcentre|, \verb|\AThcentre|, and \verb|\ATcentre|, |
| 376 |
respectively. For example |
| 377 |
\begin{equation*} |
| 378 |
\ATvcentre{\ATl{with}{I^3_3} |
| 379 |
{\ATs{the key}{O_3}} |
| 380 |
{\ATre{I^3_2} |
| 381 |
{\ATxl{\ATs{the door}{O_2}}} |
| 382 |
{\ATs{will be opened}{I^3}}}} |
| 383 |
\mathbin{\equiv} |
| 384 |
\ATvcentre{\ATl{with}{I^3_3} |
| 385 |
{\ATs{the key}{O_3}} |
| 386 |
{\ATre{I^3_2} |
| 387 |
{\ATs{the door}{O_2}} |
| 388 |
{\ATxr{\ATs{will be opened}{I^3}}}}} |
| 389 |
\end{equation*} |
| 390 |
has been generated by |
| 391 |
\begin{verbatim} |
| 392 |
\ATvcentre{\ATl{with}{I^3_3} |
| 393 |
{\ATs{the key}{O_3}} |
| 394 |
{\ATre{I^3_2} |
| 395 |
{\ATxl{\ATs{the door}{O_2}}} |
| 396 |
{\ATs{will be opened}{I^3}}}} |
| 397 |
\mathbin{\equiv} |
| 398 |
\ATvcentre{\ATl{with}{I^3_3} |
| 399 |
{\ATs{the key}{O_3}} |
| 400 |
{\ATre{I^3_2} |
| 401 |
{\ATs{the door}{O_2}} |
| 402 |
{\ATxr{\ATs{will be opened}{I^3}}}}} |
| 403 |
\end{verbatim} |
| 404 |
|
| 405 |
More sophisticated ways to place an adtree in the page are discussed |
| 406 |
in Section~\ref{sec:hints}. |
| 407 |
|
| 408 |
% -------------------------- |
| 409 |
\clearpage |
| 410 |
\section{Dealing with Complex Adtrees}\label{sec:complex} |
| 411 |
Simple adtrees are easily typeset using the previously described |
| 412 |
commands. But, sooner or later, one has to typeset a complex adtree, |
| 413 |
which does not fit into the page, or whose branches overlap, no matter |
| 414 |
how we extend branches, or which looks awful because of a poor choice |
| 415 |
of dimensions. In all these cases, there are a number of strategies |
| 416 |
one may adopt.\vspace{1.5ex} |
| 417 |
|
| 418 |
The simplest and crudest one is to change the length of branches. In |
| 419 |
this respect, branches are drawn using the \LaTeX\/ \verb|picture| |
| 420 |
environment, so the length of each branch is $25\verb|\unitlength|$. |
| 421 |
|
| 422 |
The value of \verb|\unitlength| may be changed globally, affecting the |
| 423 |
way all subsequent adtrees in a document are typeset. Also, the value |
| 424 |
may be changed inside a surrounding group, which affects only the |
| 425 |
adtree to be typeset, but not the rest of the document. |
| 426 |
|
| 427 |
Finally, the value of \verb|\unitlength| can be changed within the |
| 428 |
adtree, to affect the point where the change appears and all the |
| 429 |
subtrees. Notice how there is no way to directly change the value of |
| 430 |
\verb|\unitlength| in a single node: we will return on this point |
| 431 |
later. |
| 432 |
|
| 433 |
For example, |
| 434 |
\begin{equation*} |
| 435 |
{\unitlength.28ex |
| 436 |
\ATl{with}{I^3_3} |
| 437 |
{\ATs{the key}{O_3}} |
| 438 |
{\ATre{I^3_2} |
| 439 |
{\ATs{the door}{O_2}} |
| 440 |
{\ATs{will be opened}{I^3}}} } |
| 441 |
\end{equation*} |
| 442 |
has been typeset adopting the strategy to affect all the branches in |
| 443 |
the adtree: |
| 444 |
\begin{verbatim} |
| 445 |
{\unitlength.3ex |
| 446 |
\ATl{with}{I^3_3}{\ATs{the key}{O_3}} |
| 447 |
{\ATre{I^3_2} |
| 448 |
{\ATs{the door}{O_2}} |
| 449 |
{\ATs{will be opened}{I^3}}} } |
| 450 |
\end{verbatim} |
| 451 |
|
| 452 |
On the contrary, |
| 453 |
\begin{verbatim} |
| 454 |
\unitlength.31ex |
| 455 |
\ATl{with}{I^3_3} |
| 456 |
{\unitlength.12ex\ATxl{\ATbe{O_3} |
| 457 |
{\ATm{the}{A}} |
| 458 |
{\ATm{key}{O}}}} |
| 459 |
{\unitlength.28ex\ATre{I^3_2} |
| 460 |
{\ATs{the door}{O_2}} |
| 461 |
{\ATs{will be opened}{I^3}}} |
| 462 |
\end{verbatim} |
| 463 |
modifies the length of all the branches in the left subtree to |
| 464 |
\verb|3ex| (since $3 = 25 \cdot 0.12$), and to \verb|7ex| in the |
| 465 |
right subtree, while the outer branches have a length of |
| 466 |
\verb|7.75ex|, obtaining |
| 467 |
\begin{equation*} |
| 468 |
\unitlength.31ex |
| 469 |
\ATl{with}{I^3_3} |
| 470 |
{\unitlength.12ex\ATxl{\ATbe{O_3} |
| 471 |
{\ATm{the}{A}} |
| 472 |
{\ATm{key}{O}}}} |
| 473 |
{\unitlength.28ex\ATre{I^3_2} |
| 474 |
{\ATs{the door}{O_2}} |
| 475 |
{\ATs{will be opened}{I^3}}} |
| 476 |
\end{equation*} |
| 477 |
|
| 478 |
The adposition, and the related arrow and grammar character are moved |
| 479 |
accordingly, which is not pleasant in this example, although it is |
| 480 |
what one usually wants when changing the value of \verb|\unitlength| |
| 481 |
in the whole adtree. |
| 482 |
|
| 483 |
The right way to have the adposition always in the same place with |
| 484 |
respect to the branches in a node, is to fix a suitable |
| 485 |
\verb|\unitlength| for the whole adtree, and to extend locally, just |
| 486 |
in the single node, its value. The exact technique is a bit complex, |
| 487 |
and it will be explained by an example later. Usually, there is no |
| 488 |
need to cope with these minor details, except for maniacs or for high |
| 489 |
precision works.\vspace{1.5ex} |
| 490 |
|
| 491 |
The length of branches can be changed locally to a single node, |
| 492 |
without recursively affecting the subtrees, as it happens when we |
| 493 |
change the value of \verb|\unitlength| inside a node, like in the |
| 494 |
latest example. This can be achieved using the length variant of the |
| 495 |
adtree drawing commands. There are also an angle variant, and a |
| 496 |
variant affecting both the length and the angle. |
| 497 |
The complete list of complex adtree drawing commands, with all the |
| 498 |
variants is in Table~\ref{tab:1} |
| 499 |
\begin{table} |
| 500 |
\begin{center} |
| 501 |
\begin{tabular}{cccc}\renewcommand{\arraystretch}{1.3} |
| 502 |
\textbf{base command} & \textbf{length variant} & \textbf{angle |
| 503 |
variant} & \textbf{combined variant}\\ |
| 504 |
\hline\hline |
| 505 |
\multicolumn{4}{c}{{\huge\strut}\emph{plain adtrees}}\\ |
| 506 |
\verb|\ATl| & \verb|\ATlL| & \verb|\ATlA| & \verb|\ATlLA|\\ |
| 507 |
\verb|\ATr| & \verb|\ATrL| & \verb|\ATrA| & \verb|\ATrLA|\\ |
| 508 |
\verb|\ATb| & \verb|\ATbL| & \verb|\ATbA| & \verb|\ATbLA|\\ |
| 509 |
\hline |
| 510 |
\multicolumn{4}{c}{{\huge\strut}\emph{extensions}}\\ |
| 511 |
\verb|\ATxl| & \verb|\ATxlL| & \verb|\ATxlA| & \verb|\ATxlLA|\\ |
| 512 |
\verb|\ATxr| & \verb|\ATxrL| & \verb|\ATxrA| & \verb|\ATxrLA|\\ |
| 513 |
\hline |
| 514 |
\multicolumn{4}{c}{{\huge\strut}\emph{adtrees with special |
| 515 |
adpositions}}\\ |
| 516 |
\verb|\ATle| & \verb|\ATleL| & \verb|\ATleA| & \verb|\ATleLA|\\ |
| 517 |
\verb|\ATlc| & \verb|\ATlcL| & \verb|\ATlcA| & \verb|\ATlcLA|\\ |
| 518 |
\verb|\ATlmu| & \verb|\ATlmuL| & \verb|\ATlmuA| & \verb|\ATlmuLA|\\ |
| 519 |
\verb|\ATre| & \verb|\ATreL| & \verb|\ATreA| & \verb|\ATreLA|\\ |
| 520 |
\verb|\ATrc| & \verb|\ATrcL| & \verb|\ATrcA| & \verb|\ATrcLA|\\ |
| 521 |
\verb|\ATrmu| & \verb|\ATrmuL| & \verb|\ATrmuA| & \verb|\ATrmuLA|\\ |
| 522 |
\verb|\ATbe| & \verb|\ATbeL| & \verb|\ATbeA| & \verb|\ATbeLA|\\ |
| 523 |
\verb|\ATbc| & \verb|\ATbcL| & \verb|\ATbcA| & \verb|\ATbcLA|\\ |
| 524 |
\verb|\ATbmu| & \verb|\ATbmuL| & \verb|\ATbmuA| & \verb|\ATbmuLA|\\ |
| 525 |
\hline |
| 526 |
\end{tabular} |
| 527 |
\end{center} |
| 528 |
\caption{Complex adtrees drawing command.}\label{tab:1} |
| 529 |
\end{table} |
| 530 |
|
| 531 |
The names of these commands are easy to remember: the length variant |
| 532 |
has a trailing \verb|L|, the angle variant a trailing \verb|A|, and |
| 533 |
the combined variant a trailing \verb|LA|. |
| 534 |
|
| 535 |
The syntax of the length variant is the same as the base command |
| 536 |
except that there is an additional argument, the first one, which |
| 537 |
contains the value for the local \verb|\unitlength|. In fact, the |
| 538 |
length we specify has exactly the same effect of changing |
| 539 |
\verb|\unitlength| just before the command, but the change does not |
| 540 |
apply recursively. |
| 541 |
|
| 542 |
It is worth remarking that, e.g., \verb|\ATlL{\unitlength}| is |
| 543 |
equivalent to \verb|\ATl|, so to reduce the length of branches to |
| 544 |
$90\%$ of their current value, it suffices the write something like |
| 545 |
\verb|\ATrL{.9\unitlength}|. |
| 546 |
|
| 547 |
Similarly, the syntax of the angle variant requires an additional |
| 548 |
first argument which can be $60$, $90$, or $120$, representing the |
| 549 |
angle between the branches: the default is $60$ degrees. Specifying |
| 550 |
any other values resorts to the default. |
| 551 |
|
| 552 |
The combined variant requires two additional arguments, the length and |
| 553 |
the angle, in this order, before any other parameter.\vspace*{1.5ex} |
| 554 |
|
| 555 |
A hidden, very technical, feature of the package is that, whatever |
| 556 |
follows the length in the \verb|L| argument gets evaluated inside the |
| 557 |
group which generates the branches in the node. So, for those well |
| 558 |
inside \LaTeX\/ mysteries, this feature can be used to tweak the |
| 559 |
behaviour of the graphical engine.\vspace{1.5ex} |
| 560 |
|
| 561 |
For example, |
| 562 |
\begin{equation*} |
| 563 |
\ATlL{.4ex}{with}{I^3_3} |
| 564 |
{\ATbe{O_3} |
| 565 |
{\ATm{the}{A}} |
| 566 |
{\ATm{key}{O}}} |
| 567 |
{\ATreL{.25ex}{I^3_2} |
| 568 |
{\ATs{the door}{O_2}} |
| 569 |
{\ATs{will be opened}{I^3}}} |
| 570 |
\end{equation*} |
| 571 |
has been typeset by |
| 572 |
\begin{verbatim} |
| 573 |
\ATlL{.4ex}{with}{I^3_3} |
| 574 |
{\ATbe{O_3} |
| 575 |
{\ATm{the}{A}} |
| 576 |
{\ATm{key}{O}}} |
| 577 |
{\ATreL{.25ex}{I^3_2} |
| 578 |
{\ATs{the door}{O_2}} |
| 579 |
{\ATs{will be opened}{I^3}}} |
| 580 |
\end{verbatim}\vspace{1.5ex} |
| 581 |
|
| 582 |
The \emph{trick} to have the adposition always in the same place we |
| 583 |
speak before, is now easy to write, although slightly |
| 584 |
cumbersome. Specifically, the trick is to choose a reasonable global |
| 585 |
value for \verb|\unitlength| which affects all the adtree, and then to |
| 586 |
locally extend the branches with the \verb|\ATxlL| and \verb|\ATxrL| |
| 587 |
commands whenever there is a need. The sensible choice for |
| 588 |
\verb|\unitlength| minimises the number of extensions, and nicely |
| 589 |
place the adpositions. For example |
| 590 |
\begin{verbatim} |
| 591 |
{\unitlength.32ex |
| 592 |
\ATl{with}{I^3_3} |
| 593 |
{\ATxlL{.1ex} |
| 594 |
{\ATbe{O_3} |
| 595 |
{\ATm{the}{A}} |
| 596 |
{\ATm{key}{O}}}} |
| 597 |
{\ATxrL{.2ex} |
| 598 |
{\ATre{I^3_2} |
| 599 |
{\ATs{the door}{O_2}} |
| 600 |
{\ATs{will be opened}{I^3}}}}} |
| 601 |
\end{verbatim} |
| 602 |
generates |
| 603 |
\begin{equation*} |
| 604 |
{\unitlength.3ex |
| 605 |
\ATl{with}{I^3_3} |
| 606 |
{\ATxlL{.1ex}{\ATbe{O_3} |
| 607 |
{\ATm{the}{A}} |
| 608 |
{\ATm{key}{O}}}} |
| 609 |
{\ATxrL{.2ex}{\ATre{I^3_2} |
| 610 |
{\ATs{the door}{O_2}} |
| 611 |
{\ATs{will be opened}{I^3}}}}} |
| 612 |
\end{equation*}\vspace{1.5ex} |
| 613 |
|
| 614 |
Another possibility to change the geometry of adtrees is to modify the |
| 615 |
angle between the branches. The commands to change the angle in the |
| 616 |
whole document, or within any group, affecting just the content of the |
| 617 |
group, are \verb|\ATnormalangle|, which sets the angle to $60$ |
| 618 |
degrees, the default, \verb|\ATwideangle|, which sets the angle to |
| 619 |
$90$ degrees, and \verb|\ATextrawideangle|, which sets the angle to |
| 620 |
$120$ degrees. These values are the only possible ones, also in the |
| 621 |
angle variant of the commands, as said before. Moreover, the value |
| 622 |
$60$, $90$, or $120$ passed to the angle variant of a command (or to |
| 623 |
the combined variant) affects the node locally, as in the length |
| 624 |
variants' case. |
| 625 |
|
| 626 |
For example |
| 627 |
\begin{equation*} |
| 628 |
{\ATwideangle\unitlength.3ex |
| 629 |
\ATl{with}{I^3_3} |
| 630 |
{\ATbe{O_3} |
| 631 |
{\ATm{the}{A}} |
| 632 |
{\ATm{key}{O}}} |
| 633 |
{\ATxrL{.2ex}{\ATre{I^3_2} |
| 634 |
{\ATs{the door}{O_2}} |
| 635 |
{\ATs{will be opened}{I^3}}}} } |
| 636 |
\end{equation*} |
| 637 |
has been typeset by |
| 638 |
\begin{verbatim} |
| 639 |
{\ATwideangle\unitlength.3ex |
| 640 |
\ATl{with}{I^3_3} |
| 641 |
{\ATbe{O_3} |
| 642 |
{\ATm{the}{A}} |
| 643 |
{\ATm{key}{O}}} |
| 644 |
{\ATxrL{.2ex}{\ATre{I^3_2} |
| 645 |
{\ATs{the door}{O_2}} |
| 646 |
{\ATs{will be opened}{I^3}}}} } |
| 647 |
\end{verbatim} |
| 648 |
|
| 649 |
However, the following adtree |
| 650 |
\begin{equation*} |
| 651 |
\ATlLA{.5ex}{120}{with}{I^3_3} |
| 652 |
{\ATbe{O_3} |
| 653 |
{\ATm{the}{A}} |
| 654 |
{\ATm{key}{O}}} |
| 655 |
{\ATreL{.25ex}{I^3_2} |
| 656 |
{\ATs{the door}{O_2}} |
| 657 |
{\ATs{will be opened}{I^3}}} |
| 658 |
\end{equation*} |
| 659 |
has been generated by |
| 660 |
\begin{verbatim} |
| 661 |
\ATlLA{.5ex}{120}{with}{I^3_3} |
| 662 |
{\ATbe{O_3} |
| 663 |
{\ATm{the}{A}} |
| 664 |
{\ATm{key}{O}}} |
| 665 |
{\ATreL{.25ex}{I^3_2} |
| 666 |
{\ATs{the door}{O_2}} |
| 667 |
{\ATs{will be opened}{I^3}}} |
| 668 |
\end{verbatim} |
| 669 |
|
| 670 |
The placement of the adposition varies when the angle is changed: this |
| 671 |
has been done on purpose to cope with the reduction in height which is |
| 672 |
induced by a larger angle between the branches. Notice how the |
| 673 |
reduction in height may cause the adposition part of the adtree to |
| 674 |
fall beyond the base of the branches. |
| 675 |
|
| 676 |
% -------------------------- |
| 677 |
\clearpage |
| 678 |
\section{Internal Constructions}\label{sec:internal} |
| 679 |
All the major parts of an adtree can be customised. This section |
| 680 |
describes a number of definitions which are used to control the |
| 681 |
spacing between the various parts of morpheme blocks, summaries, and |
| 682 |
adposition blocks. Also, the boxes which are deputed to provide a |
| 683 |
format to a single morpheme, a grammar character, or an attribute, are |
| 684 |
described.\vspace{1.5ex} |
| 685 |
|
| 686 |
The shape of the adposition block, which lies just below the root of a |
| 687 |
node in the adtree, is synthetically described as: |
| 688 |
\begin{equation*} |
| 689 |
{\unitlength2ex |
| 690 |
\begin{picture}(14,14) |
| 691 |
\thinlines |
| 692 |
\put( 0, 2){\line(1,0){14}} |
| 693 |
\put( 0, 4){\line(1,0){14}} |
| 694 |
\put( 0, 6){\line(1,0){14}} |
| 695 |
\put( 0, 8){\line(1,0){14}} |
| 696 |
\put( 0,10){\line(1,0){14}} |
| 697 |
\put( 0,12){\line(1,0){14}} |
| 698 |
\put( 7,13){\makebox(0,0){pre skip}} |
| 699 |
\put( 7,11){\makebox(0,0){$t$}} |
| 700 |
\put( 7, 9){\makebox(0,0){first intermediate skip}} |
| 701 |
\put( 7, 7){\makebox(0,0){$a$}} |
| 702 |
\put( 7, 5){\makebox(0,0){second intermediate skip}} |
| 703 |
\put( 7, 3){\makebox(0,0){$g + x$}} |
| 704 |
\put( 7, 1){\makebox(0,0){post skip}} |
| 705 |
\thicklines |
| 706 |
\put( 0, 0){\line(1,0){14}} |
| 707 |
\put( 0,14){\line(1,0){14}} |
| 708 |
\put( 0, 0){\line(0,1){14}} |
| 709 |
\put(14, 0){\line(0,1){14}} |
| 710 |
\end{picture}} |
| 711 |
\qquad\qquad\qquad |
| 712 |
\raisebox{6ex}{\ATb{$a$}{g}[x]{\ATm{}{}}{\ATm{}{}}} |
| 713 |
\end{equation*} |
| 714 |
Here, $t$ stands for the trajectory, one of $\leftarrow$, |
| 715 |
$\rightarrow$, or $\leftrightarrow$, as in the exemplifying adtree |
| 716 |
above; $a$ is the adposition; $g$ is the grammar character; $x$ is an |
| 717 |
attribute. The various skips are \LaTeX\/ commands deputed to add |
| 718 |
vertical space between the components. |
| 719 |
|
| 720 |
These commands, together with their definition, are: |
| 721 |
\begin{verbatim} |
| 722 |
\def\ATpreadpositionskip{\relax} |
| 723 |
\def\ATfirstinteradpositionskip{\vskip.3ex} |
| 724 |
\def\ATsecondinteradpositionskip{\vskip.3ex} |
| 725 |
\def\ATpostadpositionskip{\relax} |
| 726 |
\end{verbatim} |
| 727 |
They can be redefined globally, to affect all the adtrees following |
| 728 |
the redefinition, or locally, within a group which limits the |
| 729 |
scope. For example, the following adtree |
| 730 |
\begin{equation*} |
| 731 |
{\def\ATpreadpositionskip{\vskip-2ex} |
| 732 |
\ATrL{.3ex}{to}{I_2^2} |
| 733 |
{\ATm{Kim}{O_2}} |
| 734 |
{\ATs{The box belongs}{I^2_1}}} |
| 735 |
\end{equation*} |
| 736 |
has been obtained by the code |
| 737 |
\begin{verbatim} |
| 738 |
{\def\ATpreadpositionskip{\vskip-2ex} |
| 739 |
\ATrL{.3ex}{to}{I_2^2} |
| 740 |
{\ATm{Kim}{O_2}} |
| 741 |
{\ATs{The box belongs}{I^2_1}}} |
| 742 |
\end{verbatim} |
| 743 |
|
| 744 |
The \verb|L| hidden feature of the package, already introduced, which |
| 745 |
injects code into the macro expansion, allows to redefine these |
| 746 |
commands within the scope of a single node, as in the root of |
| 747 |
\begin{equation*} |
| 748 |
\ATrL{\unitlength\def\ATpreadpositionskip{\vskip-2ex}} |
| 749 |
{to}{I_2^2}{\ATm{Kim}{O}} |
| 750 |
{\ATbe{I_1^2}{\ATs{The box}{O_1}}{\ATm{belongs}{I^2_1}}} |
| 751 |
\end{equation*} |
| 752 |
This effect is obtained by the following code |
| 753 |
\begin{verbatim} |
| 754 |
\ATrL{\unitlength\def\ATpreadpositionskip{\vskip-2ex}} |
| 755 |
{to}{I_2^2} |
| 756 |
{\ATm{Kim}{O_2}} |
| 757 |
{\ATbe{I_1^2}{\ATs{The box}{O_1}}{\ATm{belongs}{I^2}}} |
| 758 |
\end{verbatim}\vspace{1.5ex} |
| 759 |
|
| 760 |
Attributes are managed so to form a unique block together with the |
| 761 |
grammar character. This block is constructed by the \verb|\ATm| and |
| 762 |
\verb|\ATs| commands, and inside the previously described adposition |
| 763 |
block. |
| 764 |
|
| 765 |
It is important to remark that, although the size of text is normal in |
| 766 |
the case of the morpheme and summary blocks, and while it is small in |
| 767 |
the case of the adposition block, the values of skips are not affected |
| 768 |
by the size. Thus, we strongly suggest, if you want to change them, to |
| 769 |
express these values in the \verb|ex| unit, which is the right unit to |
| 770 |
measure vertical space in terms of the \emph{current} font size. |
| 771 |
|
| 772 |
The structure of the attribute block is |
| 773 |
\begin{equation*} |
| 774 |
{\unitlength2ex |
| 775 |
\begin{picture}(14,14) |
| 776 |
\thinlines |
| 777 |
\put( 0, 2){\line(1,0){14}} |
| 778 |
\put( 0, 4){\line(1,0){14}} |
| 779 |
\put( 0, 6){\line(1,0){14}} |
| 780 |
\put( 0, 8){\line(1,0){14}} |
| 781 |
\put( 0,10){\line(1,0){14}} |
| 782 |
\put( 0,12){\line(1,0){14}} |
| 783 |
\put( 7,13){\makebox(0,0){$g$}} |
| 784 |
\put( 7,11){\makebox(0,0){first skip}} |
| 785 |
\put( 7, 9){\makebox(0,0){$a_1$}} |
| 786 |
\put( 7, 7){\makebox(0,0){intermediate skip}} |
| 787 |
\put( 7, 5){\makebox(0,0){$\vdots$}} |
| 788 |
\put( 7, 3){\makebox(0,0){intermediate skip}} |
| 789 |
\put( 7, 1){\makebox(0,0){$a_n$}} |
| 790 |
\thicklines |
| 791 |
\put( 0, 0){\line(1,0){14}} |
| 792 |
\put( 0,14){\line(1,0){14}} |
| 793 |
\put( 0, 0){\line(0,1){14}} |
| 794 |
\put(14, 0){\line(0,1){14}} |
| 795 |
\end{picture}} |
| 796 |
\qquad\qquad\qquad |
| 797 |
{\def\ATAttributeBox#1{\strut\textsf{#1}} |
| 798 |
\raisebox{20ex}{\ATm{}{g}[\lbrack$a_1$\rbrack] |
| 799 |
[\vdots] |
| 800 |
[\lbrack$a_n$\rbrack]} } |
| 801 |
\end{equation*} |
| 802 |
Here, $g$ is the grammar character, while $a_1, \dots, a_n$ are the |
| 803 |
various attributes. The commands defining the skips in this block are |
| 804 |
\begin{verbatim} |
| 805 |
\def\ATfirstattrskip{\vskip.7ex} |
| 806 |
\def\ATinterattrskip{\vskip.5ex} |
| 807 |
\end{verbatim} |
| 808 |
These definitions can be changed globally or locally, within the scope |
| 809 |
of a group. Also, in the case of attributes in the adposition block, |
| 810 |
they can be redefined within the single node, with the same technique |
| 811 |
as before. |
| 812 |
|
| 813 |
It is worth remarking that any kind of material can be generated by |
| 814 |
these commands, not only vertical space. For example |
| 815 |
\begin{equation*} |
| 816 |
{\makeatletter |
| 817 |
\def\ATfirstattrskip{\vskip.5ex |
| 818 |
\hbox to\@ATlen{\hfil\tiny * * *\hfil}\nointerlineskip |
| 819 |
\vskip.3ex} |
| 820 |
\makeatother |
| 821 |
\ATbe{O}[determ] |
| 822 |
{\ATm{the}{A}} |
| 823 |
{\ATm{box}{O}}} |
| 824 |
\end{equation*} |
| 825 |
has been generated by |
| 826 |
\begin{verbatim} |
| 827 |
{\makeatletter |
| 828 |
\def\ATfirstattrskip{\vskip.5ex |
| 829 |
\hbox to\@ATlen{\hfil\tiny * * *\hfil}\nointerlineskip |
| 830 |
\vskip.3ex} |
| 831 |
\makeatother |
| 832 |
\ATbe{O}[determ] |
| 833 |
{\ATm{the}{A}} |
| 834 |
{\ATm{box}{O}}} |
| 835 |
\end{verbatim}\vspace{1.5ex} |
| 836 |
|
| 837 |
Finally, morpheme and summary blocks are as follows: |
| 838 |
\begin{equation*} |
| 839 |
{\unitlength2ex |
| 840 |
\begin{picture}(14,12) |
| 841 |
\thinlines |
| 842 |
\put( 0, 2){\line(1,0){14}} |
| 843 |
\put( 0, 4){\line(1,0){14}} |
| 844 |
\put( 0, 6){\line(1,0){14}} |
| 845 |
\put( 0, 8){\line(1,0){14}} |
| 846 |
\put( 0,10){\line(1,0){14}} |
| 847 |
\put( 7,11){\makebox(0,0){$\triangle$, if a summary}} |
| 848 |
\put( 7, 9){\makebox(0,0){pre skip}} |
| 849 |
\put( 7, 7){\makebox(0,0){$m$}} |
| 850 |
\put( 7, 5){\makebox(0,0){intermediate skip}} |
| 851 |
\put( 7, 3){\makebox(0,0){$g + x$}} |
| 852 |
\put( 7, 1){\makebox(0,0){post skip}} |
| 853 |
\thicklines |
| 854 |
\put( 0, 0){\line(1,0){14}} |
| 855 |
\put( 0,12){\line(1,0){14}} |
| 856 |
\put( 0, 0){\line(0,1){12}} |
| 857 |
\put(14, 0){\line(0,1){12}} |
| 858 |
\end{picture}} |
| 859 |
\qquad\qquad |
| 860 |
\raisebox{15ex}{\ATm{m}{g}[x]} |
| 861 |
\qquad |
| 862 |
\raisebox{14ex}{\ATs{m}{g}[x]} |
| 863 |
\end{equation*} |
| 864 |
Here, $m$ is the morpheme or expression, and $g$ is the grammar |
| 865 |
character together with its attributes $x$. The commands defining the |
| 866 |
skips in this block are |
| 867 |
\begin{verbatim} |
| 868 |
\def\ATpremorphemeskip{\vskip.5ex} |
| 869 |
\def\ATintermorphemeskip{\vskip1ex} |
| 870 |
\def\ATpostmorphemeskip{\relax} |
| 871 |
\end{verbatim} |
| 872 |
Again, these definitions can be modified globally, or locally, within |
| 873 |
a group that limits the scope of the change. It is worth remarking |
| 874 |
that nesting an \verb|\ATm| or \verb|\ATs| command inside a complex |
| 875 |
adtree provides a natural group. For example |
| 876 |
\begin{equation*} |
| 877 |
\ATbe{O} |
| 878 |
{\def\ATpremorphemeskip{\vskip0ex} |
| 879 |
\def\ATintermorphemeskip{\vskip.2ex} |
| 880 |
\ATm{the}{A}} |
| 881 |
{\ATm{box}{O}} |
| 882 |
\end{equation*} |
| 883 |
has been typeset by |
| 884 |
\begin{verbatim} |
| 885 |
\ATbe{O} |
| 886 |
{\def\ATpremorphemeskip{\vskip0ex} |
| 887 |
\def\ATintermorphemeskip{\vskip.2ex} |
| 888 |
\ATm{the}{A}} |
| 889 |
{\ATm{box}{O}} |
| 890 |
\end{verbatim}\vspace{1.5ex} |
| 891 |
|
| 892 |
Actually, the face of morphemes, adpositions, and expressions in |
| 893 |
summaries is controlled by the following command: |
| 894 |
\begin{verbatim} |
| 895 |
\def\ATMorphemeBox#1{#1\strut} |
| 896 |
\end{verbatim} |
| 897 |
The \verb|\strut| forces all the instances to have the same minimal |
| 898 |
height and depth. So, to typeset all the morphemes and summaries in |
| 899 |
italic, as in |
| 900 |
\begin{equation*} |
| 901 |
{\def\ATMorphemeBox#1{\textit{#1}\strut} |
| 902 |
\ATb{in}{E>I_2^2} |
| 903 |
{\ATs{the house}{O}} |
| 904 |
{\ATs{Kim moves}{I^2_1}} } |
| 905 |
\end{equation*} |
| 906 |
the following code suffices |
| 907 |
\begin{verbatim} |
| 908 |
{\def\ATMorphemeBox#1{\textit{#1}\strut} |
| 909 |
\ATb{in}{E>I_2^2} |
| 910 |
{\ATs{the house}{O}} |
| 911 |
{\ATs{Kim moves}{I^2_1}} } |
| 912 |
\end{verbatim}\vspace{1.5ex} |
| 913 |
|
| 914 |
Similarly, the face of grammar characters, wherever they appear, is |
| 915 |
controlled by the command |
| 916 |
\begin{verbatim} |
| 917 |
\def\ATGrammarCharacterBox#1{$\mathrm{#1}$} |
| 918 |
\end{verbatim} |
| 919 |
The same scoping rules apply as in the case of |
| 920 |
\verb|\ATMorphemeBox|. So, for example, we can make the grammar |
| 921 |
character of the left subtree to be \verb|\Huge|, as in |
| 922 |
\begin{equation*} |
| 923 |
\ATb{in}{E>I_2^2} |
| 924 |
{\def\ATGrammarCharacterBox#1{\Huge$\mathrm{#1}$} |
| 925 |
\ATs{the house}{O}} |
| 926 |
{\ATs{Kim move}{I_1^2}} |
| 927 |
\end{equation*} |
| 928 |
by typing the following code |
| 929 |
\begin{verbatim} |
| 930 |
\ATb{in}{E>I_2^2} |
| 931 |
{\def\ATGrammarCharacterBox#1{\Huge$\mathrm{#1}$} |
| 932 |
\ATs{the house}{O}} |
| 933 |
{\ATs{Kim moves}{I_1^2}} |
| 934 |
\end{verbatim}\vspace{1.5ex} |
| 935 |
|
| 936 |
Also attributes are typeset according to a command: |
| 937 |
\begin{verbatim} |
| 938 |
\def\ATAttributeBox#1{\textsf{[#1]}} |
| 939 |
\end{verbatim} |
| 940 |
So, for example, the illustrating attribute block on the previous page |
| 941 |
has been generated by the following code |
| 942 |
\begin{verbatim} |
| 943 |
{\def\ATAttributeBox#1{\strut\textsf{#1}} |
| 944 |
\raisebox{20ex}{\ATm{}{g}[\lbrack$a_1$\rbrack] |
| 945 |
[\vdots] |
| 946 |
[\lbrack$a_n$\rbrack]} } |
| 947 |
\end{verbatim}\vspace{1.5ex} |
| 948 |
|
| 949 |
Finally, the symbol denoting a summary can be customised by changing |
| 950 |
\begin{verbatim} |
| 951 |
\def\ATSummarySymbol{$\triangle$} |
| 952 |
\end{verbatim} |
| 953 |
It is important to remark that the top vertex of the triangle lies in |
| 954 |
the middle of the top of the $\triangle$ character, providing a |
| 955 |
natural point to join with the branches of adtrees. This fact should |
| 956 |
be taken in account when changing the definition. |
| 957 |
|
| 958 |
% -------------------------- |
| 959 |
\clearpage |
| 960 |
\section{Hints and Tricks}\label{sec:hints} |
| 961 |
There are a few last features which can be exploited in the |
| 962 |
\verb|adtrees| package. These are the low-level commands to draw the |
| 963 |
branches: |
| 964 |
\begin{verbatim} |
| 965 |
\def\ATleftbranch#1#2{\line(#1,#2)} |
| 966 |
\def\ATrightbranch#1#2{\line(#1,#2)} |
| 967 |
\def\ATcircle{\circle*} |
| 968 |
\end{verbatim} |
| 969 |
|
| 970 |
The \verb|\ATleftbranch| and \verb|\ATrightbranch| commands draw the |
| 971 |
left and the right branch of an adtree, respectively. Also, they draw |
| 972 |
the extensions, when present. They can be redefined globally, locally |
| 973 |
within the scope of a group, or locally within a node, using the |
| 974 |
implicit scope of the length variant, as previously described by the |
| 975 |
trick to equalise the position of adposition blocks. |
| 976 |
|
| 977 |
For example, |
| 978 |
\begin{equation*} |
| 979 |
\unitlength.26ex |
| 980 |
{\def\ATrightbranch#1#2{\color{red}\line(#1,#2)} |
| 981 |
\ATlL{\unitlength |
| 982 |
\def\ATleftbranch##1##2{\color{green}\line(##1,##2)}} |
| 983 |
{with}{I^3_3}{\ATs{the key}{O_3}} |
| 984 |
{\ATre{I^3_2} |
| 985 |
{\ATxl{\ATs{the door}{O_2}}} |
| 986 |
{\ATs{will be opened}{I^3}}} } |
| 987 |
\end{equation*} |
| 988 |
is obtained by making all the right branches red, and the topmost left |
| 989 |
branch green: |
| 990 |
\begin{verbatim} |
| 991 |
{\def\ATrightbranch#1#2{\color{red}\line(#1,#2)} |
| 992 |
\ATlL{\unitlength |
| 993 |
\def\ATleftbranch##1##2{\color{green}\line(##1,##2)}} |
| 994 |
{with}{I^3_3} |
| 995 |
{\ATs{the key}{O_3}} |
| 996 |
{\ATre{I^3_2} |
| 997 |
{\ATxl{\ATs{the door}{O_2}}} |
| 998 |
{\ATs{will be opened}{I^3}}} } |
| 999 |
\end{verbatim} |
| 1000 |
|
| 1001 |
Also, the following definition |
| 1002 |
\begin{verbatim} |
| 1003 |
{\def\ATcircle#1{\relax} |
| 1004 |
\ATl{with}{I^3_3} |
| 1005 |
{\ATs{the key}{O_3}} |
| 1006 |
{\ATre{I^3_2} |
| 1007 |
{\ATxl{\ATs{the door}{O_2}}} |
| 1008 |
{\ATs{will be opened}{I^3}}} } |
| 1009 |
\end{verbatim} |
| 1010 |
suppresses the points in the whole adtree |
| 1011 |
\begin{equation*} |
| 1012 |
\unitlength.2ex |
| 1013 |
{\def\ATcircle#1{\relax} |
| 1014 |
\ATl{with}{I^3_3} |
| 1015 |
{\ATs{the key}{O_3}} |
| 1016 |
{\ATre{I^3_2} |
| 1017 |
{\ATxl{\ATs{the door}{O_2}}} |
| 1018 |
{\ATs{will be opened}{I^3}}} } |
| 1019 |
\end{equation*} |
| 1020 |
|
| 1021 |
As a rather extreme and useless example, one can typeset the previous |
| 1022 |
adtree without showing the branches and making the points really huge |
| 1023 |
\begin{equation*} |
| 1024 |
{\def\ATcircle#1{\circle*{8}} |
| 1025 |
\def\ATleftbranch#1#2#3{\relax} |
| 1026 |
\def\ATrightbranch#1#2#3{\relax} |
| 1027 |
\unitlength.22ex |
| 1028 |
\ATl{with}{I^3_3} |
| 1029 |
{\ATs{the key}{O_3}} |
| 1030 |
{\ATre{I^3_2} |
| 1031 |
{\ATxl{\ATs{the door}{O_2}}} |
| 1032 |
{\ATs{will be opened}{I^3}}} } |
| 1033 |
\end{equation*} |
| 1034 |
by the following code |
| 1035 |
\begin{verbatim} |
| 1036 |
{\def\ATcircle#1{\circle*{8}} |
| 1037 |
\def\ATleftbranch#1#2#3{\relax} |
| 1038 |
\def\ATrightbranch#1#2#3{\relax} |
| 1039 |
\unitlength.22ex |
| 1040 |
\ATl{with}{I^3_3} |
| 1041 |
{\ATs{the key}{O_3}} |
| 1042 |
{\ATre{I^3_2} |
| 1043 |
{\ATxl{\ATs{the door}{O_2}}} |
| 1044 |
{\ATs{will be opened}{I^3}}} } |
| 1045 |
\end{verbatim}\vspace{1.5ex} |
| 1046 |
|
| 1047 |
Another important aspect of the package is that every adtree lies in a |
| 1048 |
\TeX\/ box. It means that all the standard commands to manipulate |
| 1049 |
boxes are available. |
| 1050 |
|
| 1051 |
For example |
| 1052 |
\begin{equation*} |
| 1053 |
\rotatebox{-30} |
| 1054 |
{\ATlcLA{.3ex}{90}{I_2^2} |
| 1055 |
{\ATs{\cancel{the apple}}{O_2}} |
| 1056 |
{\ATs{Kim eats}{I_1^2}}} |
| 1057 |
\end{equation*} |
| 1058 |
has been generated by |
| 1059 |
\begin{verbatim} |
| 1060 |
\rotatebox{-30} |
| 1061 |
{\ATlcLA{.3ex}{90}{I_2^2} |
| 1062 |
{\ATs{\cancel{the apple}}{O_2}} |
| 1063 |
{\ATs{Kim eats}{I_1^2}}} |
| 1064 |
\end{verbatim} |
| 1065 |
|
| 1066 |
Sometimes, scaling a box is required: |
| 1067 |
\begin{equation*} |
| 1068 |
\scalebox{1.5} |
| 1069 |
{\ATlcLA{.3ex}{90}{I_2^2} |
| 1070 |
{\ATs{\cancel{the apple}}{O_2}} |
| 1071 |
{\ATs{Kim eats}{I_1^2}}} |
| 1072 |
\end{equation*} |
| 1073 |
has been generated by |
| 1074 |
\begin{verbatim} |
| 1075 |
\scalebox{1.5} |
| 1076 |
{\ATlcLA{.3ex}{90}{I_2^2} |
| 1077 |
{\ATs{\cancel{the apple}}{O_2}} |
| 1078 |
{\ATs{Kim eats}{I_1^2}}} |
| 1079 |
\end{verbatim}\vspace{1.5ex} |
| 1080 |
|
| 1081 |
A final point is that, when the \verb|\smaller| command is available, |
| 1082 |
as in AMS-\TeX, changing the font size automatically makes the |
| 1083 |
adposition blocks to be \verb|\smaller| than the size of the normal |
| 1084 |
text, which is used to typeset the morpheme and summary blocks. For |
| 1085 |
example, |
| 1086 |
\begin{equation*} |
| 1087 |
\hbox{\huge |
| 1088 |
\ATlcLA{.3ex}{120}{I_2^2} |
| 1089 |
{\ATs{\cancel{the apple}}{O_2}} |
| 1090 |
{\ATs{Kim eats}{I_1^2}}} |
| 1091 |
\end{equation*} |
| 1092 |
which has been generated by |
| 1093 |
\begin{verbatim} |
| 1094 |
{\huge |
| 1095 |
\ATlcLA{.3ex}{120}{I_2^2} |
| 1096 |
{\ATs{\cancel{the apple}}{O_2}} |
| 1097 |
{\ATs{Kim eats}{I_1^2}}} |
| 1098 |
\end{verbatim} |
| 1099 |
|
| 1100 |
When the \verb|smaller| command is not available, the size of the |
| 1101 |
adposition block is fixed to be \verb|\small|. This can be changed |
| 1102 |
modifying the (internal) command \verb|\@ATsmall|: |
| 1103 |
\begin{verbatim} |
| 1104 |
\makeatletter |
| 1105 |
\def\@ATsmall{\small} |
| 1106 |
\makeatother |
| 1107 |
\end{verbatim} |
| 1108 |
Changing \verb|\small| in the above code, modifies the size of the |
| 1109 |
components of the adposition block. We suggest to avoid such a change, |
| 1110 |
except in a local group which contains a complete adtree.\vfill |
| 1111 |
|
| 1112 |
% -------------------------- |
| 1113 |
\clearpage |
| 1114 |
\section{Path-like Adtrees}\label{sec:pathlike} |
| 1115 |
Adtrees are abstract representation of pieces of text. When the |
| 1116 |
relation with an effective piece of text is relevant, a different |
| 1117 |
representation is preferred: path-like adtrees. For example, the |
| 1118 |
expression ``the girl for whom the man bought the book'' is rendered as |
| 1119 |
\begin{displaymath} |
| 1120 |
\begin{pathlikeadtree} |
| 1121 |
the [A] ( 1,1)[\overleftarrow{O}] & |
| 1122 |
girl [O] & |
| 1123 |
for [U] ( 5,4)[\overleftarrow{I^4_3}] & |
| 1124 |
wh- [U] (-2,6)[\overleftarrow{O}] & |
| 1125 |
om [O_2] (-2,1)[\overleftarrow{O_2}] & |
| 1126 |
the [A] ( 1,1)[\overleftarrow{O_1}] & |
| 1127 |
man [O_1] ( 1,2)[\overleftarrow{I^4_1}] & |
| 1128 |
bought [I^4_{\mathsf{dep}}] (-4,5)[\overrightarrow{A}] & |
| 1129 |
the [A] ( 1,1)[\overleftarrow{O_2}] & |
| 1130 |
book [O_2] (-2,3)[\overleftarrow{I^4_2}] |
| 1131 |
\end{pathlikeadtree} |
| 1132 |
\end{displaymath} |
| 1133 |
from the code |
| 1134 |
\begin{verbatim} |
| 1135 |
\begin{pathlikeadtree} |
| 1136 |
the [A] ( 1,1)[\overleftarrow{O}] & |
| 1137 |
girl [O] & |
| 1138 |
for [U] ( 5,4)[\overleftarrow{I^4_3}] & |
| 1139 |
wh- [U] (-2,6)[\overleftarrow{O}] & |
| 1140 |
om [O_2] (-2,1)[\overleftarrow{O_2}] & |
| 1141 |
the [A] ( 1,1)[\overleftarrow{O_1}] & |
| 1142 |
man [O_1] ( 1,2)[\overleftarrow{I^4_1}] & |
| 1143 |
bought [I^4_{\mathsf{dep}}] (-4,5)[\overrightarrow{A}] & |
| 1144 |
the [A] ( 1,1)[\overleftarrow{O_2}] & |
| 1145 |
book [O_2] (-2,3)[\overleftarrow{I^4_2}] |
| 1146 |
\end{pathlikeadtree} |
| 1147 |
\end{verbatim} |
| 1148 |
|
| 1149 |
To write a path-like adtree one encloses it into a |
| 1150 |
\verb!pathlikeadtree! environment. Then, each \emph{cell} is written. |
| 1151 |
Cells are separated by \verb|&|. A cell is composed by a |
| 1152 |
\emph{morpheme}, a \emph{grammar character}, and one or more |
| 1153 |
\emph{arcs}. The morpheme $m$ comes first with his grammar character |
| 1154 |
following in square brackets: |
| 1155 |
\begin{verbatim} |
| 1156 |
\begin{pathlikeadtree} |
| 1157 |
morhpeme [G] |
| 1158 |
\end{pathlikeadtree} |
| 1159 |
\end{verbatim} |
| 1160 |
produces |
| 1161 |
\begin{displaymath} |
| 1162 |
\begin{pathlikeadtree} |
| 1163 |
morhpeme [G] |
| 1164 |
\end{pathlikeadtree} |
| 1165 |
\end{displaymath} |
| 1166 |
|
| 1167 |
An arc is specified as \verb|(|$t$\verb|,|$h$\verb|)[|$g$\verb|]| |
| 1168 |
where $t$ is the \emph{target}, i.e., the node to which the arc is |
| 1169 |
directed, $h$ is the \emph{height} of the arc, which \textbf{must} be |
| 1170 |
a positive integer, and $g$ is the \emph{grammar character} of the |
| 1171 |
composition of expressions which the arc intend to represent. It |
| 1172 |
should be remarked that there \textbf{must} be no space between |
| 1173 |
\verb|)| and \verb|[|. For example, |
| 1174 |
\begin{displaymath} |
| 1175 |
\begin{pathlikeadtree} |
| 1176 |
the[A](1,1)[\overleftarrow{O}] & |
| 1177 |
girl[O]&for[U]&wh-[U]&om[O_2]&the[A]&man[O_1]& |
| 1178 |
bought[I^4_{\mathsf{dep}}]&the[A]&book[O_2] |
| 1179 |
\end{pathlikeadtree} |
| 1180 |
\end{displaymath} |
| 1181 |
has been typeset by |
| 1182 |
\begin{verbatim} |
| 1183 |
\begin{pathlikeadtree} |
| 1184 |
the[A](1,1)[\overleftarrow{O}] & |
| 1185 |
girl[O]&for[U]&wh-[U]&om[O_2]&the[A]&man[O_1]& |
| 1186 |
bought[I^4_{\mathsf{dep}}]&the[A]&book[O_2] |
| 1187 |
\end{pathlikeadtree} |
| 1188 |
\end{verbatim} |
| 1189 |
|
| 1190 |
The target uses a \emph{relative} specification: in the example, it is |
| 1191 |
one step forward with respect to the node it has been written into. Of |
| 1192 |
course, going backwards is possible, by using a negative value for the |
| 1193 |
target: |
| 1194 |
\begin{displaymath} |
| 1195 |
\begin{pathlikeadtree} |
| 1196 |
the[A]&girl[O]&for[U]& |
| 1197 |
wh-[U] (-2,2)[\overleftarrow{O}] & |
| 1198 |
om[O_2]&the[A]&man[O_1]&bought[I^4_{\mathsf{dep}}]& |
| 1199 |
the[A]&book[O_2] |
| 1200 |
\end{pathlikeadtree} |
| 1201 |
\end{displaymath} |
| 1202 |
\begin{verbatim} |
| 1203 |
\begin{pathlikeadtree} |
| 1204 |
the[A]&girl[O]&for[U]& |
| 1205 |
wh-[U] (-2,2)[\overleftarrow{O}] & |
| 1206 |
om[O_2]&the[A]&man[O_1]&bought[I^4_{\mathsf{dep}}]& |
| 1207 |
the[A]&book[O_2] |
| 1208 |
\end{pathlikeadtree} |
| 1209 |
\end{verbatim} |
| 1210 |
However, it is possible to specify an \emph{absolute} position |
| 1211 |
prepending a \verb|!| to the target: |
| 1212 |
\begin{verbatim} |
| 1213 |
\begin{pathlikeadtree} |
| 1214 |
the[A]&girl[O]& |
| 1215 |
for[U] (!8,1)[\overleftarrow{I^4_3}] & |
| 1216 |
wh-[U]&om[O_2]&the[A]&man[O_1]& |
| 1217 |
bought[I^4_{\mathsf{dep}}]&the[A]&book[O_2] |
| 1218 |
\end{pathlikeadtree} |
| 1219 |
\end{verbatim} |
| 1220 |
\begin{displaymath} |
| 1221 |
\begin{pathlikeadtree} |
| 1222 |
the[A]&girl[O]& |
| 1223 |
for[U] (!8,1)[\overleftarrow{I^4_3}] & |
| 1224 |
wh-[U]&om[O_2]&the[A]&man[O_1]& |
| 1225 |
bought[I^4_{\mathsf{dep}}]&the[A]&book[O_2] |
| 1226 |
\end{pathlikeadtree} |
| 1227 |
\end{displaymath} |
| 1228 |
|
| 1229 |
The appearance of a path-like adtree is controlled by a number of |
| 1230 |
parameters which the user may customise: |
| 1231 |
\begin{itemize} |
| 1232 |
\item \verb|\ATpathinterskip| (default: \verb|.5em|) is the distance |
| 1233 |
between two cells; |
| 1234 |
\item \verb|\ATpathunitlength| (default: \verb|4ex|) corresponds to |
| 1235 |
the length of a line of height $1$; |
| 1236 |
\item \verb|\ATpicskip| (default: \verb|.2ex|) is the distance between |
| 1237 |
the upper text and the arcs below; |
| 1238 |
\item \verb|\ATpathlinethickness| (default: \verb|.1em|) specifies the |
| 1239 |
thickness of the arcs; |
| 1240 |
\item \verb|\ATpathlabelhspace| (default: \verb|.3em|) defines the |
| 1241 |
horizontal space between the grammar character in an arc and the |
| 1242 |
vertical line of the arc to which it is closer; |
| 1243 |
\item \verb|\ATpathlabelvspace| (default: \verb|1ex|) defines the |
| 1244 |
vertical space between the baseline of the grammar character in an |
| 1245 |
arc and the horizontal line of the arc. |
| 1246 |
\end{itemize} |
| 1247 |
Finally, the way in which the grammar characters are written is |
| 1248 |
customisable by changing their default boxes. They are defined as |
| 1249 |
\begin{verbatim} |
| 1250 |
\def\ATnGCBox#1{\@ATsmall$\mathrm{#1}$} |
| 1251 |
\def\ATlGCBox#1{\@ATsmall$\mathrm{#1}$} |
| 1252 |
\end{verbatim} |
| 1253 |
with \verb|\ATnGCBox| controlling the rendering of the part below each |
| 1254 |
morpheme, and \verb|\ATlGCBox| controlling the labels of the arcs. |
| 1255 |
|
| 1256 |
As an example, |
| 1257 |
\begin{displaymath} |
| 1258 |
\ATpathinterskip1.2em |
| 1259 |
\ATpathunitlength4.5ex |
| 1260 |
\ATpicskip1ex |
| 1261 |
\ATpathlinethickness.2pt |
| 1262 |
\ATpathlabelhspace1em |
| 1263 |
\ATpathlabelvspace2ex |
| 1264 |
\begin{pathlikeadtree} |
| 1265 |
the [A] ( 1,1)[\overleftarrow{O}] & |
| 1266 |
girl [O] & |
| 1267 |
for [U] ( 5,4)[\overleftarrow{I^4_3}] & |
| 1268 |
wh- [U] (-2,6)[\overleftarrow{O}] & |
| 1269 |
om [O_2] (-2,1)[\overleftarrow{O_2}] & |
| 1270 |
the [A] ( 1,1)[\overleftarrow{O_1}] & |
| 1271 |
man [O_1] ( 1,2)[\overleftarrow{I^4_1}] & |
| 1272 |
bought [I^4_{\mathsf{dep}}] (-4,5)[\overrightarrow{A}] & |
| 1273 |
the [A] ( 1,1)[\overleftarrow{O_2}] & |
| 1274 |
book [O_2] (-2,3)[\overleftarrow{I^4_2}] |
| 1275 |
\end{pathlikeadtree} |
| 1276 |
\end{displaymath} |
| 1277 |
has been typeset by |
| 1278 |
\begin{verbatim} |
| 1279 |
\ATpathinterskip1.2em |
| 1280 |
\ATpathunitlength4.5ex |
| 1281 |
\ATpicskip1ex |
| 1282 |
\ATpathlinethickness.2pt |
| 1283 |
\ATpathlabelhspace1em |
| 1284 |
\ATpathlabelvspace2ex |
| 1285 |
\begin{pathlikeadtree} |
| 1286 |
the [A] ( 1,1)[\overleftarrow{O}] & |
| 1287 |
girl [O] & |
| 1288 |
for [U] ( 5,4)[\overleftarrow{I^4_3}] & |
| 1289 |
wh- [U] (-2,6)[\overleftarrow{O}] & |
| 1290 |
om [O_2] (-2,1)[\overleftarrow{O_2}] & |
| 1291 |
the [A] ( 1,1)[\overleftarrow{O_1}] & |
| 1292 |
man [O_1] ( 1,2)[\overleftarrow{I^4_1}] & |
| 1293 |
bought [I^4_{\mathsf{dep}}] (-4,5)[\overrightarrow{A}] & |
| 1294 |
the [A] ( 1,1)[\overleftarrow{O_2}] & |
| 1295 |
book [O_2] (-2,3)[\overleftarrow{I^4_2}] |
| 1296 |
\end{pathlikeadtree} |
| 1297 |
\end{verbatim} |
| 1298 |
|
| 1299 |
Path-like adtrees as explained so far are useful to represent adtrees |
| 1300 |
having $\epsilon$-only adpositions. Since every adtree, up to a |
| 1301 |
syntactical transformation, can be represented in this way, although |
| 1302 |
losing some pieces of structural content, path-like adtrees drawn |
| 1303 |
using the previously explained features are completely general. |
| 1304 |
|
| 1305 |
However, there is less elegant way of writing general adtrees in the |
| 1306 |
path-like form, in which adpositions are directly referred to in the |
| 1307 |
arcs. |
| 1308 |
|
| 1309 |
In short, the arc syntax is generalised to |
| 1310 |
\verb|(|$t$\verb|,|$h$\verb|)[|$g$\verb|]|\verb|<|$a$\verb|>| where |
| 1311 |
the $a$ specifies the adposition, either using the relative or the |
| 1312 |
absolute \verb|!| syntax. Of course, when there is no explicit |
| 1313 |
adpostion to refer, i.e., the adposition is $\epsilon$, the previous |
| 1314 |
syntax, without the parameter in angle brackets, is used. |
| 1315 |
|
| 1316 |
As an illustration, |
| 1317 |
\begin{displaymath} |
| 1318 |
\ATpathinterskip1.2em |
| 1319 |
\begin{pathlikeadtree} |
| 1320 |
the [A] ( 1,1)[\overleftarrow{O}] & |
| 1321 |
girl [O] & |
| 1322 |
for [U] & |
| 1323 |
wh- [U] & |
| 1324 |
om [O_2] ( 3,4)[\overleftarrow{I^4_3}]<!3> & |
| 1325 |
the [A] ( 1,1)[\overleftarrow{O_1}] & |
| 1326 |
man [O_1] ( 1,2)[\overleftarrow{I^4_1}] & |
| 1327 |
bought [I^4_{\mathsf{dep}}] (-6,6)[\overrightarrow{A}]<-4> & |
| 1328 |
the [A] ( 1,1)[\overleftarrow{O_2}] & |
| 1329 |
book [O_2] (-2,3)[\overleftarrow{I^4_2}] |
| 1330 |
\end{pathlikeadtree} |
| 1331 |
\end{displaymath} |
| 1332 |
has been typeset by |
| 1333 |
\begin{verbatim} |
| 1334 |
\begin{displaymath} |
| 1335 |
\ATpathinterskip1.2em |
| 1336 |
\begin{pathlikeadtree} |
| 1337 |
the [A] ( 1,1)[\overleftarrow{O}] & |
| 1338 |
girl [O] & |
| 1339 |
for [U] & |
| 1340 |
wh- [U] & |
| 1341 |
om [O_2] ( 3,4)[\overleftarrow{I^4_3}]<!3> & |
| 1342 |
the [A] ( 1,1)[\overleftarrow{O_1}] & |
| 1343 |
man [O_1] ( 1,2)[\overleftarrow{I^4_1}] & |
| 1344 |
bought [I^4_{\mathsf{dep}}] (-6,6)[\overrightarrow{A}]<-4> & |
| 1345 |
the [A] ( 1,1)[\overleftarrow{O_2}] & |
| 1346 |
book [O_2] (-2,3)[\overleftarrow{I^4_2}] |
| 1347 |
\end{pathlikeadtree} |
| 1348 |
\end{displaymath} |
| 1349 |
\end{verbatim}\vspace{1.5ex} |
| 1350 |
|
| 1351 |
There are a few hints and tricks about path-like adtrees: first, as in |
| 1352 |
the case of adtrees, the \verb|pathlikeadtree| environment produces a |
| 1353 |
\TeX{} box, thus it can be manipulated by, e.g., rotating, scaling, |
| 1354 |
etc. |
| 1355 |
|
| 1356 |
Second, while the syntax inside the \verb|pathlikeadtree| is quite |
| 1357 |
rigid, it is possible to locally use commands by putting them in the |
| 1358 |
morpheme of a cell. The effects of this commands influence the cell |
| 1359 |
from the point they are issued, but also all the subsequent |
| 1360 |
cells. Beware that using commands with side effects inside a |
| 1361 |
\verb|pathlikeadtree| environment is an hack, which requires a deep |
| 1362 |
understanding of how the code of the package operates. |
| 1363 |
|
| 1364 |
The third way to radically affect the appearance of a path-like adtree |
| 1365 |
is to redefine \verb|\ATpathpichook|, which is \verb|\def|ined to be |
| 1366 |
empty by default. This command is issued just before each arc is |
| 1367 |
drawn. To code sophisticated manipulations of the drawing process |
| 1368 |
requires to understand how the drawing engine works. However, for |
| 1369 |
simple manipulations, it suffices to know that \verb|\@ATpa| contains |
| 1370 |
the index of the source cell of an arc, \verb|\@ATpb| the index of the |
| 1371 |
target cell, \verb|\@ATpc| the height, \verb|\@ATsa| is a box register |
| 1372 |
containing the already formatted grammar character of an arc, and |
| 1373 |
\verb|\@ATpe| is either $0$ or the index of the adposition cell. |
| 1374 |
Needless to say, using this feature is for advanced users only. |
| 1375 |
|
| 1376 |
% -------------------------- |
| 1377 |
\clearpage |
| 1378 |
\section{Tabular Adtrees}\label{sec:tabular} |
| 1379 |
Sometimes it is useful to have a purely textual representation of an |
| 1380 |
adtree, which is more compact and fits, e.g., in a double column |
| 1381 |
format. For example |
| 1382 |
\begin{equation*} |
| 1383 |
\ATrLA{2\unitlength}{120}{wh-}{O} |
| 1384 |
{\ATr{for}{I} |
| 1385 |
{\ATs{the girl}{O}} |
| 1386 |
{\ATle{I^4_2} |
| 1387 |
{\ATs{the book}{Y}} |
| 1388 |
{\ATre{I^4_1} |
| 1389 |
{\ATm{-o}{X}} |
| 1390 |
{\ATs{bought}{I^4_{\mathrm{dep}}}}}}} |
| 1391 |
{\ATle{O} |
| 1392 |
{\ATm{the}{A}} |
| 1393 |
{\ATm{man}{O}}} |
| 1394 |
\end{equation*} |
| 1395 |
can be rendered as |
| 1396 |
\begin{ATtabulardisplay} |
| 1397 |
\ATrLA{2\unitlength}{120}{wh-}{O} |
| 1398 |
{\ATr{for}{I} |
| 1399 |
{\ATs{the girl}{O}} |
| 1400 |
{\ATle{I^4_2} |
| 1401 |
{\ATs{the book}{Y}} |
| 1402 |
{\ATre{I^4_1} |
| 1403 |
{\ATm{-o}{X}} |
| 1404 |
{\ATs{bought}{I^4_{\mathrm{dep}}}}}}} |
| 1405 |
{\ATle{O} |
| 1406 |
{\ATm{the}{A}} |
| 1407 |
{\ATm{man}{O}}} |
| 1408 |
\end{ATtabulardisplay} |
| 1409 |
|
| 1410 |
Obtaining this effect is as simple as enclosing the adtree into a |
| 1411 |
\verb!ATtabulardisplay! environment. The previous example has been |
| 1412 |
typeset by |
| 1413 |
\begin{verbatim} |
| 1414 |
\begin{ATtabulardisplay} |
| 1415 |
\ATrA{120}{wh-}{O} |
| 1416 |
{\ATr{for}{I} |
| 1417 |
{\ATs{the girl}{O}} |
| 1418 |
{\ATle{I^4_2} |
| 1419 |
{\ATs{the book}{Y}} |
| 1420 |
{\ATre{I^4_1} |
| 1421 |
{\ATm{-o}{X}} |
| 1422 |
{\ATs{bought}{I^4_{\mathrm{dep}}}}}}} |
| 1423 |
{\ATle{O}{\ATm{the}{A}}{\ATm{man}{O}}} |
| 1424 |
\end{ATtabulardisplay} |
| 1425 |
\end{verbatim} |
| 1426 |
|
| 1427 |
The environment uses the \verb|\ATtabskip| command to declare the |
| 1428 |
amount of space to use for indenting the sub-trees. The default is |
| 1429 |
\verb|\def\ATtabskip{\hspace*{1em}}|. In addition, the whole |
| 1430 |
environment is moved on the right by \verb|\ATtabindent|, with default |
| 1431 |
value \verb|\def\ATtabindent{\hspace*{2em}}|. |
| 1432 |
|
| 1433 |
Alternatively, the environment \verb|ATtabular| allows to typeset the |
| 1434 |
adtree in the same way but inside a box, which can then be manipulated |
| 1435 |
as one pleases: |
| 1436 |
\begin{displaymath} |
| 1437 |
\fbox{$\vcenter{\begin{ATtabular} |
| 1438 |
\ATrLA{2\unitlength}{120}{wh-}{O} |
| 1439 |
{\ATr{for}{I} |
| 1440 |
{\ATs{the girl}{O}} |
| 1441 |
{\ATle{I^4_2} |
| 1442 |
{\ATs{the book}{Y}} |
| 1443 |
{\ATre{I^4_1} |
| 1444 |
{\ATm{-o}{X}} |
| 1445 |
{\ATs{bought}{I^4_{\mathrm{dep}}}}}}} |
| 1446 |
{\ATle{O} |
| 1447 |
{\ATm{the}{A}} |
| 1448 |
{\ATm{man}{O}}} |
| 1449 |
\end{ATtabular}}$} = |
| 1450 |
\fbox{$\vcenter{\begin{ATtabular} |
| 1451 |
\ATrLA{2\unitlength}{120}{wh-}{O} |
| 1452 |
{\ATr{for}{I} |
| 1453 |
{\ATs{the girl}{O}} |
| 1454 |
{\ATle{I^4_2} |
| 1455 |
{\ATs{the book}{Y}} |
| 1456 |
{\ATre{I^4_1} |
| 1457 |
{\ATm{-o}{X}} |
| 1458 |
{\ATs{bought}{I^4_{\mathrm{dep}}}}}}} |
| 1459 |
{\ATle{O} |
| 1460 |
{\ATm{the}{A}} |
| 1461 |
{\ATm{man}{O}}} |
| 1462 |
\end{ATtabular}}$} |
| 1463 |
\end{displaymath} |
| 1464 |
\begin{verbatim} |
| 1465 |
\fbox{$\vcenter{ |
| 1466 |
\begin{ATtabular} |
| 1467 |
\ATrLA{2\unitlength}{120}{wh-}{O} |
| 1468 |
{\ATr{for}{I} |
| 1469 |
{\ATs{the girl}{O}} |
| 1470 |
{\ATle{I^4_2} |
| 1471 |
{\ATs{the book}{Y}} |
| 1472 |
{\ATre{I^4_1} |
| 1473 |
{\ATm{-o}{X}} |
| 1474 |
{\ATs{bought}{I^4_{\mathrm{dep}}}}}}} |
| 1475 |
{\ATle{O} |
| 1476 |
{\ATm{the}{A}} |
| 1477 |
{\ATm{man}{O}}} |
| 1478 |
\end{ATtabular}}$} = |
| 1479 |
\fbox{$\vcenter{ |
| 1480 |
\begin{ATtabular} |
| 1481 |
\ATrLA{2\unitlength}{120}{wh-}{O} |
| 1482 |
{\ATr{for}{I} |
| 1483 |
{\ATs{the girl}{O}} |
| 1484 |
{\ATle{I^4_2} |
| 1485 |
{\ATs{the book}{Y}} |
| 1486 |
{\ATre{I^4_1} |
| 1487 |
{\ATm{-o}{X}} |
| 1488 |
{\ATs{bought}{I^4_{\mathrm{dep}}}}}}} |
| 1489 |
{\ATle{O} |
| 1490 |
{\ATm{the}{A}} |
| 1491 |
{\ATm{man}{O}}} |
| 1492 |
\end{ATtabular}}$} |
| 1493 |
\end{verbatim} |
| 1494 |
|
| 1495 |
The various pieces of the adtree are rendered according to the |
| 1496 |
following definitions, which could be modified on need, see also the |
| 1497 |
next section, keeping in mind that they are not for the casual user. |
| 1498 |
\begin{verbatim} |
| 1499 |
\def\ATtabularadpositionblock#1#2#3{% |
| 1500 |
\hbox{\ATtabindent\AT@loop@tab% |
| 1501 |
{#2}\textsuperscript{#1}\textsubscript{#3}}} |
| 1502 |
\def\ATtabularmorphemeblock#1#2{ |
| 1503 |
\hbox{\ATtabindent\AT@loop@tab% |
| 1504 |
{#1}\textsubscript{#2}}} |
| 1505 |
\def\ATtabularsummaryblock#1#2{ |
| 1506 |
\hbox{\ATtabindent\AT@loop@tab% |
| 1507 |
\mbox{$\triangle($}% |
| 1508 |
\mbox{#1}\mbox{$)$}\textsubscript{#2}}} |
| 1509 |
\def\ATtabularfirstattribute{\ATlinearfirstattribute} |
| 1510 |
\def\ATtabularnextattribute{\ATlinearnextattribute} |
| 1511 |
\def\ATtabularsubtrees#1#2{% |
| 1512 |
\advance\@AT@tabcount1% |
| 1513 |
\vbox{#1\relax#2}% |
| 1514 |
\advance\@AT@tabcount-1} |
| 1515 |
\end{verbatim} |
| 1516 |
|
| 1517 |
Finally the \verb|\ATTabular| command can be used to switch from the |
| 1518 |
normal graphical rendering of adtrees to the tabular one. This is a |
| 1519 |
low-level command which has been left accessible to end-users willing |
| 1520 |
to write their own environments when \verb|ATtabular| is not enough. |
| 1521 |
|
| 1522 |
% -------------------------- |
| 1523 |
\clearpage |
| 1524 |
\section{Linear Adtrees}\label{sec:linear} |
| 1525 |
Adtrees can be rendered in a linear format. This is not graphically |
| 1526 |
pleasant, so we discourage users to adopt it.\vspace{1.5ex} |
| 1527 |
|
| 1528 |
Nevertheless, it may be useful to have a very compact representation |
| 1529 |
of adtrees. This can be automatically obtained by prepending the |
| 1530 |
\verb|\ATlinearise| command to an adtree. For example |
| 1531 |
\begin{center} |
| 1532 |
\ATlinearise{\ATlcL{.3ex}{I_2^2}[phrase] |
| 1533 |
{\ATm{\cancel{something}}{O}[object][fruit]} |
| 1534 |
{\ATs{Kim eats}{I_1^2}}} |
| 1535 |
\end{center} |
| 1536 |
is the same as |
| 1537 |
\begin{equation*} |
| 1538 |
\ATlcL{.3ex}{I_2^2}[phrase] |
| 1539 |
{\ATm{\cancel{something}}{O}[object][fruit]} |
| 1540 |
{\ATs{Kim eats}{I_1^2}} |
| 1541 |
\end{equation*} |
| 1542 |
which shows how all the features of adtrees are rendered in the linear |
| 1543 |
format. |
| 1544 |
|
| 1545 |
The linear presentation has been generated by |
| 1546 |
\begin{verbatim} |
| 1547 |
\ATlinearise{\ATlcL{.3ex}{I_2^2}[phrase] |
| 1548 |
{\ATm{\cancel{something}}{O}[object][fruit]} |
| 1549 |
{\ATs{Kim eats}{I_1^2}}} |
| 1550 |
\end{verbatim} |
| 1551 |
which differs from the code to draw the graphics presentation just for |
| 1552 |
\verb|\ATlinearise|.\vspace{1.5ex} |
| 1553 |
|
| 1554 |
Declaring \verb|\ATLinear| in some point of the text makes linear all |
| 1555 |
the adtrees from that point on. To reestablish the standard behaviour |
| 1556 |
of graphical adtrees, one issues the command |
| 1557 |
\verb|\ATNormal|.\vspace{1.5ex} |
| 1558 |
|
| 1559 |
Linear adtrees are composed using the following commands |
| 1560 |
\begin{verbatim} |
| 1561 |
\def\ATlinearadpositionblock#1#2#3% |
| 1562 |
{{#2}\textsuperscript{#1}\textsubscript{#3}} |
| 1563 |
\def\ATlinearfirstattribute#1{{#1}:} |
| 1564 |
\def\ATlinearnextattribute#1{{#1};} |
| 1565 |
\def\ATlinearsubtrees#1#2{(#1,\linebreak[0] #2)} |
| 1566 |
\def\ATlinearmorphemeblock#1#2{{#1}\textsubscript{#2}} |
| 1567 |
\def\ATlinearsummaryblock#1#2{\mbox{$\triangle($}% |
| 1568 |
\mbox{#1}\mbox{$)$}\textsubscript{#2}} |
| 1569 |
\end{verbatim} |
| 1570 |
Their meaning should be intuitive after the explanations in |
| 1571 |
Section~\ref{sec:internal}. |
| 1572 |
|
| 1573 |
Also, it must be remarked that \verb|\ATMorphemeBox|, |
| 1574 |
\verb|\ATGrammarCharacterBox|, and \verb|\ATAttributeBox| are still |
| 1575 |
used to write the corresponding elements.\vspace{1.5ex} |
| 1576 |
|
| 1577 |
Linear adtrees are useful when it is required to perform some |
| 1578 |
computation on an adtree inside \LaTeX, e.g., when trying to write a |
| 1579 |
macro which manipulates an argument which is an adtree. |
| 1580 |
|
| 1581 |
The reason is double: first, the linear format require far less |
| 1582 |
computation than the graphical rendering; and, second, the building |
| 1583 |
macros receive inputs which have not been heavily preprocessed to |
| 1584 |
prepare their graphical rendering, thus closer to what the user has |
| 1585 |
written in the source code. |
| 1586 |
|
| 1587 |
For example, to list all the morpheme attributes occurring inside |
| 1588 |
\begin{equation*} |
| 1589 |
\ATlL{.3ex}{with}{I^2_2}[phrase] |
| 1590 |
{\ATs{the key}{O}[third actant]} |
| 1591 |
{\ATre{I^2_1} |
| 1592 |
{\ATxl{\ATs{the door}{O}[second actant]}} |
| 1593 |
{\ATs{will be opened}{I^3}[governor]}} |
| 1594 |
\end{equation*} |
| 1595 |
we can execute |
| 1596 |
\begin{verbatim} |
| 1597 |
{ \def\ATlinearadpositionblock#1#2#3{\relax} |
| 1598 |
\def\ATlinearfirstattribute#1#2{#2} |
| 1599 |
\def\ATlinearnextattribute#1#2{[{#2}]} |
| 1600 |
\def\ATlinearsubtrees{\relax} |
| 1601 |
\def\ATlinearmorphemeblock#1{\relax} |
| 1602 |
\def\ATlinearsummaryblock#1{\relax} |
| 1603 |
\ATlinearise{ |
| 1604 |
\ATl{with}{I^2_2}[phrase] |
| 1605 |
{\ATs{the key}{O}[third actant]} |
| 1606 |
{\ATre{I^2_1} |
| 1607 |
{\ATxl{\ATs{the door}{O}[second actant]}} |
| 1608 |
{\ATs{will be opened}{I^2}[governor]}}} } |
| 1609 |
\end{verbatim} |
| 1610 |
which produces |
| 1611 |
\begin{center} |
| 1612 |
{ \def\ATlinearadpositionblock#1#2#3{\relax} |
| 1613 |
\def\ATlinearfirstattribute#1#2{#2} |
| 1614 |
\def\ATlinearnextattribute#1#2{[{#2}]} |
| 1615 |
\def\ATlinearsubtrees{\relax} |
| 1616 |
\def\ATlinearmorphemeblock#1{\relax} |
| 1617 |
\def\ATlinearsummaryblock#1{\relax} |
| 1618 |
\ATlinearise{ |
| 1619 |
\ATl{with}{I^2_2}[phrase] |
| 1620 |
{\ATs{the key}{O}[third actant]} |
| 1621 |
{\ATre{I^2_1} |
| 1622 |
{\ATxl{\ATs{the door}{O}[second actant]}} |
| 1623 |
{\ATs{will be opened}{I^2}[governor]}}} } |
| 1624 |
\end{center} |
| 1625 |
Needless to say, such computations require a real \TeX\/ magician, who |
| 1626 |
is able to fully understand the code of the package! Nevertheless, |
| 1627 |
this opens the door to \LaTeX\/ macros that operate on adtrees, |
| 1628 |
treating them like data structures.\vfill |
| 1629 |
\end{document} |
| 1630 |
|
| 1631 |
%%% Local Variables: |
| 1632 |
%%% mode: latex |
| 1633 |
%%% TeX-master: t |
| 1634 |
%%% End: |