#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
#	qtreenotes.tex
#	qtree.sty
#	eepic.sty
# This archive created: Sat Nov 26 14:22:51 1994
export PATH; PATH=/bin:/usr/bin:$PATH
sed 's/^X//' << \SHAR_EOF > 'qtreenotes.tex'
X% Demo and instructions for the front end to the Qobitree tree-drawing package
X% (LaTeX)
X
X\documentstyle[12pt,qtree]{article}
X\advance\textheight by 0.7in
X\topmargin=-0.3in
X%\qtreecenterfalse
X\begin{document}
X
X\begin{center}
X{\bf Documentation for qtree, a \LaTeX\ tree macro package}\footnote{
XThanks to Jeff Siskind for permission to distribute the QobiTree code.
XPlease direct any comments to Alexis Dimitriadis, {\em
Xalexis@babel.ling.upenn.edu}.}
X\\ by {\em Jeffrey Mark Siskind,} \\ with
Xa front 
Xend by {\em Alexis Dimitriadis} \\[0.75ex]
X(Version 2)\\[1.5ex]
X\end{center}
X
XThe {\it qtree\/} package consists of QobiTree, a package of tree-drawing
Xmacros written by Jeff Siskind, and a front end that allows trees to be
Xspecified in bracket notation, using whitespace to separate tokens.  Tree
Xnodes, which can have labels of any size of complexity, are automatically
Xarranged on the page, usually with quite good results.  Provisions exist
Xfor fine-tuning the default layout.  The front end also centers trees (by
Xdefault) and provides some other nice features.
X
XA simple tree may look like this:
X\begin{verbatim}
X\Tree [.S a [.NP {\bf b} c ] d ]
X\end{verbatim}
XAnd produces:
X\par
X\Tree [.S a [.NP {\bf b} c ] d ]
X\par
X%\subsection*{Invocation}
XThe tree macro file {\tt qtree.sty} is designed to be installed in the
Xdirectory of style files and included as an optional argument of the
X\verb|\documentstyle| command.  The lines used to draw trees look better if
Xthis package is used with the styles {\tt epic.sty} and {\tt eepic.sty}
X(distributed with {\it qtree\/}), which provide enhancements to the \LaTeX\
Xpicture environment.  This version of {\it qtree\/} will automatically
Xinclude {\tt eepic.sty\/} if it can find it, so if {\tt eepic.sty\/} is in
Xthe style files directory, it should not be necessary to give ``{\tt eepic}''
Xas a style argument.  This document begins with the header:
X\begin{verbatim}
X\documentstyle[12pt,qtree]{article}
X\end{verbatim}
X
XThe node labels may be quite complicated; they may contain font changes and
Xmath-mode text, line breaks introduced with \verb|\\| (which produce
Xcentered lines), etc. The trees produced have a maximum depth of 20, with a
Xmaximum of five branches at any one node.  Unlike many other tree macros,
XQobiTree adjusts automatically for the width and height of tree labels, and
Xis pretty good at arranging nodes on the page.
X
X%\paragraph*{Parser trivia}
XTo make a multi-word node label, enclose it in braces; note also that
X\TeX\ discards the spaces immediately after {\it control
Xsequences\/} (commands whose name consists of a backslash followed by
Xletters), hence if a node label ends with a control sequence, like
X\verb|\ldots| in the following example, you need to enclose it in braces
Xtoo.
X
X\Tree [.CP [.{\sc Spec}(CP) {which car} ] {\ldots} ]
X\begin{verbatim}
X\Tree [.CP [.{\sc Spec}(CP) {which car} ] {\ldots} ]
X\end{verbatim}
X
XThat's all you really need to get started!  Read on for more features,
Xexamples and information about complicated uses.
X
X\subsection*{Details and examples}
X  A label for a non-terminal node can be written either after the left
Xbracket or after the right bracket corresponding to that node.  Thus the
Xfollowing are equivalent:
X\begin{verbatim}
X\Tree [.S a [.NP b c ]    d ]
X\Tree [.S a [    b c ].NP d ]
X\end{verbatim}
XTo help keep braces matched when editing large trees, the front end allows
Xthe option of writing a label after both the left and the right bracket of
Xthe same node, as shown for the node NP below.  In this case the two labels
Xprovided must be identical, token for token.
X\begin{verbatim}
X\Tree [.S a [.NP b c ].NP d ]
X\end{verbatim}
X
X\paragraph*{Numbered examples etc.}
X  The front end can be placed in a numbered example environment, in
X\verb|\parbox|es, inside math formulas, tables, pictures, etc.
XThe tree nodes can also contain arbitrarily complex material.  Here is an
Xexample using the {\tt enumerate} environment, and the code to generate it.
X\begin{enumerate} \item (a) \hskip-0.75in
X    \Tree[.C [.Tns [.Neg [.Ind V [.Ind Ind Agr_1 ]] Neg ].Neg 
X      [.Tns Agr_2 Tns ] ].Tns [.C C Agr_3 ] ]
X\end{enumerate}
X\begin{verbatim}
X\begin{enumerate} \item (a) \hskip-0.75in
X    \Tree[.C [.Tns [.Neg [.Ind V [.Ind Ind Agr_1 ]] Neg ].Neg 
X      [.Tns Agr_2 Tns ] ].Tns [.C C Agr_3 ] ]
X\end{enumerate}
X\end{verbatim}
X
XFor obscure reasons, trees often appear farther to the right than is
Xvisually appealing; but not to worry, you can move them sideways by hand.
X(Note the \verb|\hskip| in the last example, which moves the tree 0.75
Xinches to the left).
X
X\paragraph*{Roofs}
XThere is also a provision for drawing a triangular ``roof'' above a phrase
Xthat is treated as a unit.  This is done with the command \verb|\qroof|,
Xwhich can appear anywhere a {\it leaf\/} can appear.  The slope of the roof
Xis equal to the ratio \verb|\qroofy / \qroofx| (these counters may be reset
Xto any pair of integers between zero and six; the default is 1/3).
X
XTo create a roof
Xlabeled {\it NP\/} over the phrase {\it the book,} type
X\begin{verbatim}
X	\qroof{the book}.NP
X\end{verbatim}
XIf the phrase contains line breaks introduced with \verb|\\|, the resulting
Xlines are flush left, not centered.  Again, it is possible for the
X``phrase'' to be a construction of arbitrary complexity.
X
X\paragraph*{Subscripts and superscripts}
XTrees are constructed in a special environment in which things like
X\verb|NP_i|, \verb|N^0|, automatically format their subscripts or
Xsuperscripts in math mode, giving NP$_i$ and N$^0$, respectively.  The
Xcommand that arranges this is called \verb|\automath|, and can be invoked
Xoutside the tree environment, if desired. (It is turned off with
X\verb|\noautomath|).  As a further convenience, constructions like
X\verb|X$'$|, producing X\1, can be abbreviated \verb|X\1|.
XHere is an example using some of these features:
X\begin{enumerate}
X\item \Tree [.IP [ Roses ].NP_i [.I\1 [ are ].I^0 
X	[.VP t_i [ [ going ].V^0 \qroof{out of style}.PP ].V\1 ].VP 
X          ].I\1 ]
X\end{enumerate}
X\begin{verbatim}
X\begin{enumerate}
X\item \Tree [.IP [ Roses ].NP_i [.I\1 [ are ].I^0 
X	[.VP t_i [ [ going ].V^0 \qroof{out of style}.PP ].V\1 ].VP 
X          ].I\1 ]
X\end{enumerate}
X\end{verbatim}
XGranted, by the time the examples get this big, the bracketed format isn't
Xall that readable, but it's certainly no worse than any other tree format,
Xand you can add white space to make it a little better.
X
X\paragraph*{Left adjusted trees}
XIf you do not like centered trees, you can turn off the centering option
Xwith the command \verb|\qtreecenterfalse|.  Normally this would be invoked
Xin the preamble, but it is possible to turn tree centering off and on (with
Xthe corresponding \verb|\qtreecentertrue|) at any point.  There is no
Xprovision for automatic right-adjusted trees.
X
X\paragraph*{Side by side trees}
XMultiple trees, or text and trees, can be arranged side by side.  This can
Xoften be done by just arranging commands one after another (it usually
Xhelps to turn off tree centering).  If necessary the spacing can be
Xadjusted with \verb|\hskip|.
X\begin{enumerate}
X\qtreecenterfalse
X\item (a) \hskip -0.3in\Tree [.S [.NP \'el\\he ] [.VP [.V hizo\\made ] 
X	[.V decir\\say ] [.NP lo\\it ] [.NP a-mi\\me ] ]]
X  (b) \Tree[ A [.T {B\\ \em note} cc ].T D ].S
X\end{enumerate}
X\begin{verbatim}
X\begin{enumerate}
X\qtreecenterfalse
X\item (a) \hskip -0.3in\Tree [.S [.NP \'el\\he ]
X        [.VP [.V hizo\\made ] [.V decir\\say ] 
X             [.NP lo\\it ] [.NP a-mi\\me ]      ].VP ]
X  (b) \Tree[ A [.T {B\\ \em note} cc ].T D ].S
X\end{enumerate}
X\end{verbatim}
X
X\paragraph*{\it Trivia note:\/}
XIf you insist on placing trees in a \verb|\parbox|, here is how to do it.
XNote the \verb|~|, called a {\it tie,} before \verb|\Tree| inside the
Xparbox; it keeps \LaTeX\ from breaking the line and placing the tree one
Xline too low.
X\begin{enumerate}
X\item \parbox[t]{2.4in}{ (a)~\Tree 
X   [.VP [.NP (mud) ] [.V\1 [.V (get) ] [.PP {(on wall)} ]]] }
X%
X\parbox[t]{2in}{ (b)~\Tree 
X [.VP [.NP (screen) ] \qroof{V\qquad AP\\ \hfil(clear)~}.V\1 ] }
X\end{enumerate}
X
X\begin{verbatim}
X\begin{enumerate}
X\item \parbox[t]{2.4in}{ (a)~\Tree 
X   [.VP [.NP (mud) ] [.V\1 [.V (get) ] [.PP {(on wall)} ]]] }
X\parbox[t]{2in}{ (b)~\Tree 
X [.VP [.NP (screen) ] \qroof{V\qquad AP\\ \hfil(clear)~}.V\1 ] }
X\end{enumerate}
X\end{verbatim}
X
X\paragraph*{Escaping the parser}
XThere is also a provision for sneaking directives past the front end.  If a
Xword begins with an exclamation mark, the next word (i.e., up to the next
Xspace) will be passed through unchanged, except for stripping off the ``!''.
X(Braces should be used to pass through larger groups).  One thing that this
Xmay be useful for is the \verb|\faketreewidth| directive. (Note that
X\verb|\qroof| should {\it not\/} be preceded by an exclamation mark).
X
X\paragraph*{Fine tuning} The command \verb|\faketreewidth{<text>}| tells
XQobiTree to override its default calculation of the width of the
Xlast-defined node and replace it with the width of \verb|<text>| (which
Xagain can have `\verb|\\|' commands etc.) \verb|<text>| is not actually
Xtypeset but is used just to compute the fake width of the node on the top
Xof the stack. When you use \verb|\faketreewidth| you are on your own. This
Xcan either shrink or enlarge the space taken by the node and may result in
Xtrees with overlapping labels.
X
X\paragraph*{The low-level interface}
XThe guts of {\it qtree\/} are the tree macros written by Jeff Siskind,
Xnamed QobiTree. Using the original interface (which is still usable with
Xthis package) the example tree shown on page one would be written like this:
X\begin{verbatim}
X\begin{center}
X\leaf{a}
X\leaf{\bf b} \leaf{c} \branch{2}{NP}
X\leaf{d}
X\branch{3}{S}
X\qobitree
X\end{center}
X\end{verbatim}
X\begin{center}
X\leaf{a}
X\leaf{\em b} \leaf{c} \branch{2}{NP}
X\leaf{d}
X\branch{3}{S}
X\qobitree
X\end{center}
XThese macros operate like a stack machine. You push \TeX\ boxes onto the
Xstack of tree nodes, then you pop them off to make branching nodes which
Xget pushed back on the stack.
X
X
X\paragraph*{Disclaimer:} These macros still have a few rough edges, but are
Xdistributed in the belief that they are useful in their present form.  Two
Xknown problems are the idiosyncratic centering (see above), and a problem
Xwith very small leaf nodes: the tree fragment \verb|[ a b ].X| will produce
Xinvisible branches from \verb|X| to \verb|a| and~\verb|b|.  The latter
Xproblem appears to be caused by the limited inventory of line slopes in the
X\LaTeX\ picture environment, and disappears if the picture enhancement
Xstyles are used, as was done to prepare this document.
X
XI hope to completely fix the centering in the future, and I welcome any
Xcomments or reports of other problems or desirable features.  But as usual,
Xno guarantees, promises, etc. can be made about the present or future state
Xof this package.
X
XHere is a last demo, illustrating some possibilities.  (This example, and
Xparts of the above exposition, was adapted from the original documentation
Xfor QobiTree).
X
X\newpage
X\begin{enumerate}\item
X\def\CUP{{\bf cup}}
X\def\Nspec{N$_{\mbox{\sc spec}}$}
X
X\Tree [.{{\em The cup slid from John to Mary.}\\
X       {GO(\CUP,  $[_{\rm Path}$ FROM({\bf John}), TO({\bf Mary})])}\\IP}
X [.\fbox{Fracture}
X%
X   [.{{\em The cup}\\\CUP\\NP}
X     [ {{\em The}\\$\bot$\\\Nspec} {{\em cup}\\\CUP\\N} ].\fbox{Fracture}
X   ]
X   [.{{\em slid from John to Mary}\\
X    {GO({\it x},  $[_{\rm Path}$ FROM({\bf John}), TO({\bf Mary})])}\\IP}
X     [ $\vdots$ $\vdots$ !\faketreewidth{WWW} ].\fbox{Fracture}
X   ]
X ].\fbox{Fracture}
X]
X\end{enumerate}
X
X\small
X\begin{verbatim}
X\def\CUP{{\bf cup}}
X\def\Nspec{N$_{\mbox{\sc spec}}$}
X
X\Tree [.{{\em The cup slid from John to Mary.}\\
X       {GO(\CUP,  $[_{\rm Path}$ FROM({\bf John}), TO({\bf Mary})])}\\IP}
X [.\fbox{Fracture}
X%
X   [.{{\em The cup}\\\CUP\\NP}
X     [ {{\em The}\\$\bot$\\\Nspec} {{\em cup}\\\CUP\\N} ].\fbox{Fracture}
X   ]
X   [.{{\em slid from John to Mary}\\
X    {GO({\it x},  $[_{\rm Path}$ FROM({\bf John}), TO({\bf Mary})])}\\IP}
X     [ $\vdots$ $\vdots$ !\faketreewidth{WWW} ].\fbox{Fracture}
X   ]
X ].\fbox{Fracture} % repeated label
X]
X\end{verbatim}
X
X\end{document}
SHAR_EOF
chmod 644 'qtreenotes.tex'
sed 's/^X//' << \SHAR_EOF > 'qtree.sty'
X%
X% qtree.sty, a LaTeX macro package for drawing trees from descriptions
X% given in bracket notation.
X%
X%       VERSION 2 -- June 1994
X%
X% QobiTree tree macros written by Jeffrey Mark Siskind (Qobi@cis.upenn.edu).
X% Front end by Alexis Dimitriadis (alexis@babel.ling.upenn.edu).
X%
X% Please direct questions/comments to alexis@babel.ling.upenn.edu.
X% 
X\newcounter{treecount}
X\newcounter{branchcount}
X\setcounter{treecount}{0}
X\newsavebox{\parentbox}
X\newsavebox{\treebox}
X\newsavebox{\treeboxone}
X\newsavebox{\treeboxtwo}
X\newsavebox{\treeboxthree}
X\newsavebox{\treeboxfour}
X\newsavebox{\treeboxfive}
X\newsavebox{\treeboxsix}
X\newsavebox{\treeboxseven}
X\newsavebox{\treeboxeight}
X\newsavebox{\treeboxnine}
X\newsavebox{\treeboxten}
X\newsavebox{\treeboxeleven}
X\newsavebox{\treeboxtwelve}
X\newsavebox{\treeboxthirteen}
X\newsavebox{\treeboxfourteen}
X\newsavebox{\treeboxfifteen}
X\newsavebox{\treeboxsixteen}
X\newsavebox{\treeboxseventeen}
X\newsavebox{\treeboxeighteen}
X\newsavebox{\treeboxnineteen}
X\newsavebox{\treeboxtwenty}
X\newlength{\treeoffsetone}
X\newlength{\treeoffsettwo}
X\newlength{\treeoffsetthree}
X\newlength{\treeoffsetfour}
X\newlength{\treeoffsetfive}
X\newlength{\treeoffsetsix}
X\newlength{\treeoffsetseven}
X\newlength{\treeoffseteight}
X\newlength{\treeoffsetnine}
X\newlength{\treeoffsetten}
X\newlength{\treeoffseteleven}
X\newlength{\treeoffsettwelve}
X\newlength{\treeoffsetthirteen}
X\newlength{\treeoffsetfourteen}
X\newlength{\treeoffsetfifteen}
X\newlength{\treeoffsetsixteen}
X\newlength{\treeoffsetseventeen}
X\newlength{\treeoffseteighteen}
X\newlength{\treeoffsetnineteen}
X\newlength{\treeoffsettwenty}
X
X\newlength{\treeshiftone}
X\newlength{\treeshifttwo}
X\newlength{\treeshiftthree}
X\newlength{\treeshiftfour}
X\newlength{\treeshiftfive}
X\newlength{\treeshiftsix}
X\newlength{\treeshiftseven}
X\newlength{\treeshifteight}
X\newlength{\treeshiftnine}
X\newlength{\treeshiftten}
X\newlength{\treeshifteleven}
X\newlength{\treeshifttwelve}
X\newlength{\treeshiftthirteen}
X\newlength{\treeshiftfourteen}
X\newlength{\treeshiftfifteen}
X\newlength{\treeshiftsixteen}
X\newlength{\treeshiftseventeen}
X\newlength{\treeshifteighteen}
X\newlength{\treeshiftnineteen}
X\newlength{\treeshifttwenty}
X\newlength{\treewidthone}
X\newlength{\treewidthtwo}
X\newlength{\treewidththree}
X\newlength{\treewidthfour}
X\newlength{\treewidthfive}
X\newlength{\treewidthsix}
X\newlength{\treewidthseven}
X\newlength{\treewidtheight}
X\newlength{\treewidthnine}
X\newlength{\treewidthten}
X\newlength{\treewidtheleven}
X\newlength{\treewidthtwelve}
X\newlength{\treewidththirteen}
X\newlength{\treewidthfourteen}
X\newlength{\treewidthfifteen}
X\newlength{\treewidthsixteen}
X\newlength{\treewidthseventeen}
X\newlength{\treewidtheighteen}
X\newlength{\treewidthnineteen}
X\newlength{\treewidthtwenty}
X\newlength{\daughteroffsetone}
X\newlength{\daughteroffsettwo}
X\newlength{\daughteroffsetthree}
X\newlength{\daughteroffsetfour}
X\newlength{\branchwidthone}
X\newlength{\branchwidthtwo}
X\newlength{\branchwidththree}
X\newlength{\branchwidthfour}
X\newlength{\parentoffset}
X\newlength{\treeoffset}
X\newlength{\daughteroffset}
X\newlength{\branchwidth}
X\newlength{\parentwidth}
X\newlength{\treewidth}
X%
X\newcommand{\ontop}[1]{\begin{tabular}{c}#1\end{tabular}}
X%
X\newcommand{\poptree}{%
X\ifnum\value{treecount}=0\typeout{QobiTeX warning---Tree stack underflow}\fi
X\addtocounter{treecount}{-1}%
X\setlength{\treeoffsettwo}{\treeoffsetthree}%
X\setlength{\treeoffsetthree}{\treeoffsetfour}%
X\setlength{\treeoffsetfour}{\treeoffsetfive}%
X\setlength{\treeoffsetfive}{\treeoffsetsix}%
X\setlength{\treeoffsetsix}{\treeoffsetseven}%
X\setlength{\treeoffsetseven}{\treeoffseteight}%
X\setlength{\treeoffseteight}{\treeoffsetnine}%
X\setlength{\treeoffsetnine}{\treeoffsetten}%
X\setlength{\treeoffsetten}{\treeoffseteleven}%
X\setlength{\treeoffseteleven}{\treeoffsettwelve}%
X\setlength{\treeoffsettwelve}{\treeoffsetthirteen}%
X\setlength{\treeoffsetthirteen}{\treeoffsetfourteen}%
X\setlength{\treeoffsetfourteen}{\treeoffsetfifteen}%
X\setlength{\treeoffsetfifteen}{\treeoffsetsixteen}%
X\setlength{\treeoffsetsixteen}{\treeoffsetseventeen}%
X\setlength{\treeoffsetseventeen}{\treeoffseteighteen}%
X\setlength{\treeoffseteighteen}{\treeoffsetnineteen}%
X\setlength{\treeoffsetnineteen}{\treeoffsettwenty}%
X\setlength{\treeshifttwo}{\treeshiftthree}%
X\setlength{\treeshiftthree}{\treeshiftfour}%
X\setlength{\treeshiftfour}{\treeshiftfive}%
X\setlength{\treeshiftfive}{\treeshiftsix}%
X\setlength{\treeshiftsix}{\treeshiftseven}%
X\setlength{\treeshiftseven}{\treeshifteight}%
X\setlength{\treeshifteight}{\treeshiftnine}%
X\setlength{\treeshiftnine}{\treeshiftten}%
X\setlength{\treeshiftten}{\treeshifteleven}%
X\setlength{\treeshifteleven}{\treeshifttwelve}%
X\setlength{\treeshifttwelve}{\treeshiftthirteen}%
X\setlength{\treeshiftthirteen}{\treeshiftfourteen}%
X\setlength{\treeshiftfourteen}{\treeshiftfifteen}%
X\setlength{\treeshiftfifteen}{\treeshiftsixteen}%
X\setlength{\treeshiftsixteen}{\treeshiftseventeen}%
X\setlength{\treeshiftseventeen}{\treeshifteighteen}%
X\setlength{\treeshifteighteen}{\treeshiftnineteen}%
X\setlength{\treeshiftnineteen}{\treeshifttwenty}%
X\setlength{\treewidthtwo}{\treewidththree}%
X\setlength{\treewidththree}{\treewidthfour}%
X\setlength{\treewidthfour}{\treewidthfive}%
X\setlength{\treewidthfive}{\treewidthsix}%
X\setlength{\treewidthsix}{\treewidthseven}%
X\setlength{\treewidthseven}{\treewidtheight}%
X\setlength{\treewidtheight}{\treewidthnine}%
X\setlength{\treewidthnine}{\treewidthten}%
X\setlength{\treewidthten}{\treewidtheleven}%
X\setlength{\treewidtheleven}{\treewidthtwelve}%
X\setlength{\treewidthtwelve}{\treewidththirteen}%
X\setlength{\treewidththirteen}{\treewidthfourteen}%
X\setlength{\treewidthfourteen}{\treewidthfifteen}%
X\setlength{\treewidthfifteen}{\treewidthsixteen}%
X\setlength{\treewidthsixteen}{\treewidthseventeen}%
X\setlength{\treewidthseventeen}{\treewidtheighteen}%
X\setlength{\treewidtheighteen}{\treewidthnineteen}%
X\setlength{\treewidthnineteen}{\treewidthtwenty}%
X\setbox\treeboxtwo \box\treeboxthree
X\setbox\treeboxthree \box\treeboxfour
X\setbox\treeboxfour \box\treeboxfive
X\setbox\treeboxfive \box\treeboxsix
X\setbox\treeboxsix \box\treeboxseven
X\setbox\treeboxseven \box\treeboxeight
X\setbox\treeboxeight \box\treeboxnine
X\setbox\treeboxnine \box\treeboxten
X\setbox\treeboxten \box\treeboxeleven
X\setbox\treeboxeleven \box\treeboxtwelve
X\setbox\treeboxtwelve \box\treeboxthirteen
X\setbox\treeboxthirteen \box\treeboxfourteen
X\setbox\treeboxfourteen \box\treeboxfifteen
X\setbox\treeboxfifteen \box\treeboxsixteen
X\setbox\treeboxsixteen \box\treeboxseventeen
X\setbox\treeboxseventeen \box\treeboxeighteen
X\setbox\treeboxeighteen \box\treeboxnineteen
X\setbox\treeboxnineteen \box\treeboxtwenty }
X%
X\newcommand{\leaf}[1]{%
X\ifnum\value{treecount}=20\typeout{QobiTeX warning---Tree stack overflow}\fi%
X\addtocounter{treecount}{1}%
X\setbox\treeboxtwenty \box\treeboxnineteen
X\setbox\treeboxnineteen \box\treeboxeighteen
X\setbox\treeboxeighteen \box\treeboxseventeen
X\setbox\treeboxseventeen \box\treeboxsixteen
X\setbox\treeboxsixteen \box\treeboxfifteen
X\setbox\treeboxfifteen \box\treeboxfourteen
X\setbox\treeboxfourteen \box\treeboxthirteen
X\setbox\treeboxthirteen \box\treeboxtwelve
X\setbox\treeboxtwelve \box\treeboxeleven
X\setbox\treeboxeleven \box\treeboxten
X\setbox\treeboxten \box\treeboxnine
X\setbox\treeboxnine \box\treeboxeight
X\setbox\treeboxeight \box\treeboxseven
X\setbox\treeboxseven \box\treeboxsix
X\setbox\treeboxsix \box\treeboxfive
X\setbox\treeboxfive \box\treeboxfour
X\setbox\treeboxfour \box\treeboxthree
X\setbox\treeboxthree \box\treeboxtwo
X\setbox\treeboxtwo \box\treeboxone
X\sbox{\treeboxone}{\ontop{#1}}%
X\sbox{\treeboxone}{\raisebox{-\ht\treeboxone}{\usebox{\treeboxone}}}%
X\setlength{\treeoffsettwenty}{\treeoffsetnineteen}%
X\setlength{\treeoffsetnineteen}{\treeoffseteighteen}%
X\setlength{\treeoffseteighteen}{\treeoffsetseventeen}%
X\setlength{\treeoffsetseventeen}{\treeoffsetsixteen}%
X\setlength{\treeoffsetsixteen}{\treeoffsetfifteen}%
X\setlength{\treeoffsetfifteen}{\treeoffsetfourteen}%
X\setlength{\treeoffsetfourteen}{\treeoffsetthirteen}%
X\setlength{\treeoffsetthirteen}{\treeoffsettwelve}%
X\setlength{\treeoffsettwelve}{\treeoffseteleven}%
X\setlength{\treeoffseteleven}{\treeoffsetten}%
X\setlength{\treeoffsetten}{\treeoffsetnine}%
X\setlength{\treeoffsetnine}{\treeoffseteight}%
X\setlength{\treeoffseteight}{\treeoffsetseven}%
X\setlength{\treeoffsetseven}{\treeoffsetsix}%
X\setlength{\treeoffsetsix}{\treeoffsetfive}%
X\setlength{\treeoffsetfive}{\treeoffsetfour}%
X\setlength{\treeoffsetfour}{\treeoffsetthree}%
X\setlength{\treeoffsetthree}{\treeoffsettwo}%
X\setlength{\treeoffsettwo}{\treeoffsetone}%
X\setlength{\treeoffsetone}{0.5\wd\treeboxone}%
X\setlength{\treeshifttwenty}{\treeshiftnineteen}%
X\setlength{\treeshiftnineteen}{\treeshifteighteen}%
X\setlength{\treeshifteighteen}{\treeshiftseventeen}%
X\setlength{\treeshiftseventeen}{\treeshiftsixteen}%
X\setlength{\treeshiftsixteen}{\treeshiftfifteen}%
X\setlength{\treeshiftfifteen}{\treeshiftfourteen}%
X\setlength{\treeshiftfourteen}{\treeshiftthirteen}%
X\setlength{\treeshiftthirteen}{\treeshifttwelve}%
X\setlength{\treeshifttwelve}{\treeshifteleven}%
X\setlength{\treeshifteleven}{\treeshiftten}%
X\setlength{\treeshiftten}{\treeshiftnine}%
X\setlength{\treeshiftnine}{\treeshifteight}%
X\setlength{\treeshifteight}{\treeshiftseven}%
X\setlength{\treeshiftseven}{\treeshiftsix}%
X\setlength{\treeshiftsix}{\treeshiftfive}%
X\setlength{\treeshiftfive}{\treeshiftfour}%
X\setlength{\treeshiftfour}{\treeshiftthree}%
X\setlength{\treeshiftthree}{\treeshifttwo}%
X\setlength{\treeshifttwo}{\treeshiftone}%
X\setlength{\treeshiftone}{0pt}%
X\setlength{\treewidthtwenty}{\treewidthnineteen}%
X\setlength{\treewidthnineteen}{\treewidtheighteen}%
X\setlength{\treewidtheighteen}{\treewidthseventeen}%
X\setlength{\treewidthseventeen}{\treewidthsixteen}%
X\setlength{\treewidthsixteen}{\treewidthfifteen}%
X\setlength{\treewidthfifteen}{\treewidthfourteen}%
X\setlength{\treewidthfourteen}{\treewidththirteen}%
X\setlength{\treewidththirteen}{\treewidthtwelve}%
X\setlength{\treewidthtwelve}{\treewidtheleven}%
X\setlength{\treewidtheleven}{\treewidthten}%
X\setlength{\treewidthten}{\treewidthnine}%
X\setlength{\treewidthnine}{\treewidtheight}%
X\setlength{\treewidtheight}{\treewidthseven}%
X\setlength{\treewidthseven}{\treewidthsix}%
X\setlength{\treewidthsix}{\treewidthfive}%
X\setlength{\treewidthfive}{\treewidthfour}%
X\setlength{\treewidthfour}{\treewidththree}%
X\setlength{\treewidththree}{\treewidthtwo}%
X\setlength{\treewidthtwo}{\treewidthone}%
X\setlength{\treewidthone}{\wd\treeboxone}}
X%
X\newcommand{\branch}[2]{%
X\setcounter{branchcount}{#1}%
X\ifnum\value{branchcount}=1\sbox{\parentbox}{\ontop{#2}}%
X\setlength{\parentoffset}{\treeoffsetone}%
X\addtolength{\parentoffset}{-0.5\wd\parentbox}%
X\setlength{\daughteroffset}{0in}%
X\ifdim\parentoffset<0in%
X\setlength{\daughteroffset}{-\parentoffset}%
X\setlength{\parentoffset}{0in}\fi%
X\setlength{\parentwidth}{\parentoffset}%
X\addtolength{\parentwidth}{\wd\parentbox}%
X\setlength{\treeoffset}{\daughteroffset}%
X\addtolength{\treeoffset}{\treeoffsetone}%
X\setlength{\treewidth}{\wd\treeboxone}%
X\addtolength{\treewidth}{\daughteroffset}%
X\ifdim\treewidth<\parentwidth\setlength{\treewidth}{\parentwidth}\fi%
X\sbox{\treebox}{\begin{minipage}{\treewidth}%
X\begin{flushleft}%
X\hspace*{\parentoffset}\usebox{\parentbox}\\
X{\setlength{\unitlength}{2ex}%
X\hspace*{\treeoffset}\begin{picture}(0,1)%
X\put(0,0){\line(0,1){1}}%
X\end{picture}}\\
X\vspace{-\baselineskip}%
X\hspace*{\daughteroffset}%
X\raisebox{-\ht\treeboxone}{\usebox{\treeboxone}}%
X\end{flushleft}%
X\end{minipage}}%
X\setlength{\treeoffsetone}{\parentoffset}%
X\addtolength{\treeoffsetone}{0.5\wd\parentbox}%
X\setlength{\treeshiftone}{0pt}%
X\setlength{\treewidthone}{\treewidth}%
X\sbox{\treeboxone}{\usebox{\treebox}}%
X\else\ifnum\value{branchcount}=2\sbox{\parentbox}{\ontop{#2}}%
X\setlength{\branchwidthone}{\treewidthtwo}%
X\addtolength{\branchwidthone}{\treeoffsetone}%
X\addtolength{\branchwidthone}{-\treeshiftone}%
X\addtolength{\branchwidthone}{-\treeoffsettwo}%
X\setlength{\branchwidth}{\branchwidthone}%
X\setlength{\daughteroffsetone}{\branchwidth}%
X\addtolength{\daughteroffsetone}{-\branchwidthone}%
X\addtolength{\daughteroffsetone}{-\treeshiftone}%
X\setlength{\parentoffset}{-0.5\wd\parentbox}%
X\addtolength{\parentoffset}{\treeoffsettwo}%
X\addtolength{\parentoffset}{0.5\branchwidth}%
X\setlength{\daughteroffset}{0in}%
X\ifdim\parentoffset<0in%
X\setlength{\daughteroffset}{-\parentoffset}%
X\setlength{\parentoffset}{0in}\fi%
X\setlength{\parentwidth}{\parentoffset}%
X\addtolength{\parentwidth}{\wd\parentbox}%
X\setlength{\treeoffset}{\daughteroffset}%
X\addtolength{\treeoffset}{\treeoffsettwo}%
X\setlength{\treewidth}{\wd\treeboxone}%
X\addtolength{\treewidth}{\daughteroffsetone}%
X\addtolength{\treewidth}{\treewidthtwo}%
X\addtolength{\treewidth}{\daughteroffset}%
X\ifdim\treewidth<\parentwidth\setlength{\treewidth}{\parentwidth}\fi%
X\sbox{\treebox}{\begin{minipage}{\treewidth}%
X\begin{flushleft}%
X\hspace*{\parentoffset}\usebox{\parentbox}\\
X{\setlength{\unitlength}{0.5\branchwidth}%
X\hspace*{\treeoffset}\begin{picture}(2,0.5)%
X\put(0,0){\line(2,1){1}}%
X\put(2,0){\line(-2,1){1}}%
X\end{picture}}\\
X\vspace{-\baselineskip}
X\hspace*{\daughteroffset}%
X\makebox[\treewidthtwo][l]%
X{\raisebox{-\ht\treeboxtwo}{\usebox{\treeboxtwo}}}%
X\hspace*{\daughteroffsetone}%
X\raisebox{-\ht\treeboxone}{\usebox{\treeboxone}}%
X\end{flushleft}%
X\end{minipage}}%
X\setlength{\treeoffsetone}{\parentoffset}%
X\addtolength{\treeoffsetone}{0.5\wd\parentbox}%
X\setlength{\treeshiftone}{0pt}%
X\setlength{\treewidthone}{\treewidth}%
X\sbox{\treeboxone}{\usebox{\treebox}}\poptree%
X\else\ifnum\value{branchcount}=3\sbox{\parentbox}{\ontop{#2}}%
X\setlength{\branchwidthone}{\treewidthtwo}%
X\addtolength{\branchwidthone}{\treeoffsetone}%
X\addtolength{\branchwidthone}{-\treeshiftone}%
X\addtolength{\branchwidthone}{-\treeoffsettwo}%
X\setlength{\branchwidthtwo}{\treewidththree}%
X\addtolength{\branchwidthtwo}{\treeoffsettwo}%
X\addtolength{\branchwidthtwo}{-\treeshifttwo}%
X\addtolength{\branchwidthtwo}{-\treeoffsetthree}%
X\setlength{\branchwidth}{\branchwidthone}%
X\ifdim\branchwidthtwo>\branchwidth%
X\setlength{\branchwidth}{\branchwidthtwo}\fi%
X\setlength{\daughteroffsetone}{\branchwidth}%
X\addtolength{\daughteroffsetone}{-\branchwidthone}%
X\addtolength{\daughteroffsetone}{-\treeshiftone}%
X\setlength{\daughteroffsettwo}{\branchwidth}%
X\addtolength{\daughteroffsettwo}{-\branchwidthtwo}%
X\addtolength{\daughteroffsettwo}{-\treeshifttwo}%
X\setlength{\parentoffset}{-0.5\wd\parentbox}%
X\addtolength{\parentoffset}{\treeoffsetthree}%
X\addtolength{\parentoffset}{\branchwidth}%
X\setlength{\daughteroffset}{0in}%
X\ifdim\parentoffset<0in%
X\setlength{\daughteroffset}{-\parentoffset}%
X\setlength{\parentoffset}{0in}\fi%
X\setlength{\parentwidth}{\parentoffset}%
X\addtolength{\parentwidth}{\wd\parentbox}%
X\setlength{\treeoffset}{\daughteroffset}%
X\addtolength{\treeoffset}{\treeoffsetthree}%
X\setlength{\treewidth}{\wd\treeboxone}%
X\addtolength{\treewidth}{\daughteroffsetone}%
X\addtolength{\treewidth}{\treewidthtwo}%
X\addtolength{\treewidth}{\daughteroffsettwo}%
X\addtolength{\treewidth}{\treewidththree}%
X\addtolength{\treewidth}{\daughteroffset}%
X\ifdim\treewidth<\parentwidth\setlength{\treewidth}{\parentwidth}\fi%
X\sbox{\treebox}{\begin{minipage}{\treewidth}%
X\begin{flushleft}%
X\hspace*{\parentoffset}\usebox{\parentbox}\\
X{\setlength{\unitlength}{0.5\branchwidth}%
X\hspace*{\treeoffset}\begin{picture}(4,1)%
X\put(0,0){\line(2,1){2}}%
X\put(2,0){\line(0,1){1}}%
X\put(4,0){\line(-2,1){2}}%
X\end{picture}}\\
X\vspace{-\baselineskip}%
X\hspace*{\daughteroffset}%
X\makebox[\treewidththree][l]%
X{\raisebox{-\ht\treeboxthree}{\usebox{\treeboxthree}}}%
X\hspace*{\daughteroffsettwo}%
X\makebox[\treewidthtwo][l]%
X{\raisebox{-\ht\treeboxtwo}{\usebox{\treeboxtwo}}}%
X\hspace*{\daughteroffsetone}%
X\raisebox{-\ht\treeboxone}{\usebox{\treeboxone}}%
X\end{flushleft}%
X\end{minipage}}%
X\setlength{\treeoffsetone}{\parentoffset}%
X\addtolength{\treeoffsetone}{0.5\wd\parentbox}%
X\setlength{\treeshiftone}{0pt}%
X\setlength{\treewidthone}{\treewidth}%
X\sbox{\treeboxone}{\usebox{\treebox}}\poptree\poptree%
X\else\ifnum\value{branchcount}=4\sbox{\parentbox}{\ontop{#2}}%
X\setlength{\branchwidthone}{\treewidthtwo}%
X\addtolength{\branchwidthone}{\treeoffsetone}%
X\addtolength{\branchwidthone}{-\treeshiftone}%
X\addtolength{\branchwidthone}{-\treeoffsettwo}%
X\setlength{\branchwidthtwo}{\treewidththree}%
X\addtolength{\branchwidthtwo}{\treeoffsettwo}%
X\addtolength{\branchwidthtwo}{-\treeshifttwo}%
X\addtolength{\branchwidthtwo}{-\treeoffsetthree}%
X\setlength{\branchwidththree}{\treewidthfour}%
X\addtolength{\branchwidththree}{\treeoffsetthree}%
X\addtolength{\branchwidththree}{-\treeshiftthree}%
X\addtolength{\branchwidththree}{-\treeoffsetfour}%
X\setlength{\branchwidth}{\branchwidthone}%
X\ifdim\branchwidthtwo>\branchwidth%
X\setlength{\branchwidth}{\branchwidthtwo}\fi%
X\ifdim\branchwidththree>\branchwidth%
X\setlength{\branchwidth}{\branchwidththree}\fi%
X\setlength{\daughteroffsetone}{\branchwidth}%
X\addtolength{\daughteroffsetone}{-\branchwidthone}%
X\addtolength{\daughteroffsetone}{-\treeshiftone}%
X\setlength{\daughteroffsettwo}{\branchwidth}%
X\addtolength{\daughteroffsettwo}{-\branchwidthtwo}%
X\addtolength{\daughteroffsettwo}{-\treeshifttwo}%
X\setlength{\daughteroffsetthree}{\branchwidth}%
X\addtolength{\daughteroffsetthree}{-\branchwidththree}%
X\addtolength{\daughteroffsetthree}{-\treeshiftthree}%
X\setlength{\parentoffset}{-0.5\wd\parentbox}%
X\addtolength{\parentoffset}{\treeoffsetfour}%
X\addtolength{\parentoffset}{1.5\branchwidth}%
X\setlength{\daughteroffset}{0in}%
X\ifdim\parentoffset<0in%
X\setlength{\daughteroffset}{-\parentoffset}%
X\setlength{\parentoffset}{0in}\fi%
X\setlength{\parentwidth}{\parentoffset}%
X\addtolength{\parentwidth}{\wd\parentbox}%
X\setlength{\treeoffset}{\daughteroffset}%
X\addtolength{\treeoffset}{\treeoffsetfour}%
X\setlength{\treewidth}{\wd\treeboxone}%
X\addtolength{\treewidth}{\daughteroffsetone}%
X\addtolength{\treewidth}{\treewidthtwo}%
X\addtolength{\treewidth}{\daughteroffsettwo}%
X\addtolength{\treewidth}{\treewidththree}%
X\addtolength{\treewidth}{\daughteroffsetthree}%
X\addtolength{\treewidth}{\treewidthfour}%
X\addtolength{\treewidth}{\daughteroffset}%
X\ifdim\treewidth<\parentwidth\setlength{\treewidth}{\parentwidth}\fi%
X\sbox{\treebox}{\begin{minipage}{\treewidth}%
X\begin{flushleft}%
X\hspace*{\parentoffset}\usebox{\parentbox}\\
X{\setlength{\unitlength}{0.5\branchwidth}%
X\hspace*{\treeoffset}\begin{picture}(6,1)%
X\put(0,0){\line(3,1){3}}%
X\put(2,0){\line(1,1){1}}%
X\put(4,0){\line(-1,1){1}}%
X\put(6,0){\line(-3,1){3}}%
X\end{picture}}\\
X\vspace{-\baselineskip}%
X\hspace*{\daughteroffset}%
X\makebox[\treewidthfour][l]%
X{\raisebox{-\ht\treeboxfour}{\usebox{\treeboxfour}}}%
X\hspace*{\daughteroffsetthree}%
X\makebox[\treewidththree][l]%
X{\raisebox{-\ht\treeboxthree}{\usebox{\treeboxthree}}}%
X\hspace*{\daughteroffsettwo}%
X\makebox[\treewidthtwo][l]%
X{\raisebox{-\ht\treeboxtwo}{\usebox{\treeboxtwo}}}%
X\hspace*{\daughteroffsetone}%
X\raisebox{-\ht\treeboxone}{\usebox{\treeboxone}}%
X\end{flushleft}%
X\end{minipage}}%
X\setlength{\treeoffsetone}{\parentoffset}%
X\addtolength{\treeoffsetone}{0.5\wd\parentbox}%
X\setlength{\treeshiftone}{0pt}%
X\setlength{\treewidthone}{\treewidth}%
X\sbox{\treeboxone}{\usebox{\treebox}}\poptree\poptree\poptree%
X\else\ifnum\value{branchcount}=5\sbox{\parentbox}{\ontop{#2}}%
X\setlength{\branchwidthone}{\treewidthtwo}%
X\addtolength{\branchwidthone}{\treeoffsetone}%
X\addtolength{\branchwidthone}{-\treeshiftone}%
X\addtolength{\branchwidthone}{-\treeoffsettwo}%
X\setlength{\branchwidthtwo}{\treewidththree}%
X\addtolength{\branchwidthtwo}{\treeoffsettwo}%
X\addtolength{\branchwidthtwo}{-\treeshifttwo}%
X\addtolength{\branchwidthtwo}{-\treeoffsetthree}%
X\setlength{\branchwidththree}{\treewidthfour}%
X\addtolength{\branchwidththree}{\treeoffsetthree}%
X\addtolength{\branchwidththree}{-\treeshiftthree}%
X\addtolength{\branchwidththree}{-\treeoffsetfour}%
X\setlength{\branchwidthfour}{\treewidthfive}%
X\addtolength{\branchwidthfour}{\treeoffsetfour}%
X\addtolength{\branchwidthfour}{-\treeshiftfour}%
X\addtolength{\branchwidthfour}{-\treeoffsetfive}%
X\setlength{\branchwidth}{\branchwidthone}%
X\ifdim\branchwidthtwo>\branchwidth%
X\setlength{\branchwidth}{\branchwidthtwo}\fi%
X\ifdim\branchwidththree>\branchwidth%
X\setlength{\branchwidth}{\branchwidththree}\fi%
X\ifdim\branchwidthfour>\branchwidth%
X\setlength{\branchwidth}{\branchwidthfour}\fi%
X\setlength{\daughteroffsetone}{\branchwidth}%
X\addtolength{\daughteroffsetone}{-\branchwidthone}%
X\addtolength{\daughteroffsetone}{-\treeshiftone}%
X\setlength{\daughteroffsettwo}{\branchwidth}%
X\addtolength{\daughteroffsettwo}{-\branchwidthtwo}%
X\addtolength{\daughteroffsettwo}{-\treeshifttwo}%
X\setlength{\daughteroffsetthree}{\branchwidth}%
X\addtolength{\daughteroffsetthree}{-\branchwidththree}%
X\addtolength{\daughteroffsetthree}{-\treeshiftthree}%
X\setlength{\daughteroffsetfour}{\branchwidth}%
X\addtolength{\daughteroffsetfour}{-\branchwidthfour}%
X\addtolength{\daughteroffsetfour}{-\treeshiftfour}%
X\setlength{\parentoffset}{-0.5\wd\parentbox}%
X\addtolength{\parentoffset}{\treeoffsetfive}%
X\addtolength{\parentoffset}{2\branchwidth}%
X\setlength{\daughteroffset}{0in}%
X\ifdim\parentoffset<0in%
X\setlength{\daughteroffset}{-\parentoffset}%
X\setlength{\parentoffset}{0in}\fi%
X\setlength{\parentwidth}{\parentoffset}%
X\addtolength{\parentwidth}{\wd\parentbox}%
X\setlength{\treeoffset}{\daughteroffset}%
X\addtolength{\treeoffset}{\treeoffsetfive}%
X\setlength{\treewidth}{\wd\treeboxone}%
X\addtolength{\treewidth}{\daughteroffsetone}%
X\addtolength{\treewidth}{\treewidthtwo}%
X\addtolength{\treewidth}{\daughteroffsettwo}%
X\addtolength{\treewidth}{\treewidththree}%
X\addtolength{\treewidth}{\daughteroffsetthree}%
X\addtolength{\treewidth}{\treewidthfour}%
X\addtolength{\treewidth}{\daughteroffsetfour}%
X\addtolength{\treewidth}{\treewidthfive}%
X\addtolength{\treewidth}{\daughteroffset}%
X\ifdim\treewidth<\parentwidth\setlength{\treewidth}{\parentwidth}\fi%
X\sbox{\treebox}{\begin{minipage}{\treewidth}%
X\begin{flushleft}%
X\hspace*{\parentoffset}\usebox{\parentbox}\\
X{\setlength{\unitlength}{0.5\branchwidth}%
X\hspace*{\treeoffset}\begin{picture}(8,1)%
X\put(0,0){\line(4,1){4}}%
X\put(2,0){\line(2,1){2}}%
X\put(4,0){\line(0,1){1}}%
X\put(6,0){\line(-2,1){2}}%
X\put(8,0){\line(-4,1){4}}%
X\end{picture}}\\
X\vspace{-\baselineskip}%
X\hspace*{\daughteroffset}%
X\makebox[\treewidthfive][l]%
X{\raisebox{-\ht\treeboxfour}{\usebox{\treeboxfive}}}%
X\hspace*{\daughteroffsetfour}%
X\makebox[\treewidthfour][l]%
X{\raisebox{-\ht\treeboxfour}{\usebox{\treeboxfour}}}%
X\hspace*{\daughteroffsetthree}%
X\makebox[\treewidththree][l]%
X{\raisebox{-\ht\treeboxthree}{\usebox{\treeboxthree}}}%
X\hspace*{\daughteroffsettwo}%
X\makebox[\treewidthtwo][l]%
X{\raisebox{-\ht\treeboxtwo}{\usebox{\treeboxtwo}}}%
X\hspace*{\daughteroffsetone}%
X\raisebox{-\ht\treeboxone}{\usebox{\treeboxone}}%
X\end{flushleft}%
X\end{minipage}}%
X\setlength{\treeoffsetone}{\parentoffset}%
X\addtolength{\treeoffsetone}{0.5\wd\parentbox}%
X\setlength{\treeshiftone}{0pt}%
X\setlength{\treewidthone}{\treewidth}%
X\sbox{\treeboxone}{\usebox{\treebox}}\poptree\poptree\poptree\poptree%
X\else\typeout{QobiTeX warning--- Can't handle #1 branching}\fi\fi\fi\fi\fi}
X%
X\newcommand{\faketreewidth}[1]{%
X\sbox{\parentbox}{\ontop{#1}}%
X\setlength{\treewidthone}{0.5\wd\parentbox}%
X\addtolength{\treewidthone}{\treeoffsetone}%
X\setlength{\treeshiftone}{\treeoffsetone}%
X\addtolength{\treeshiftone}{-0.5\wd\parentbox}}
X%
X
X\newdimen\qbog
X\newcommand{\qobitree}{%
X\leavevmode
X\qbog=\ht\treeboxone
X\advance\qbog by -.7\baselineskip
X%\fbox{\raise-\qbog \box\treeboxone}
X\raise-\qbog \box\treeboxone
X\setlength{\treeoffsetone}{\treeoffsettwo}%
X\setbox\treeboxone \box\treeboxtwo
X\poptree }
X
X
X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
X
X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
X
X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
X
X% Front end for qobitree.  Reads a tree in bracketed notation and
X% generates commands to build the specified tree.
X% Tokens are space-delimited; brackets {} may be used to alter grouping.
X%
X% Alexis Dimitriadis (alexis@babel.ling.upenn.edu), Dec 6, 1993.
X%
X% Sample input:
X% \Tree [ [ John ].NP [ has [ [ seen ].V [ {the book} ].NP ].T ].IP ].S
X% To insert extra material, precede token with an exclamation mark, e.g.
X%       ... ].V !\faketreewidth{VPP} ...
X
X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
X% Very messy stack macros, to make up for lack of nested environments in
X% qobitree. 
X%
X% \Spush\Stack{X} 	Push X on stack \Stack.
X% \Spop\Stack 	  	Pop top element off \Stack, leave in the input stream.
X% \Spopd\Stack\to\v	Define \v to be the top element of \Stack, pop it.
X%
X
X% This will trigger a LaTeX diagnostic if we pop too far.
X\def\qbstack{<Stack Underflow>}
X\def\qnstack{<Stack Underflow>}
X
X
X\newtoks\qta \newtoks\qtb
X% Expand #2 and push on stack #1.  Things already pushed are not
X% reexpanded.
X\long\def\Spush#1#2{\qta=\expandafter{#1}%
X	\edef#1{{#2}\noexpand\@@STP{\the\qta}}}
X
X% Push #2 on stack #1 unexpanded.
X%
X\long\def\SpushU#1#2{\qta=\expandafter{#1}\qtb={#2}%
X	\edef#1{{\the\qtb}\noexpand\@@STP{\the\qta}}}
X
X\def\@@STP{\def\@@StpV}
X
X% Pop the top element of stack #1, leaving in the input stream.
X%
X\def\Spop#1{#1\let#1=\@@StpV}
X
X% Pop the top element of stack #1, expand it, and define #2 to it.
X% 
X\def\SpopD#1#2{\expandafter\qta#1\let#1=\@@StpV\edef#2{\the\qta}}
X
X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
X%
X% This is the front end proper.  Everything else is just sugar.
X% (the stack macros are necessary).
X%
X\newcount\nbranches
X\newif\ifqtreecenter \qtreecentertrue
X
X\def\Tree{\ifqtreecenter\hskip 0pt plus 1fil\fi \bgroup
X\automath \nbranches=0\relax \recurse }
X
X% The empty hbox is a hack to move the trees to the left a little
X\def\endTree{\qobitree \egroup \ifqtreecenter\hbox to 0.5in{}\fi }
X
X\def\doanode#1 {\advance\nbranches by1 \leaf{#1 }\lookfornodes}
X
X\def\recurse[{\@ifnextchar.{\@recurse}{\@recurse. }}
X\def\@recurse.#1 {\SpushU\qnstack{#1}%
X\Spush\qbstack{\number\nbranches}\nbranches=0\relax \lookfornodes } 
X
X\def\closeoff]{\@ifnextchar.{\expandafter\@closeoff}{\expandafter\@closeoff. }}
X% If either label is missing, use the other.
X% Otherwise, disallow mismatched labels
X% Push and pop right argument to make sure the tokens are in same state...
X\def\@closeoff.#1 {%
X\def\rarg{#1}
X\SpopD\qnstack\larg
X\ifx\larg\@empty \let\larg=\rarg 
X\else \ifx\rarg\@empty \let\rarg=\larg \fi\fi
X\ifx\larg\rarg \else 
X	\message{}\errmessage{MISMATCHED LABELS, [.\larg ... ].\rarg}%
X  \fi 
X\@@closeoff\larg }
X
X\def\@@closeoff#1{%
X\branch{\number\nbranches}{#1}%
X\SpopD\qbstack\x\nbranches=\x \relax
X%	\showthe\nbranches 
X\ifnum\nbranches>0\relax  \expandafter\lookfornodes
X\else \expandafter\endTree \fi}
X
X\def\lookfornodes{\@ifnextchar]{\closeoff}{%
X\@ifnextchar[{\advance\nbranches by1\relax \recurse}{%
X\@ifnextchar!{\pushliteral}{\doanode}}}}
X
X
X\def\pushliteral!#1 {#1\relax \lookfornodes}
X
X
X%  Include eepic if found, else warn
X\@input{eepic.sty}
X
X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
X
X% and another odd convenience:
X%
X% Make _, ^ go into math mode automatically in the scope of \automath
X%
X{ % Temporarily change catcodes
X\catcode`\_=\active
X\catcode`\^=\active
X%\catcode`\'=\active
X%
X\global\def\automath{%
X\catcode`\_=\active
X\catcode`\^=\active
X\def_##1{\ifmmode\sb {##1} \else $\sb{##1} $\fi}%
X\def^##1{\ifmmode\sp {##1} \else $\sp{##1} $\fi}%
X}}
X
X\def\noautomath{%
X\catcode`\_=8 
X\catcode`\^=7 
X}
X
X% Let \0, \1, \2 produce ^0, $'$, $''$
X\def\0{\ifmmode ^0 \else $^0$ \fi}
X\def\1{\ifmmode ' \else $'$ \fi}
X\def\0{\ifmmode '' \else $''$ \fi}
X
X
X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
X
X% qroof: Build a triangular ``roof'' with label #2 and contents (under the
X% roof) #1.  The width of the roof is computed automatically.  The contents
X% may contain line breaks (\\).
X%
X
X% The slope of the roof built by qroof (may be changed anywhere).
X\newcount\qroofx
X\newcount\qroofy
X\qroofx=3 \qroofy=1
X\newbox\@scratchbox
X
X\def\qroof#1.#2 {{%
X\tabcolsep=0pt
X\setbox\@scratchbox=\hbox{\ \begin{tabular}{l} #1 \end{tabular}}%
X\begin{tabular}{c} #2 \\
X
X\def\wwd{\count1}%
X\wwd=\wd\@scratchbox
X\count0=\wwd
X\multiply\count0 by \qroofy
X\divide \count0 by 2
X\divide\count0 by \qroofx
X
X\unitlength=1sp
X\begin{picture}(\wwd,\count0)
X
X\put(0, 0){\line(1,0){\wwd}}
X\count0=\wwd
X\divide\wwd by 2
X\put(0, 0){\line(\qroofx, \qroofy){\wwd}}
X\put(\count0, 0){\line(-\qroofx, \qroofy){\wwd}}
X\end{picture}%
X\\[-0.6ex] %Pushes the text closer to the roof
X\box\@scratchbox \end{tabular}}}
X
SHAR_EOF
chmod 644 'qtree.sty'
sed 's/^X//' << \SHAR_EOF > 'eepic.sty'
X\typeout{%
XEnhancements to Picture Environment. Version 1.2 - Released June 1, 1986}
X%----------------------------------------------------------------------
X% Copyright (C) podar@sbcs (Sunil Podar) July 14,1986.
X% You may use this file in whatever way you wish. You are requested to 
X% leave this notice intact, and report any bugs, enhancements, comments,
X% suggestions, etc. to:
X% USmail: Sunil Podar,Dept. of Computer Science,SUNY at Stony Brook,NY 11794.
X%  CSNET: podar@sbcs.csnet
X%   ARPA: podar%suny-sb.csnet@csnet-relay.arpa
X%   UUCP: {allegra, hocsd, philabs, ogcvax}!sbcs!podar
X%----------------------------------------------------------------------
X% This file contains implementation of:
X% \multiputlist	\matrixput	\grid		\picsquare
X% \dottedline	\dashline	\drawline	\jput
X% \putfile
X% Environments: dottedjoin, dashjoin and drawjoin
X%
X% For documentation, see the accompanying manual.
X%----------------------------------------------------------------------
X% usage: \multiputlist(x,y)(delta-x,delta-y)[tbrl]{item1,item2,item3,.....}
X% \lop and \lopoff taken from TeXbook.
X%----------------------------------------------------------------------
X\def\lop#1\to#2{\expandafter\lopoff#1\lopoff#1#2}
X\long\def\lopoff,#1,#2\lopoff#3#4{\def#4{#1}\def#3{,#2}}
X\def\@@mlistempty{,}
X\newif\iflistnonempty
X\def\multiputlist(#1,#2)(#3,#4){\@ifnextchar
X[{\@imultiputlist(#1,#2)(#3,#4)}{\@imultiputlist(#1,#2)(#3,#4)[]}}
X
X\long\def\@imultiputlist(#1,#2)(#3,#4)[#5]#6{{%
X\@xdim=#1\unitlength \@ydim=#2\unitlength
X\listnonemptytrue \def\@@mlist{,#6,} % need this for end condition
X\loop
X\lop\@@mlist\to\@@firstoflist
X\@killglue\raise\@ydim\hbox to\z@{\hskip
X\@xdim\@imakepicbox(0,0)[#5]{\@@firstoflist}\hss}
X\advance\@xdim #3\unitlength\advance\@ydim #4\unitlength
X\ifx\@@mlist\@@mlistempty \listnonemptyfalse\fi
X\iflistnonempty
X\repeat\relax
X\ignorespaces}}
X%----------------------------------------------------------------------
X% two-dimensional version of \multiput
X% \matrixput(0,0)(20,0){5}(0,20){3}{\circle{2}}
X%----------------------------------------------------------------------
X\newcount\@@multicnt
X\def\matrixput(#1,#2)(#3,#4)#5(#6,#7)#8#9{%
X\ifnum#5>#8\@matrixput(#1,#2)(#3,#4){#5}(#6,#7){#8}{#9}%
X\else\@matrixput(#1,#2)(#6,#7){#8}(#3,#4){#5}{#9}\fi}
X
X%% here #5 >= #8
X\long\def\@matrixput(#1,#2)(#3,#4)#5(#6,#7)#8#9{{\@killglue%
X\@multicnt=#5\relax\@@multicnt=#8\relax%
X\@xdim=0pt%
X\@ydim=0pt%
X\setbox\@tempboxa\hbox{\@whilenum \@multicnt > 0\do {%
X%%\typeout{\the\@multicnt, \the\@@multicnt}%
X\raise\@ydim\hbox to \z@{\hskip\@xdim #9\hss}%
X\advance\@multicnt \m@ne%
X\advance\@xdim #3\unitlength\advance\@ydim #4\unitlength}}%
X\@xdim=#1\unitlength%
X\@ydim=#2\unitlength%
X\@whilenum \@@multicnt > 0\do {%
X\raise\@ydim\hbox to \z@{\hskip\@xdim \copy\@tempboxa\hss}%
X\advance\@@multicnt \m@ne%
X\advance\@xdim #6\unitlength\advance\@ydim #7\unitlength}%
X\ignorespaces}}
X%----------------------------------------------------------------------
X%\grid(wd,ht)(delta-wd,delta-ht)[initial-X-integer,initial-Y-integer]
X% example: 1. \put(0,0){\grid(95,100)(9.5,10)}
X%          2. \put(0,0){\grid(100,100)(10,5)[-10,0]}
X%          or \put(0,0){\tiny \grid(100,100)(5,5)[0,0]}%numbers in \tiny font
X%----------------------------------------------------------------------
X\newcount\d@lta
X\newdimen\@delta
X\newdimen\@@delta
X\newcount\@gridcnt
X\def\grid(#1,#2)(#3,#4){\@ifnextchar [{\@igrid(#1,#2)(#3,#4)}%
X{\@igrid(#1,#2)(#3,#4)[@,@]}}
X
X\long\def\@igrid(#1,#2)(#3,#4)[#5,#6]{%
X\makebox(#1,#2){%
X\@delta=#1pt\@@delta=#3pt\divide\@delta \@@delta\d@lta=\@delta%
X\advance\d@lta \@ne\relax\message{grid=\the\d@lta\space x}%
X%% copied the definition of \line(0,1){#2} for some efficiency!.
X\multiput(0,0)(#3,0){\d@lta}{\hbox to\z@{\hskip -\@halfwidth \vrule
X	 \@width \@wholewidth \@height #2\unitlength \@depth \z@\hss}}%
X\ifx#5@\relax\else%
X\global\@gridcnt=#5%
X\multiput(0,0)(#3,0){\d@lta}{%
X\makebox(0,-2)[t]{\number\@gridcnt\global\advance\@gridcnt by #3}}%
X\global\@gridcnt=#5%
X\multiput(0,#2)(#3,0){\d@lta}{\makebox(0,0)[b]{\number\@gridcnt\vspace{2mm}%
X\global\advance\@gridcnt by #3}}%
X\fi%
X\@delta=#2pt\@@delta=#4pt\divide\@delta \@@delta\d@lta=\@delta%
X\advance\d@lta \@ne\relax\message{\the\d@lta . }%
X%% copied the definition of \line(1,0){#1} for some efficiency!.
X\multiput(0,0)(0,#4){\d@lta}{\vrule \@height \@halfwidth \@depth \@halfwidth
X	 \@width #1\unitlength}%
X\ifx#6@\relax\else
X\global\@gridcnt=#6%
X\multiput(0,0)(0,#4){\d@lta}{%
X\makebox(0,0)[r]{\number\@gridcnt\ \global\advance\@gridcnt by #4}}%
X\global\@gridcnt=#6%
X\multiput(#1,0)(0,#4){\d@lta}{%
X\makebox(0,0)[l]{\ \number\@gridcnt\global\advance\@gridcnt by #4}}%
X\fi}}
X%----------------------------------------------------------------------
X% \picsquare is a centered square of dimensions governed by \thinlines,
X% \thicklines or \linethickness declarations.
X\def\picsquare{\hskip -0.5\@wholewidth%
X\vrule height \@halfwidth depth \@halfwidth width \@wholewidth}
X%
X% just a square dot with reference point at bottom-left
X\def\picsquare@bl{\vrule height \@wholewidth depth \z@  width \@wholewidth}
X%----------------------------------------------------------------------
X% \begin{dottedjoin}{interdot-gap in units}
X% .....			
X% \end{dottedjoin}
X% \begin{dashjoin}{dash-length in units}{interdotgap in each dash}
X% .....			
X% \end{dashjoin}
X% \begin{drawjoin}
X% .....
X% \end{drawjoin}
X% \jput(x,y){character}
X% \dottedline[opt. dotcharacter]{dotgap in units}(x1,y1)(x2,y2)...(xN,yN)
X% \dashline[#]{dash-length}[opt. dotgap](x1,y1)(x2,y2)...(xN,yN)
X% \drawline[#](x1,y1)(x2,y2)...(xN,yN)
X%----------------------------------------------------------------------
X% definitions for *join environment. had to do all this mess because of
X% optional arguments.
X%----------------------------------------------------------------------
X\newif\if@jointhem \global\@jointhemfalse
X\newif\if@firstpoint \global\@firstpointtrue
X\newcount\@joinkind
X%\newenvironment{dottedjoin}[1]%[opt char]{dotgap}
X%{\global\@jointhemtrue \gdef\dotgap@join{#1}\global\@joinkind=0\relax}%
X%{\global\@jointhemfalse \global\@firstpointtrue}
X%----------------------------------------------------------------------
X\def\dottedjoin{\global\@jointhemtrue \global\@joinkind=0\relax
X  \bgroup\@ifnextchar[{\@idottedjoin}{\@idottedjoin[\picsquare@bl]}}
X\def\@idottedjoin[#1]#2{\gdef\dotchar@join{#1}\gdef\dotgap@join{#2}}
X\def\enddottedjoin{\global\@jointhemfalse \global\@firstpointtrue\egroup}
X%----------------------------------------------------------------------
X\def\dashjoin{\global\@jointhemtrue \global\@joinkind=1\relax
X  \bgroup\@ifnextchar[{\@idashjoin}{\@idashjoin[\dashlinestretch]}}
X\def\@idashjoin[#1]#2{\edef\dashlinestretch{#1}\gdef\dashlen@join{#2}%
X\@ifnextchar[{\@iidashjoin}{\gdef\dotgap@join{}}}
X\def\@iidashjoin[#1]{\gdef\dotgap@join{#1}}
X\let\enddashjoin\enddottedjoin
X%----------------------------------------------------------------------
X\def\drawjoin{\global\@jointhemtrue \global\@joinkind=2\relax
X  \bgroup\@ifnextchar[{\@idrawjoin}{}}
X\def\@idrawjoin[#1]{\def\drawlinestretch{#1}}
X\let\enddrawjoin\enddottedjoin
X%----------------------------------------------------------------------
X%% this is equiv to \put(x,y){#1} when not in {dot*join} environment.
X\long\def\jput(#1,#2)#3{{\@killglue\raise#2\unitlength\hbox to \z@{\hskip
X#1\unitlength #3\hss}\ignorespaces}
X\if@jointhem
X \if@firstpoint \gdef\x@one{#1} \gdef\y@one{#2} \global\@firstpointfalse
X \else\ifcase\@joinkind
X	\@dottedline[\dotchar@join]{\dotgap@join\unitlength}%
X(\x@one\unitlength,\y@one\unitlength)(#1\unitlength,#2\unitlength)
X	\or\@dashline[\dashlinestretch]{\dashlen@join}[\dotgap@join]%
X(\x@one,\y@one)(#1,#2)
X	\else\@drawline[\drawlinestretch](\x@one,\y@one)(#1,#2)\fi
X    \gdef\x@one{#1} \gdef\y@one{#2}
X \fi
X\fi}
X%----------------------------------------------------------------------
X\newdimen\@dotgap
X\newdimen\@ddotgap
X\newcount\@x@diff
X\newcount\@y@diff
X\newdimen\x@diff
X\newdimen\y@diff
X\newbox\@dotbox
X\newcount\num@segments
X\newcount\num@segmentsi
X\newif\ifsqrt@done
X%% from sqrtandstuff func basically need \num@segments.
X%% given a deltax, deltay and dotgap, it calculates \num@segments = number of
X%% segments along the hypotenuse. used by \dottedline & \dashline.
X%% It finishes quickly if any of deltax or deltay are zero or close to zero.
X\def\sqrtandstuff#1#2#3{
X\ifdim #1 <0pt \@x@diff= -#1 \else\@x@diff=#1\fi
X\ifdim #2 <0pt \@y@diff= -#2 \else\@y@diff=#2\fi
X%% @diff's will be positive and diff's will retain their sign.
X\@dotgap=#3 \divide\@dotgap \tw@
X\advance\@x@diff \@dotgap \advance\@y@diff \@dotgap% for round-off errors
X\@dotgap=#3
X\divide\@x@diff \@dotgap \divide\@y@diff \@dotgap
X\sqrt@donefalse
X\ifnum\@x@diff < 2
X   \ifnum\@y@diff < 2 \num@segments=\@x@diff \advance\num@segments \@y@diff
X		      \sqrt@donetrue
X        \else\num@segments=\@y@diff \sqrt@donetrue\fi
X   \else\ifnum\@y@diff < 2 \num@segments=\@x@diff \sqrt@donetrue\fi
X\fi
X\ifsqrt@done \ifnum\num@segments=\z@ \num@segments=\@ne\fi\relax
X \else \ifnum\@y@diff >\@x@diff
X		 \@tempcnta=\@x@diff \@x@diff=\@y@diff \@y@diff=\@tempcnta
X       \fi    		%exchange @x@diff & @y@diff, so now @x@diff > @y@diff
X  \num@segments=\@y@diff
X  \multiply\num@segments \num@segments
X  \multiply\num@segments by 457
X  \divide\num@segments \@x@diff
X  \advance\num@segments by 750 % for round-off, going to divide by 1000.
X  \divide\num@segments \@m
X  \advance\num@segments \@x@diff
X		%num@segments = @x@diff + (0.457*sqr(@y@diff)/@x@diff)
X\fi}
X%----------------------------------------------------------------------
X% \dottedline[opt. char]{interdot gap in units}(x1,y1)(x2,y2)....(xN,yN)
X%----------------------------------------------------------------------
X%% Used the following construction earlier but that results in box memory
X%% full much too soon although it works perfectly.
X%% \setbox\@dotbox\vbox to\z@{\vss \hbox to\z@{\hss #1\hss}\vss}\relax}
X%% The cenetering of characters is achieved by substracting half the ht, wd
X%% of character from the (x,y) coordinates where they are to be put. We
X%% chose to use a macro for the ``dot'' instead of \copy\box to save memory
X%% at the expense of extra cpu, since memory becomes an issue very soon.
X%% \picsquare is already centered, whereas other characters, except \circle,
X%% will not be cenetered, hence to handle them all in a similar fashion,
X%% used \picsquare@bl.
X%
X% kind of tail recursion.
X\def\dottedline{\@ifnextchar [{\@idottedline}{\@idottedline[\picsquare@bl]}}
X\def\@idottedline[#1]#2(#3,#4){\@ifnextchar (%
X{\@iidottedline[#1]{#2}(#3,#4)}{\relax}}
X\def\@iidottedline[#1]#2(#3,#4)(#5,#6){\@dottedline[#1]{#2\unitlength}%
X(#3\unitlength,#4\unitlength)(#5\unitlength,#6\unitlength)%
X\@idottedline[#1]{#2}(#5,#6)}
X%
X%% user not supposed to use this directly. arguments in absolute dimensions.
X%% need to pass absolute dimens here because dashline calls dottedline and
X%% can supply only absolute dimensions.
X\long\def\@dottedline[#1]#2(#3,#4)(#5,#6){{%
X\x@diff=#5\relax\advance\x@diff by -#3\relax
X\y@diff=#6\relax\advance\y@diff by -#4\relax
X\sqrtandstuff{\x@diff}{\y@diff}{#2}
X\divide\x@diff \num@segments
X\divide\y@diff \num@segments
X\advance\num@segments \@ne     % to put the last point at destination.
X%%\typeout{num@segments= \the\num@segments}
X\setbox\@dotbox\hbox{#1}% just to get the dimensions of the character.
X\@xdim=#3 \@ydim=#4
X\ifdim\ht\@dotbox >\z@% otherwise its a circle.
X  \advance\@xdim -0.5\wd\@dotbox
X  \advance\@ydim -0.5\ht\@dotbox
X  \advance\@ydim .5\dp\@dotbox\fi
X%%circle's have a ht=0, this is one way I could think of to catch circles.
X%%following loop is equiv to
X%%\multiput(\@xdim,\@ydim)(\x@diff,\y@diff){\num@segments}{#1}
X%%with arguments in absolute dimensions.
X\@killglue
X\loop \ifnum\num@segments > 0
X\unskip\raise\@ydim\hbox to\z@{\hskip\@xdim #1\hss}%
X\advance\num@segments \m@ne\advance\@xdim\x@diff\advance\@ydim\y@diff%
X\repeat
X\ignorespaces}}
X%----------------------------------------------------------------------
X% \dashline[#]{dash-length}[optional dotgap](x1,y1)(x2,y2)...(xN,yN)
X% The minimum # of dashes put is 2, one at either end point; dash-length is
X% reduced accordingly if necessary. Also have to some dirty work to account
X% for stretch & shrink.
X% \renewcommand{\dashlinestretch}{-50}  %ONLY INTEGERS PERMITTED.
X%----------------------------------------------------------------------
X\def\dashlinestretch{0} %well, could have used a counter.
X\def\dashline{\@ifnextchar [{\@idashline}{\@idashline[\dashlinestretch]}}
X\def\@idashline[#1]#2{\@ifnextchar [{\@iidashline[#1]{#2}}%
X{\@iidashline[#1]{#2}[\@empty]}} %\@empty needed-- later checked with \ifx 
X\def\@iidashline[#1]#2[#3](#4,#5){\@ifnextchar (%
X{\@iiidashline[#1]{#2}[#3](#4,#5)}{\relax}}
X%
X\def\@iiidashline[#1]#2[#3](#4,#5)(#6,#7){%
X\@dashline[#1]{#2}[#3](#4,#5)(#6,#7)%
X\@iidashline[#1]{#2}[#3](#6,#7)}
X%
X\long\def\@dashline[#1]#2[#3](#4,#5)(#6,#7){{%
X\x@diff=#6\unitlength \advance\x@diff by -#4\unitlength
X\y@diff=#7\unitlength \advance\y@diff by -#5\unitlength
X%% correction to get actual width since the dash-length as taken in arguement
X%% is the center-to-center of the end-points.
X\@tempdima=#2\unitlength \advance\@tempdima -\@wholewidth
X\sqrtandstuff{\x@diff}{\y@diff}{\@tempdima}
X\ifnum\num@segments <3 \num@segments=3\fi% min number of dashes I can plot
X% is 2, 1 at either end, thus min num@segments is 3 (including 'empty dash').
X\@tempdima=\x@diff \@tempdimb=\y@diff
X\divide\@tempdimb by\num@segments
X\divide\@tempdima by\num@segments
X%% ugly if-then-else. If optional dotgap specified, then use it otherwise
X%% make a solid looking dash.
X{\ifx#3\@empty \relax
X    \ifdim\@tempdima < 0pt \x@diff=-\@tempdima\else\x@diff=\@tempdima\fi
X    \ifdim\@tempdimb < 0pt \y@diff=-\@tempdimb\else\y@diff=\@tempdimb\fi
X    \ifdim\x@diff < 0.3pt %it's a vertical dashline
X           \ifdim\@tempdimb > 0pt
X	        \global\setbox\@dotbox\hbox{\hskip -\@halfwidth \vrule
X		 \@width \@wholewidth \@height \@tempdimb}
X	   \else\global\setbox\@dotbox\hbox{\hskip -\@halfwidth \vrule
X		 \@width \@wholewidth \@height\z@ \@depth -\@tempdimb}\fi
X       \else\ifdim\y@diff < 0.3pt %it's a horizontal dashline
X               \ifdim\@tempdima >0pt
X		  \global\setbox\@dotbox\hbox{\vrule \@height \@halfwidth
X		 		\@depth \@halfwidth \@width \@tempdima}
X		\else\global\setbox\@dotbox\hbox{\hskip \@tempdima
X			 \vrule \@height \@halfwidth \@depth \@halfwidth
X				 \@width -\@tempdima \hskip \@tempdima}\fi
X	    \else\global\setbox\@dotbox\hbox{%
X\@dottedline[\picsquare]{0.98\@wholewidth}(0pt,0pt)(\@tempdima,\@tempdimb)}
X\fi\fi
X\else\global\setbox\@dotbox\hbox{%
X\@dottedline[\picsquare]{#3\unitlength}(0pt,0pt)(\@tempdima,\@tempdimb)}
X\fi}
X\advance\x@diff by -\@tempdima % both have same sign
X\advance\y@diff by -\@tempdimb
X%
X%%here we correct the number of dashes to be put by reducing them
X%%appropriately. (num@segments*\@wholewidth) is in some way the slack we
X%%have,and division by dash-length gives the reduction. reduction =
X%%(2*num@segments*\@wholewidth)/dash-length
X%% (num@segments includes empty ones)
X\@tempdima=\num@segments\@wholewidth \@tempdima=2\@tempdima 
X\@tempcnta=\@tempdima \@tempdima=#2\unitlength \@tempdimb=0.5\@tempdima
X\@tempcntb=\@tempdimb \advance\@tempcnta by \@tempcntb % round-off error
X\divide\@tempcnta by\@tempdima \advance\num@segments by -\@tempcnta
X%
X\ifnum #1=0 \relax\else\ifnum #1 < -100
X  \typeout{***dashline: reduction > -100 percent implies blankness!***}
X\else\num@segmentsi=#1 \advance\num@segmentsi by 100
X     \multiply\num@segments by\num@segmentsi \divide\num@segments by 100
X\fi\fi
X%
X\divide\num@segments by 2 % earlier num@segments included 'empty dashes' too.
X\ifnum\num@segments >0 % if =0 then don't divide => \x@diff & \y@diff
X \divide\x@diff by\num@segments%   remain same.
X \divide\y@diff by\num@segments
X \advance\num@segments by\@ne %for the last segment for which I subtracted
X	 		     %\@tempdima & \@tempdimb from \x@diff & \y@diff
X \else\num@segments=2 % one at each end.
X\fi
X%%\typeout{num@segments finally = \the\num@segments}
X%% equiv to \multiput(#4,#5)(\x@diff,\y@diff){\num@segments}{\copy\@dotbox}
X%% with arguements in absolute dimensions.
X\@xdim=#4\unitlength \@ydim=#5\unitlength
X\@killglue
X\loop \ifnum\num@segments > 0
X\unskip\raise\@ydim\hbox to\z@{\hskip\@xdim \copy\@dotbox\hss}%
X\advance\num@segments \m@ne\advance\@xdim\x@diff\advance\@ydim\y@diff%
X\repeat
X\ignorespaces}}
X%----------------------------------------------------------------------
X%%1.00   .833333  .80  .75  .66666   .60  .50  .40  .33333    .25 .20  .16666
X%% .916666 .816666 .775 .708333 .633333 .55 .45 .366666 .291666 .225 .183333
X%% 0.0
X%%0.083333
X%% the first line has absolute slopes corresponding to various permissible
X%% integer combinations representing slopes. The second line is the midpoint
X%% of all those slopes (attempted to show them in the middle of two entries).
X%%
X%% \lineslope(x@diff dimen, y@diff dimen)
X%% Given base (x@diff) and height (y@diff) in dimensions, determines the
X%% closest available slope and returns the two required integers in \@xarg
X%% and \@yarg. The given base and height can be ANYTHING, -ve or +ve, or
X%% even 0pt. \lineslope knows about (0,1) and (1,0) slopes too and returns
X%% correct values if the conditions regarding x@diff & y@diff are obeyed
X%% (see NOTE). Used by \drawline. This is the simplest and only way I could
X%% figure out to accomplish it!.
X%% NOTE: both the dimensions (x@diff & y@diff) must be in SAME units and the
X%% larger of the two dimensions must be atleast 1pt (i.e. 65536sp). To avoid
X%% dividing by 0, I make the larger dimension = 1pt if it is < 1pt.
X%% will need a similar one for vectors, or maybe this can be used. For
X%% vectors the range is -4, 4 unlike lines where it is -6, 6.
X\newif\if@flippedargs
X\def\lineslope(#1,#2){%
X\ifdim #1 <0pt \@xdim= -#1 \else\@xdim=#1\fi
X\ifdim #2 <0pt \@ydim= -#2 \else\@ydim=#2\fi
X%%\typeout{xdim,ydim= \the\@xdim, \the\@ydim}
X\ifdim\@xdim >\@ydim \@tempdima=\@xdim \@xdim=\@ydim \@ydim=\@tempdima
X\@flippedargstrue\else\@flippedargsfalse\fi% x < y
X\ifdim\@ydim >1pt \@tempcnta=\@ydim
X            \divide\@tempcnta by 65536% now \@tempcnta=integral part of #1.
X            \divide\@xdim \@tempcnta\fi
X\ifdim\@xdim <.083333pt \@xarg=1 \@yarg=0
X \else\ifdim\@xdim <.183333pt	\@xarg=6 \@yarg=1
X \else\ifdim\@xdim <.225pt 	\@xarg=5 \@yarg=1
X \else\ifdim\@xdim <.291666pt 	\@xarg=4 \@yarg=1
X \else\ifdim\@xdim <.366666pt 	\@xarg=3 \@yarg=1
X \else\ifdim\@xdim <.45pt 	\@xarg=5 \@yarg=2
X \else\ifdim\@xdim <.55pt 	\@xarg=2 \@yarg=1
X \else\ifdim\@xdim <.633333pt 	\@xarg=5 \@yarg=3
X \else\ifdim\@xdim <.708333pt 	\@xarg=3 \@yarg=2
X \else\ifdim\@xdim <.775pt 	\@xarg=4 \@yarg=3
X \else\ifdim\@xdim <.816666pt 	\@xarg=5 \@yarg=4
X \else\ifdim\@xdim <.916666pt 	\@xarg=6 \@yarg=5
X       \else			\@xarg=1 \@yarg=1%
X\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
X\if@flippedargs\relax\else\@tempcnta=\@xarg \@xarg=\@yarg
X			  \@yarg=\@tempcnta\fi
X\ifdim #1 <0pt \@xarg= -\@xarg\fi
X\ifdim #2 <0pt \@yarg= -\@yarg\fi
X%%\typeout{closest slope integers = \the\@xarg, \the\@yarg}
X}
X%----------------------------------------------------------------------
X% usage: \drawline[#](x1,y1)(x2,y2)....(xN,yN)
X%       		 % # is an optional integer between -100 & infinity.
X% \renewcommand{\drawlinestretch}{-50}  %ONLY INTEGERS PERMITTED.
X%----------------------------------------------------------------------
X\newif\if@toosmall
X\newif\if@drawit
X\newif\if@horvline
X\def\drawlinestretch{0} %well, could have used a counter.
X% kind of tail recursion.
X\def\drawline{\@ifnextchar [{\@idrawline}{\@idrawline[\drawlinestretch]}}
X\def\@idrawline[#1](#2,#3){\@ifnextchar ({\@iidrawline[#1](#2,#3)}{\relax}}
X\def\@iidrawline[#1](#2,#3)(#4,#5){\@drawline[#1](#2,#3)(#4,#5)
X\@idrawline[#1](#4,#5)}
X%
X\def\@drawline[#1](#2,#3)(#4,#5){{%
X\x@diff=#4\unitlength \advance\x@diff by -#2\unitlength
X\y@diff=#5\unitlength \advance\y@diff by -#3\unitlength
X%% override any linethickness declarations, and since horiz & vertical lines
X%% come out thinner than the slanted ones, assign slightly larger values.
X%% default values are: thinlines=0.4pt, thicklines=0.8pt
X\ifx\@linefnt\tenln \linethickness{0.5pt} \else \linethickness{0.9pt}\fi
X\lineslope(\x@diff,\y@diff)% returns the two integers in \@xarg & \@yarg.
X%------
X\@toosmalltrue
X{\ifdim\x@diff <\z@ \x@diff=-\x@diff\fi
X \ifdim\y@diff <\z@ \y@diff=-\y@diff\fi
X \ifdim\x@diff >10pt \global\@toosmallfalse\fi
X \ifdim\y@diff >10pt \global\@toosmallfalse\fi}
X%------
X%% For efficiency, if the line is horiz or vertical then we draw it in one
X%% shot, only if the stretch is not -ve and the line is not too small.
X\@drawitfalse\@horvlinefalse
X\ifnum#1 <0 \relax\else\@horvlinetrue\fi
X\if@toosmall\@horvlinetrue\fi% to get 'or' condition. We necessarily draw a 
X% solid line if the line is too small ignoring any -ve stretch.
X\if@horvline
X \ifdim\x@diff =0pt \put(#2,#3){\ifdim\y@diff >0pt \@linelen=\y@diff \@upline
X 				\else\@linelen=-\y@diff \@downline\fi}%
X \else\ifdim\y@diff =0pt
X          \ifdim\x@diff >0pt \put(#2,#3){\vrule \@height \@halfwidth \@depth
X				\@halfwidth \@width \x@diff}
X		\else \put(#4,#5){\vrule \@height \@halfwidth \@depth
X				\@halfwidth \@width -\x@diff}\fi
X       \else\@drawittrue\fi\fi % construct the line explicitly
X\else\@drawittrue\fi
X%-------------------------------
X\if@drawit
X\ifnum\@xarg< 0 \@negargtrue\else\@negargfalse\fi
X\ifnum\@xarg =0 \setbox\@linechar%
X\hbox{\hskip -\@halfwidth \vrule \@width \@wholewidth \@height 10.2pt
X \@depth \z@}
X\else \ifnum\@yarg =0 \setbox\@linechar%
X\hbox{\vrule \@height \@halfwidth \@depth \@halfwidth \@width 10.2pt}
X\else \if@negarg \@xarg -\@xarg \@yyarg -\@yarg
X        \else \@yyarg \@yarg\fi
X\ifnum\@yyarg >0 \@tempcnta\@yyarg \else \@tempcnta -\@yyarg\fi
X\setbox\@linechar\hbox{\@linefnt\@getlinechar(\@xarg,\@yyarg)}%
X\fi\fi
X%------
X\if@toosmall% => it isn't a horiz or vert line and is toosmall.
X  \@dottedline[\picsquare]{.98\@wholewidth}%
X(#2\unitlength,#3\unitlength)(#4\unitlength,#5\unitlength)%
X\else
X%% following is neat. The last segment takes \wd\@linechar & \ht\@linechar
X%% so plot the line as though it were from (#2,#3) to
X%% (#4-\wd\@linechar,#5-\ht\@linechar) (i.e. for positive slope; of course,
X%% signs are reversed for other slopes). For horizontal & vertical dashes we
X%% don't have to subtract the ht & wd resp. since they are already centered.
X\ifnum\@xarg=0\relax\else\ifdim\x@diff >\z@ \advance\x@diff -\wd\@linechar
X  \else\advance\x@diff \wd\@linechar\fi\fi
X\ifnum\@yarg=0\relax\else\ifdim\y@diff >\z@\advance\y@diff -\ht\@linechar
X  \else\advance\y@diff \ht\@linechar\fi\fi
X\ifdim\x@diff <\z@ \@x@diff=-\x@diff \else\@x@diff=\x@diff\fi
X\ifdim\y@diff <\z@ \@y@diff=-\y@diff \else\@y@diff=\y@diff\fi
X%%\typeout{x@diff,y@diff=\the\x@diff , \the\y@diff}
X\num@segments=0 \num@segmentsi=0
X\ifdim\wd\@linechar >1pt
X \num@segmentsi=\@x@diff \divide\num@segmentsi \wd\@linechar\fi
X\ifdim\ht\@linechar >1pt
X \num@segments=\@y@diff \divide\num@segments \ht\@linechar\fi
X\ifnum\num@segmentsi >\num@segments \num@segments=\num@segmentsi\fi
X\advance\num@segments \@ne %to account for round-off error
X%
X\ifnum #1=0 \relax \else\ifnum #1 < -99
X  \typeout{***drawline: reduction <= -100 percent implies blankness!***}
X\else\num@segmentsi=#1 \advance\num@segmentsi by 100
X     \multiply\num@segments \num@segmentsi
X     \divide\num@segments by 100
X\fi\fi
X%%\typeout{num@segments after = \the\num@segments}
X%
X\divide\x@diff \num@segments
X\divide\y@diff \num@segments
X\advance\num@segments \@ne %for the last segment for which I subtracted
X			  %\wd & \ht of \@linechar from \@x@diff & \@y@diff.
X%%\typeout{numseg,x@diff,y@diff= \the\num@segments, \the\x@diff, \the\y@diff}
X%
X\@xdim=#2\unitlength \@ydim=#3\unitlength
X\if@negarg \advance\@xdim -\wd\@linechar\fi
X\ifnum\@yarg <0 \advance\@ydim -\ht\@linechar\fi
X%%following loop equiv to \multiput@abs(\@xdim,\@ydim)%
X%%(\x@diff,\y@diff){\num@segments}{\copy\@linechar}
X%%with arguements in absolute dimensions.
X\@killglue
X\loop \ifnum\num@segments > 0
X\unskip\raise\@ydim\hbox to\z@{\hskip\@xdim \copy\@linechar\hss}%
X\advance\num@segments \m@ne\advance\@xdim\x@diff\advance\@ydim\y@diff%
X\repeat
X\ignorespaces
X\fi%the if of @toosmall
X\fi}}% for \if@drawit
X%----------------------------------------------------------------------
X%usage: \putfile{datafile}{OBJECT}
X% The OBJECT is plotted at EACH of the coordinates read from the datafile.
X% The idea of these macros is to generate (x,y) pairs using some program
X% and then directly use those coordinates. Since TeX doesn't have real
X% floating point calculations, it is much more efficient and accurate to do
X% things this way. One can also use the unix facility 'spline' now to
X% generate smooth curves with equidistant ``dots''.
X% NOTE: the external file of coordinates must have x y pairs with a space
X% between them. Also it is suggested that some extension such as '.put'
X% be used for such datafiles to distinguish them in which case it must
X% be explicitely specified in the 1st argument so that TeX doesn't look
X% for a .tex extension.
X% The % char remains valid as a comment char and such lines are ignored;
X% however, there should be atleast one space after the second entry if a
X% comment is on the same line as data since % eats up the newline.
X%-----------------------------------------------------------------------
X\long\def\splittwoargs#1 #2 {(#1,#2)}
X%
X\newif\if@stillmore
X\newread\@datafile
X\long\def\putfile#1#2{\openin\@datafile = #1
X\@stillmoretrue
X\loop
X\ifeof\@datafile\relax\else\read\@datafile to\@dataline\fi
X%if file nonexistent, do nothing.
X\ifeof\@datafile\@stillmorefalse
X\else\ifx\@dataline\@empty \relax
X     \else
X\expandafter\expandafter\expandafter\put\expandafter\splittwoargs%
X\@dataline{#2}
X     \fi
X\fi
X\if@stillmore
X\repeat
X\closein\@datafile
X}
X%----------------------------------------------------------------------
X%\makeatother
X
X% eepic Version 1.0 < August 14, 1988 >
X%	Written by Conrad Kwok
X%
X% Internet : kwok@iris.ucdavis.edu
X% csnet    : kwok@ucd.csnet
X% csnet    : kwok%iris.ucdavis.edu@csnet.relay
X% UUCP	   : ...!ucbvax!ucdavis!iris!kwok
X%
X% The macros are in public domain.
X% You may distribute or modify it in any ways you like.
X% Please report any bugs, enhancements, comments, suggestions, etc.
X%
X% This style file modify some of the commands in epic[1] and LaTeX[2] such
X% that \special commands will be generated in drawing lines if approriate.
X% The \special commands generated is the subset of the \specials used
X% by tpic[3].
X%
X% [1] epic is written by Sunil Podar. Please read epic.sty for the
X%     copyright notice.
X% [2] LaTeX is written by Leslie Lamport. Please read the book LaTeX
X% [3] tpic is modified from pic by Tim Morgan
X%
X%% This file contains extensions of the following epic commands:
X%%	\dottedline	\dashline	\drawline
X%%	\jput
X%%
X%% It also contains extensions of the following LaTeX commands:
X%%	\circle		\line
X%%
X%% New commands include:
X%%	\Thicklines	\arc		\ellipse
X%%	\path		\spline
X%%
X%% For documentation, please see the accompanying manual
X%%
X\makeatletter
X\typeout{%
XExtension to Epic and LaTeX. Version 1.0 - Release August 14, 1988}
X%
X\newcount\@gphlinewidth
X\newcount\@eepictcnt
X\newdimen\@tempdimc
X\@gphlinewidth\@wholewidth \divide\@gphlinewidth 4736
X
X%% Redefine \thinlines, \thicklines
X%% See also latex.tex
X\def\thinlines{\let\@linefnt\tenln \let\@circlefnt\tencirc
X    \@wholewidth\fontdimen8\tenln \@halfwidth .5\@wholewidth
X    \@gphlinewidth\@wholewidth \divide\@gphlinewidth 4736\relax}
X\def\thicklines{\let\@linefnt\tenlnw \let\@circlefnt\tencircw
X    \@wholewidth\fontdimen8\tenlnw \@halfwidth .5\@wholewidth
X    \@gphlinewidth\@wholewidth \divide\@gphlinewidth 4736
X    \advance\@gphlinewidth\@ne   % Make the output looks better
X    \relax}
X%%
X%% To indicate whether the dot character is defined in the dotted join
X%%     environment or not (\@ifnodotdef)
X\newif\if@nodotdef \global\@nodotdeftrue
X%%
X%% Redefine \dottedjoin
X\def\dottedjoin{\global\@jointhemtrue \global\@joinkind=0\relax
X  \bgroup\@ifnextchar[{\global\@nodotdeffalse\@idottedjoin}%
X                      {\global\@nodotdeftrue\@idottedjoin[\@empty]}}
X%%----------------------------------------------------------------------
X%% Redefine \jput
X\long\def\jput(#1,#2)#3{\@killglue\raise#2\unitlength\hbox to \z@{\hskip
X#1\unitlength #3\hss}%
X\if@jointhem \if@firstpoint \gdef\x@one{#1} \gdef\y@one{#2} \global\@firstpointfalse
X \else\ifcase\@joinkind
X    \if@nodotdef
X        \@spdottedline{\dotgap@join\unitlength}%
X(\x@one\unitlength ,\y@one\unitlength)(#1\unitlength,#2\unitlength)
X    \else
X	\@dottedline[\dotchar@join]{\dotgap@join\unitlength}%
X(\x@one\unitlength,\y@one\unitlength)(#1\unitlength,#2\unitlength)
X    \fi
X	\or\@dashline[\dashlinestretch]{\dashlen@join\unitlength}[\dotgap@join]%
X(\x@one,\y@one)(#1,#2)
X	\else\@drawline[\drawlinestretch](\x@one,\y@one)(#1,#2)\fi
X    \gdef\x@one{#1}\gdef\y@one{#2}%
X \fi
X\fi\ignorespaces}
X%%
X%% Redefine \dottedline to generate special whenever possible.
X\def\dottedline{\@ifnextchar [{\@idottedline}{\@ispdottedline}}
X%% Similar to \@idottedline but it generate \special
X\def\@ispdottedline#1(#2,#3){\@ifnextchar (%
X{\@iispdottedline{#1}(#2,#3)}{\relax}}
X\def\@iispdottedline#1(#2,#3)(#4,#5){\@spdottedline{#1\unitlength}%
X(#2\unitlength,#3\unitlength)(#4\unitlength,#5\unitlength)%
X\@ispdottedline{#1}(#4,#5)}
X%
X\def\@spdottedline#1(#2,#3)(#4,#5){%
X    \@tempcnta \@gphlinewidth\relax
X    \advance\@tempcnta by 2     % solely for better output
X    \special{pn \the\@tempcnta}%
X    \@tempdimc=#2\relax
X    \@tempcnta \@tempdimc\relax \advance\@tempcnta 2368 \divide\@tempcnta 4736
X    \@tempdimc=#3\relax
X    \@tempcntb -\@tempdimc\relax\advance\@tempcntb -2368 \divide\@tempcntb 4736
X    \@paspecial{\the\@tempcnta}{\the\@tempcntb}%
X    \@tempdimc=#4\relax
X    \@tempcnta \@tempdimc\relax \advance\@tempcnta 2368 \divide\@tempcnta 4736
X    \@tempdimc=#5\relax
X    \@tempcntb -\@tempdimc\relax\advance\@tempcntb -2368 \divide\@tempcntb 4736
X    \@paspecial{\the\@tempcnta}{\the\@tempcntb}%
X    \@tempdimc=#1\relax
X%%
X%% Generate the pen width in terms of inch with 3 decimal digit.
X    \@tempcnta \@tempdimc\relax \advance\@tempcnta 2368 \divide\@tempcnta 4736
X%% \@tempcnta contain the pen width in terms of thousandth of a inch
X%% Then it is converted back to inch. I know the way I use is dumb but
X%% I cannot think of any better method
X    \@tempcntb \@tempcnta\relax \divide\@tempcntb 1000
X    \multiply \@tempcntb 1000 \advance\@tempcnta -\@tempcntb
X    \divide\@tempcntb 1000
X    \ifnum\@tempcnta < 10
X        \special{dt \the\@tempcntb.00\the\@tempcnta}%
X    \else\ifnum\@tempcnta < 100
X        \special{dt \the\@tempcntb.0\the\@tempcnta}%
X    \else
X        \special{dt \the\@tempcntb.\the\@tempcnta}%
X    \fi\fi
X    \ignorespaces
X}
X%
X\def\@iiidashline[#1]#2[#3](#4,#5)(#6,#7){%
X\@dashline[#1]{#2\unitlength}[#3](#4,#5)(#6,#7)%
X\@iidashline[#1]{#2}[#3](#6,#7)}
X%
X%% Redefine \@dashline
X\long\def\@dashline[#1]#2[#3](#4,#5)(#6,#7){{%
X\x@diff=#6\unitlength \advance\x@diff by -#4\unitlength
X\y@diff=#7\unitlength \advance\y@diff by -#5\unitlength
X%% correction to get actual width since the dash-length as taken in arguement
X%% is the center-to-center of the end-points.
X\@tempdima=#2\relax \advance\@tempdima -\@wholewidth
X\sqrtandstuff{\x@diff}{\y@diff}{\@tempdima}%
X\ifnum\num@segments <3 \num@segments=3\fi% min number of dashes I can plot
X% is 2, 1 at either end, thus min num@segments is 3 (including 'empty dash').
X\@tempdima=\x@diff \@tempdimb=\y@diff
X\divide\@tempdimb by\num@segments
X\divide\@tempdima by\num@segments
X%% ugly if-then-else. If optional dotgap specified, then use it otherwise
X%% make a solid dash.
X{\ifx#3\@empty \relax
X    \ifdim\@tempdima < 0pt \x@diff=-\@tempdima\else\x@diff=\@tempdima\fi
X    \ifdim\@tempdimb < 0pt \y@diff=-\@tempdimb\else\y@diff=\@tempdimb\fi
X    \global\setbox\@dotbox\hbox{%
X                \@absspdrawline(0pt,0pt)(\@tempdima,\@tempdimb)}%
X    \else\global\setbox\@dotbox\hbox{%
X        \@spdottedline{#3\unitlength}(0pt,0pt)(\@tempdima,\@tempdimb)}%
X    \fi}%
X\advance\x@diff by -\@tempdima % both have same sign
X\advance\y@diff by -\@tempdimb
X%
X%%here we correct the number of dashes to be put by reducing them
X%%appropriately. (num@segments*\@wholewidth) is in some way the slack we
X%%have,and division by dash-length gives the reduction. reduction =
X%%(2*num@segments*\@wholewidth)/dash-length
X%% (num@segments includes empty ones)
X\@tempdima=\num@segments\@wholewidth \@tempdima=2\@tempdima
X\@tempcnta\@tempdima\relax \@tempdima=#2\relax \@tempdimb=0.5\@tempdima
X\@tempcntb\@tempdimb\relax \advance\@tempcnta by \@tempcntb % round-off error
X\divide\@tempcnta by\@tempdima \advance\num@segments by -\@tempcnta
X%
X\ifnum #1=0 \relax\else\ifnum #1 < -100
X  \typeout{***dashline: reduction > -100 percent implies blankness!***}
X\else\num@segmentsi=#1 \advance\num@segmentsi by 100
X     \multiply\num@segments by\num@segmentsi \divide\num@segments by 100
X\fi\fi
X%
X\divide\num@segments by 2 % earlier num@segments included 'empty dashes' too.
X\ifnum\num@segments >0 % if =0 then don't divide => \x@diff & \y@diff
X \divide\x@diff by\num@segments%   remain same.
X \divide\y@diff by\num@segments
X \advance\num@segments by\@ne %for the last segment for which I subtracted
X	 		     %\@tempdima & \@tempdimb from \x@diff & \y@diff
X \else\num@segments=2 % one at each end.
X\fi
X%%\typeout{num@segments finally = \the\num@segments}
X%% equiv to \multiput(#4,#5)(\x@diff,\y@diff){\num@segments}{\copy\@dotbox}
X%% with arguements in absolute dimensions.
X\@xdim=#4\unitlength \@ydim=#5\unitlength
X\@killglue
X\loop \ifnum\num@segments > 0
X\unskip\raise\@ydim\hbox to\z@{\hskip\@xdim \copy\@dotbox\hss}%
X\advance\num@segments \m@ne\advance\@xdim\x@diff\advance\@ydim\y@diff%
X\repeat}%
X\ignorespaces}
X%% redefine \@drawline
X%
X\def\@drawline[#1](#2,#3)(#4,#5){{%
X\@drawitfalse\@horvlinefalse
X\ifnum#1 <0 \relax\else\@horvlinetrue\fi
X\if@horvline
X \@spdrawline(#2,#3)(#4,#5)
X\else\@drawittrue\fi
X%%-------------------------------
X\if@drawit
X\ifnum #1=0 \relax \else\ifnum #1 < -99
X  \typeout{***drawline: reduction <= -100 percent implies blankness!***}%
X\else\num@segmentsi=#1 \advance\num@segmentsi by 50
X     \multiply\num@segmentsi 2
X\fi\fi
X\@dashline[\num@segmentsi]{10pt}[\@empty](#2,#3)(#4,#5)
X\fi}\ignorespaces}% for \if@drawit
X%
X\def\@spdrawline(#1,#2)(#3,#4){%
X   \@absspdrawline(#1\unitlength,#2\unitlength)(#3\unitlength,#4\unitlength)
X   \ignorespaces
X}
X\def\@absspdrawline(#1,#2)(#3,#4){%
X    \special{pn \the\@gphlinewidth}%
X    \@tempdimc=#1\relax
X    \@tempcnta \@tempdimc\relax \advance\@tempcnta 2368 \divide\@tempcnta 4736
X    \@tempdimc=#2\relax
X    \@tempcntb -\@tempdimc\relax \advance\@tempcntb -2368 \divide\@tempcntb 4736
X    \@paspecial{\the\@tempcnta}{\the\@tempcntb}%
X    \@tempdimc=#3\relax
X    \@tempcnta\@tempdimc\relax \advance\@tempcnta 2368 \divide\@tempcnta 4736
X    \@tempdimc=#4\relax
X    \@tempcntb -\@tempdimc\relax \advance\@tempcntb -2368 \divide\@tempcntb 4736
X    \@paspecial{\the\@tempcnta}{\the\@tempcntb}%
X    \special{fp}%
X    \ignorespaces
X}
X%%----------------------------------------------------------------------
X\def\@paspecial#1#2{%
X    \special{pa #1 #2}%
X}
X%%
X%% Functions below modify the LaTeX commands and some additional commands
X%% are not supported by LaTeX nor epic such as ThickLines and arc.
X%%
X%% The macros are for use with LaTeX picture environment
X%% By including the macro file, you can draw
X%%   1) \line in any slope
X%%   2) \circle with any radius
X%%   3) \ellipse with any x-axis and y-axis length
X%%   4) Circular \arc by giving starting and ending angle (in radius)
X%%
X%% Furthermore you may draw lines in any thickness.
X%%
X%%
X%% Redefine \thinlines, \thicklines and define \Thickline
X%% See also latex.tex
X\def\Thicklines{\let\@linefnt\tenlnw \let\@circlefnt\tencircw
X    \@wholewidth\fontdimen8\tenlnw \@wholewidth 1.5\@wholewidth
X    \@halfwidth .5\@wholewidth
X    \@gphlinewidth\@wholewidth \divide\@gphlinewidth 4736\relax}
X%%
X%% Generate the \special command for drawing arc
X\def\@circlespecial#1#2#3#4{%
X	      \special{pn \the\@gphlinewidth}%
X	      \special{ar 0 0 #1 #2 #3 #4}
X}
X%%
X%% Command for drawing an arc. Elliptical arc command can be generated
X%% but all iptex program I saw so far does not support that.
X\def\@arc#1#2#3#4{%
X%% convert TeX dimension to length in terms thousandth of an inch
X	\@tempdima #1\unitlength
X	\@tempdimb #2\unitlength
X        \@tempcnta\@tempdima \advance\@tempcnta 4736 \divide\@tempcnta 9473
X	\@tempcntb\@tempdimb \advance\@tempcntb 4736 \divide\@tempcntb 9473
X	\setbox\@tempboxa\hbox{%
X	    \@circlespecial{\the\@tempcnta}{\the\@tempcntb}{#3}{#4}}%
X        \wd\@tempboxa\z@ \box\@tempboxa}
X%%
X%% Command for drawing Circle and Ellipse in terms of \@arc
X%% replace original \circle
X\def\circle{%
X    \@ifstar{\special{bk}\@circle}{\@circle}}
X\def\@circle#1{\@arc{#1}{#1}{0}{6.2832}}
X\def\ellipse{%
X    \@ifstar{\special{bk}\@ellipse}{\@ellipse}}
X\def\@ellipse#1#2{{\@arc{#1}{#2}{0}{6.2832}}}
X\def\arc#1#2#3{\@arc{#1}{#1}{#2}{#3}}
X%%
X%% Generate \special commands for drawing line
X\def\@linespecial#1#2{%
X	      \special{pn \the\@gphlinewidth}%
X	      \special{pa 0 0}%
X	      \special{pa #1 #2}%
X	      \special{fp}%
X}
X%%
X%% Replace original \@sline
X%% For description, see latex.tex
X\def\@sline{%
X	\ifnum\@xarg< 0
X	  \@negargtrue \@xarg -\@xarg \@tempdima -\@linelen
X	\else
X	  \@negargfalse \@tempdima\@linelen
X	\fi
X%% truncation is used in arithmetic
X	\@tempcnta\@linelen \divide\@tempcnta 4736
X        \@yyarg -\@yarg \multiply\@yyarg \@tempcnta \divide\@yyarg\@xarg
X 	\if@negarg
X	    \@tempcnta -\@tempcnta
X	\fi
X	\setbox\@linechar\hbox{\@linespecial{\the\@tempcnta}{\the\@yyarg}}%
X	\wd\@linechar\@tempdima
X	\@clnht\@linelen
X        \multiply\@clnht\@yarg
X        \divide\@clnht\@xarg
X	\ifnum\@yarg< 0
X	  \@clnht -\@clnht
X	  \ht\@linechar\z@ \dp\@linechar\@clnht
X	\else
X	  \ht\@linechar\@clnht \dp\@linechar\z@
X	\fi
X	\box\@linechar
X%% Codes below (till end of the command) is only necessary
X%% when used with \@svector
X	\if@negarg
X	  \@yyarg -\@yarg
X	\else
X	  \@yyarg \@yarg
X	\fi
X	\setbox\@linechar\hbox{\@linefnt\@getlinechar(\@xarg,\@yyarg)}%
X	\ifnum\@yarg> 0
X	  \let\@upordown\raise
X	  \advance\@clnht -\ht\@linechar
X	\else
X	  \let\@upordown\lower
X	\fi
X	\if@negarg \kern\wd\@linechar \fi
X}
X%%
X\def\spline(#1,#2){%
X    \special{pn \the\@gphlinewidth}%
X    \@spline(#1,#2)%
X}
X\def\@spline(#1,#2){%
X    \@tempdima #1\unitlength
X    \@tempdimb #2\unitlength
X    \@tempcnta \@tempdima \advance\@tempcnta 2368 \divide\@tempcnta 4736
X    \@tempcntb -\@tempdimb \advance\@tempcntb -2368 \divide\@tempcntb 4736
X    \@paspecial{\the\@tempcnta}{\the\@tempcntb}%
X    \@ifnextchar ({\@spline}{\special{sp}}%
X}
X\def\path(#1,#2){%
X    \special{pn \the\@gphlinewidth}%
X    \@path(#1,#2)%
X}
X\def\@path(#1,#2){%
X    \@tempdima #1\unitlength
X    \@tempdimb #2\unitlength
X    \@tempcnta \@tempdima \advance\@tempcnta 2368 \divide\@tempcnta 4736
X    \@tempcntb -\@tempdimb \advance\@tempcntb -2368 \divide\@tempcntb 4736
X    \@paspecial{\the\@tempcnta}{\the\@tempcntb}%
X    \@ifnextchar ({\@path}{\special{fp}}%
X}
X
X%%%%%%%%%% Beginning of \oval %%%%%%%%%%%%%%%
X\newdimen\maxovaldiam \maxovaldiam 40pt\relax
X
X\def\@oval(#1,#2)[#3]{\begingroup\boxmaxdepth \maxdimen
X  \@ovttrue \@ovbtrue \@ovltrue \@ovrtrue
X  \@tfor\@tempa :=#3\do{\csname @ov\@tempa false\endcsname}\@ovxx
X  #1\unitlength \@ovyy #2\unitlength
X  \@tempdimb \ifdim \@ovyy >\@ovxx \@ovxx\else \@ovyy \fi
X  \@ovro \ifdim \@tempdimb>\maxovaldiam \maxovaldiam\else\@tempdimb\fi\relax
X  \divide \@ovro \tw@
X  \@ovdx\@ovxx \divide\@ovdx \tw@
X  \@ovdy\@ovyy \divide\@ovdy \tw@
X  \setbox\@tempboxa \hbox{%
X  \if@ovr \@ovverta\fi
X  \if@ovl \kern \@ovxx \@ovvertb\kern -\@ovxx \fi
X  \if@ovt \@ovhorz \kern -\@ovxx \fi
X  \if@ovb \raise \@ovyy \@ovhorz \fi}% bug found by isozaki
X  \ht\@tempboxa\z@ \dp\@tempboxa\z@
X  \@put{-\@ovdx}{-\@ovdy}{\box\@tempboxa}%
X  \endgroup}
X
X\def\@qcirc#1#2#3#4{%
X    \special{pn \the\@gphlinewidth}%
X    \@eepictcnt \@gphlinewidth \divide\@eepictcnt 2
X    \@tempcnta #1 
X      \advance\@tempcnta 2368 \divide\@tempcnta 4736
X      \advance\@tempcnta\@eepictcnt
X    \@tempcntb #2 \divide\@tempcntb 4736 \advance\@tempcntb 2
X    \hbox{%
X\@qcircspecial{\the\@tempcnta}{-\the\@eepictcnt}{\the\@tempcntb}{#3}{#4}}%
X}
X\def\@qcircspecial#1#2#3#4#5{\special{ar #1 #2 #3 #3 #4 #5}}
X
X\def\@ovverta{\vbox to \@ovyy{%
X    \if@ovb
X        \kern \@ovro
X        \@qcirc{\@ovro}{\@ovro}{3.1416}{4.7124}\nointerlineskip
X    \else
X        \kern \@ovdy
X    \fi
X    \leaders\vrule width \@wholewidth\vfil \nointerlineskip
X    \if@ovt
X        \@qcirc{\@ovro}{\@ovro}{1.5708}{3.1416}\nointerlineskip
X        \kern \@ovro
X    \else
X        \kern \@ovdy
X    \fi
X}\kern -\@wholewidth}
X
X\def\@ovvertb{\vbox to \@ovyy{%
X    \if@ovb
X        \kern \@ovro
X        \@qcirc{-\@ovro}{\@ovro}{4.6124}{6.2832}\nointerlineskip
X    \else
X        \kern \@ovdy
X    \fi
X    \leaders\vrule width \@wholewidth\vfil \nointerlineskip
X    \if@ovt
X        \@qcirc{-\@ovro}{\@ovro}{0}{1.6708}\nointerlineskip
X        \kern \@ovro
X    \else
X        \kern \@ovdy
X    \fi
X}\kern -\@wholewidth}
X
X\def\@ovhorz{\hbox to \@ovxx{%
X    \if@ovr \kern \@ovro\else \kern \@ovdx \fi
X    \leaders \hrule height \@wholewidth \hfil
X    \if@ovl \kern \@ovro\else \kern \@ovdx \fi
X    }}
X%%%%%%%%% End of \oval %%%%%%%%%%%%%%
X
X\def\allinethickness#1{\let\@linefnt\tenlnw \let\@circlefnt\tencircw
X    \@wholewidth #1 \@halfwidth .5\@wholewidth
X    \@gphlinewidth\@wholewidth \divide\@gphlinewidth 4736\relax}
X
X
X
X
SHAR_EOF
exit 0
#	End of shell archive
