Debian Codegraph @

texmf-dist/doc/latex/qtree/qarrows.tex

raw
1 % You need the tree-dvips package to process this file.
2 % Alexis Dimitriadis ([email protected]) 10/10/99
3
4 \documentclass{article}
5
6 \advance\textheight by 1in
7 \advance\textwidth by 0.5in
8 \topmargin=-0.3in
9
10 \usepackage{tree-dvips}
11 \usepackage{qtree}
12
13 % PostScript to PDF conversion using ghostscript (alias ps2pdf)
14 % looks better on-screen if one of the built-in PDF fonts is used:
15 \usepackage{times}
16
17 \begin{document}
18 \centerline{\large\bf Examples: Drawing arrows on \emph{qtree} trees}
19 \medskip
20 The arrow-drawing capabilities of the package \emph{tree-dvips} (written by
21 Emma Pease) can be used with trees drawn with \emph{qtree}. The two packages
22 are fully compatible.
23
24 Note, however, that tree-dvips relies on PostScript specials, and thus does not work with pdf\LaTeX. This file was generated as DVI and then converted to pdf.
25
26 \emph{Tree-dvips} is not included in the distribution of \emph{qtree;} it is
27 available on CTAN.
28
29 Thanks to Seth Kulick for telling me about the combination, and to Amanda
30 Seidl for contributing the verb-movement example.
31 \bigskip
32
33 \hskip 1.5cm\Tree [ [ \node{subj1}subj_i ].NP [ [
34 T+v_n+\node{V}V_j+Apl_k
35 ].T [ \node{io}{ }IO_l
36 [ \node{subj2}t_i [ \node{v1}t_n [ \node{do}DO_m [ \node{io1}t_l
37 [ \node{apl1}t_k [ [ \node{V1}t_j ].V
38 \node{do1}t_m ].VP ].Apl\1
39 ].Apl\1 ].AplP ].{\it v}\1 ].{\it v}\1 ].{\it v}P ].T\1 ].TP
40
41 \anodecurve[bl]{subj2}[bl]{subj1}{0.4in}%
42 \anodecurve[bl]{do1}[bl]{do}{0.4in}%
43 {\makedash{4pt}\anodecurve[t]{io1}[r]{io}{.5in}}%
44 \anodecurve[bl]{V1}[bl]{apl1}{0.6in}%
45 \anodecurve[bl]{apl1}[bl]{v1}{1in}%
46 \anodecurve[bl]{v1}[bl]{V}{0.9in}%
47
48 % These would give square movement arrows instead:
49 %
50 % \abarnodeconnect[-6pt]{subj2}{subj1}{0.4in}
51 % \abarnodeconnect[-6pt]{do1}{do}{0.4in}
52 % {\makedash{4pt}{\anodecurve[t]{io1}[r]{io}{.5in}}}
53 % \abarnodeconnect[-6pt]{V1}{apl1}{0.6in}
54 % \abarnodeconnect[-6pt]{apl1}{v1}{1in}
55 % \abarnodeconnect[-6pt]{v1}{V}{0.9in}
56
57 \vspace*{-0.95in}
58 \noindent
59 {\small\begin{verbatim}
60 \Tree
61 [ [ \node{subj1}subj_i ].NP
62 [ [ T+v_n+\node{V}V_j+Apl_k ].T
63 [ \node{io}{ }IO_l
64 [ \node{subj2}t_i [ \node{v1}t_n
65 [ \node{do}DO_m [ \node{io1}t_l
66 [ \node{apl1}t_k [ [ \node{V1}t_j ].V
67 \node{do1}t_m ].VP ].Apl\1
68 ].Apl\1 ].AplP ].{\it v}\1 ].{\it v}\1
69 ].{\it v}P ].T\1 ].TP
70
71 \anodecurve[bl]{subj2}[bl]{subj1}{0.4in}
72 \anodecurve[bl]{do1}[bl]{do}{0.4in}
73 {\makedash{4pt}\anodecurve[t]{io1}[r]{io}{.5in}}
74 \anodecurve[bl]{V1}[bl]{apl1}{0.6in}
75 \anodecurve[bl]{apl1}[bl]{v1}{1in}
76 \anodecurve[bl]{v1}[bl]{V}{0.9in}
77 \end{verbatim}}
78
79 % A little bug: Because of how TeX assigns type categories to its input, the
80 % automatic math-mode switching of label subscripts does not work inside
81 % footnotes or boxes. To work around this, invoke \verb|\automath|
82 % \emph{before} entering in the box or footnote. (This will enable
83 % auto-switching to math mode anywhere in the text).
84 \automath
85
86 \noindent\hskip-0.3cm
87 \parbox{1.2in}{%
88 \Tree [.S [.NP \node{subj}{subj_i} ]
89 [.VP [.V verb ] [.NP \node{t}{t_i} ]]] \bigskip}
90 \abarnodeconnect[-6pt]{t}{subj}
91 % Another problem: \verbatim cannot be used inside anything boxes or
92 % footnotes (for the same reason). Use this substitute.
93 {\obeyspaces\obeylines%
94 \parbox{3.9in}{\tt\chardef\\=`\\% % Let \\ be \backslash
95 \\Tree [.S [.NP \\node\{subj\}\{subj\_i\} ]
96 \ [.VP [.V verb ] [.NP \\node\{t\}\{t\_i\} ]]]
97 ~
98 \\abarnodeconnect[-6pt]\{t\}\{subj\}}}
99
100 \end{document}