| 1 |
\documentclass[11pt]{article} |
| 2 |
|
| 3 |
% 10 Jun 2010: Added memoir/array compatibility, switched to pict2e, changed some flags. |
| 4 |
% Updated documentation to describe the new features. |
| 5 |
|
| 6 |
% 17 Feb 2004: Corrected some typos in documentation |
| 7 |
|
| 8 |
\usepackage{drs,pict2e} |
| 9 |
\usepackage{times} |
| 10 |
|
| 11 |
\chardef\BS=`\\ % It only works in \tt font |
| 12 |
|
| 13 |
\def\ctt#1{{\texttt{\BS #1}}} % \ctt command --> \command (in tt) |
| 14 |
\def\citem[#1 #2]{\item[\ctt{#1}{\textsl{#2}}]} % header of command plus argument |
| 15 |
|
| 16 |
\advance\textheight by 0.7in |
| 17 |
\advance\textwidth by 0.8 in |
| 18 |
\advance\oddsidemargin by -0.4in |
| 19 |
\topmargin=-0.3in |
| 20 |
|
| 21 |
\begin{document} |
| 22 |
|
| 23 |
\begin{center} |
| 24 |
{\bfseries Drs.sty, a \LaTeX\ package for Discourse Representation Structures} |
| 25 |
\\[6pt] |
| 26 |
Alexis Dimitriadis \\[6pt] |
| 27 |
Version 1.1\\[6pt] |
| 28 |
June 10, 2010 \\[1.5ex] |
| 29 |
\end{center} |
| 30 |
|
| 31 |
\noindent |
| 32 |
This package draws Discourse Representation Structures (DRSs). It can draw |
| 33 |
embedded DRSs, if-then conditions and quantificational ``duplex conditions'' |
| 34 |
(with a properly scaled connecting diamond). Formatting parameters allow the |
| 35 |
user to control the appearance and placement of DRSs, and of DRS variables and |
| 36 |
conditions. |
| 37 |
|
| 38 |
You should use this package together with \emph{pict2e.sty,} which allows better diagonal lines to be drawn. It is not automatically loaded by \emph{drs.sty,} but will be utilized if it you do load it. |
| 39 |
|
| 40 |
\section{History} |
| 41 |
|
| 42 |
This package is derived from the DRS macros in the style \emph{covington.sty,} |
| 43 |
written by Michael A. Covington. I am grateful to him for allowing |
| 44 |
modification and redistribution of his code. The present style retains the |
| 45 |
basic design (command syntax, use of the \verb|tabular| environment to |
| 46 |
construct the DRSs) and is intended to be backward compatible. It |
| 47 |
adds commands for duplex conditions and logical connectives, formatting |
| 48 |
options, better spacing, and an absurdly elaborate algorithm for calculating |
| 49 |
the size of the diamond used in duplex conditions. |
| 50 |
|
| 51 |
Please direct suggestions, bug reports, or other comments to Alexis |
| 52 |
Dimitriadis, \emph{a.dimitriadis} \emph{@uu.nl.} |
| 53 |
As usual, |
| 54 |
I cannot promise this package will do what you want it to, but I will |
| 55 |
try to help if there is a problem. |
| 56 |
|
| 57 |
|
| 58 |
\section{Box-building commands} |
| 59 |
These commands can be embedded in each other as desired. |
| 60 |
|
| 61 |
\begin{description} |
| 62 |
\citem [drs \{variables\}\{conditions\}]~ |
| 63 |
|
| 64 |
Typesets a DRS in a box according to the formatting options in |
| 65 |
effect (see below). Conditions should be separated by \verb|\\|. If the |
| 66 |
variables argument is completely empty (given as \verb|{}|), no space is |
| 67 |
provided for variables at the top of the box. To leave an empty line, give a |
| 68 |
space as the list of variables (\verb|{ }| or \verb|{~}|). |
| 69 |
|
| 70 |
\begin{verbatim} |
| 71 |
\drs{x y}{Jones(x) \\ Ulysses(y) \\ x owns y} |
| 72 |
\end{verbatim} |
| 73 |
\drs{x y}{Jones(x) \\ Ulysses(y) \\ x owns y} |
| 74 |
|
| 75 |
\newpage |
| 76 |
\citem[drs* \{variables\}\{conditions\}]~ |
| 77 |
|
| 78 |
Top-level DRSs are positioned on the page according to a number of formatting |
| 79 |
parameters (see next section). To generate a DRS without the extra spacing, |
| 80 |
define it using \verb|\drs*| rather than \verb|\drs|. |
| 81 |
|
| 82 |
\citem[ifdrs \{lvar\}\{lcond\}\{rvar\}\{rcond\}] |
| 83 |
|
| 84 |
Forms two DRSs joined by an arrow. This command is just a special case of \verb|\condrs|. |
| 85 |
|
| 86 |
\begin{verbatim} |
| 87 |
\drs{x}{Jones(x) \\ |
| 88 |
\ifdrs{y}{donkey(y)\\x owns y} |
| 89 |
{z w}{z = x\\ w = y\\ z feeds w}} |
| 90 |
\end{verbatim} |
| 91 |
|
| 92 |
\drs{x}{Jones(x) \\ |
| 93 |
\ifdrs{y}{donkey(y)\\x owns y} {z w}{z = x\\ w = y\\ z feeds w}} |
| 94 |
%If Jones owns a donkey, he feeds it. |
| 95 |
|
| 96 |
\citem[condrs \{lvar\}\{lcond\}\{connective\}\{rvar\}\{rcond\}]~ |
| 97 |
|
| 98 |
Connects two DRSs with the middle argument, presumably a logical connective |
| 99 |
like \verb|$\vee$| or \verb|$\wedge$|. (You must manually switch to math mode |
| 100 |
if it's needed). This is provided as a separate |
| 101 |
command because the spacing needs certain adjustments. The connective is always put in size \verb|\large|, which is appropriate for normal-sized text. If the text of your DRS is in a different size, manually resize the connective to be one step larger; for example, |
| 102 |
\verb|{\LARGE $\vee$}| if the DRS text is \verb|\Large|. |
| 103 |
|
| 104 |
\citem[qdrs \{lvar\}\{lcond\}\{quantifier\}\{qvar\}\{rvar\}\{rcond\}]~\par |
| 105 |
|
| 106 |
Forms a duplex condition. The arguments \emph{quantifier} and \emph{qvar} are |
| 107 |
placed in the diamond connecting the left and right DRSs, which is sized to |
| 108 |
fit them. The \emph{quantifier} argument may contain newlines (\verb|\\|), if necessary. |
| 109 |
|
| 110 |
\begin{verbatim} |
| 111 |
\drs{X}{ the lawyers(X) \\ |
| 112 |
\qdrs{x}{x $\in$ X} |
| 113 |
{every}{x} |
| 114 |
{y}{secretary(y) \\ x hired y}} |
| 115 |
\end{verbatim} |
| 116 |
\drs{X}{ the lawyers(X) \\ |
| 117 |
\qdrs{x}{x $\in$ X} {every}{x} {y}{secretary(y) \\ x hired y}} |
| 118 |
|
| 119 |
\citem[negdrs \{variables\}\{conditions\}]~ |
| 120 |
|
| 121 |
Produces a DRS preceded by the negation symbol. |
| 122 |
|
| 123 |
\citem[drsdiamond \{quantifier\}\{variable\}] ~ |
| 124 |
|
| 125 |
Produces the |
| 126 |
automatically scaling diamond used by \verb|\qdrs|. Perhaps it is useful to call it |
| 127 |
directly for specialized uses. An absurdly fancy scaling algorithm |
| 128 |
draws a diamond of the right size and places the text at the right height. |
| 129 |
The algorithm is optimized for cases where the variable is narrower than the |
| 130 |
quantifier text, but works well for a variety of shapes, including multi-line |
| 131 |
quantifier names (use {\tt \BS\BS} to break lines, as in: {\tt |
| 132 |
at~least\BS\BS one}). If it does the wrong thing |
| 133 |
for you, try padding the text with non-breaking spaces (\verb|~|). |
| 134 |
|
| 135 |
\end{description} |
| 136 |
|
| 137 |
\noindent |
| 138 |
For compatibility with the \emph{covington.sty} macros, the following commands |
| 139 |
are also supported: |
| 140 |
|
| 141 |
\begin{description} |
| 142 |
\citem[sdrs \{sentence\}\{variables\}\{conditions\}] ~ |
| 143 |
|
| 144 |
Just like \verb|\drs|, but |
| 145 |
the first argument is a sentence to be displayed above the DRS. |
| 146 |
|
| 147 |
\citem[alifdrs \{lvar\}\{lcond\}\{rvar\}\{rcond\}]~ |
| 148 |
|
| 149 |
Just like \verb|\ifdrs|, but shifted to the left so that the conditions in it, |
| 150 |
if left-adjusted, will line up with unembedded DRS conditions. |
| 151 |
|
| 152 |
\end{description} |
| 153 |
|
| 154 |
\section{Formatting parameters} |
| 155 |
|
| 156 |
The following commands may be redefined to control the appearance of the DRS |
| 157 |
boxes. |
| 158 |
|
| 159 |
\begin{description} |
| 160 |
|
| 161 |
\citem[drscondfont ] The font used for the DRS conditions. Default: |
| 162 |
\verb|\rm|. If necessary, it can be redefined to a macro that takes an argument, e.g.: |
| 163 |
|
| 164 |
\verb|\renewcommand\drscondfont[1]{\emph{#1}}| |
| 165 |
|
| 166 |
The font properties selected with this macro (e.g., italics) will also apply to the DRS variables, except as overridden by \verb|\drsvarfont|. |
| 167 |
|
| 168 |
\citem[drsvarfont ] Additional font settings used for the DRS variables. This macro modifies the font style already in effect from \verb|\drscondfont|. Default: |
| 169 |
\verb|\it|. If necessary, it can be redefined to a macro that takes an argument. |
| 170 |
|
| 171 |
\citem[drsseparator ] The separator between variables and conditions. By |
| 172 |
default it is \verb|\hline|, but can be redefined to suppress the line (or to draw |
| 173 |
other line styles, if appropriate). To suppress the line, put the following |
| 174 |
in the preamble of your document: |
| 175 |
|
| 176 |
\verb|\renewcommand\drsseparator{\relax}| |
| 177 |
|
| 178 |
\citem[drsalignment ] Alignment of the contents of the DRS, in the form of a |
| 179 |
\{tabular\} alignment parameter. The default is {\tt c} (centered) but can be |
| 180 |
changed to {\tt l} (or even {\tt r} if you wish). |
| 181 |
|
| 182 |
\citem[drsboxalignh ] Horizontal alignment of the top-level DRS box in the surrounding text. |
| 183 |
You can ask for left-aligned ({\tt l}) or centered boxes. The default is {\tt c.} |
| 184 |
|
| 185 |
\citem[drsboxalignv ] Vertical alignment of the top-level DRS box with the |
| 186 |
baseline of the text. The default is {\tt c} (centered on the baseline); {\tt t} and |
| 187 |
{\tt b} are also available. Embedded DRS boxes are always centered on the |
| 188 |
baseline. |
| 189 |
|
| 190 |
\citem[drsarraystretch ] This parameter gives the value of |
| 191 |
\verb|\arraystretch| used when making DRS boxes. Undefined by default, which |
| 192 |
is equivalent to the value~\emph{1.0.} You can change it to other numbers (without a dimension) to stretch or compress linespacing. |
| 193 |
|
| 194 |
\citem[drslinewidth ] The thickness of the lines used to draw the DRS boxes. The default is the current value of \verb|\arrayrulewidth| (which controls the width of table borders), normally 0.4pt. If you redefine this you should definitely load the package \emph{pict2e.sty} (recommended anyway), which will allow LaTeX to set the diagonal lines of the quantifier diamond to the same thickness. |
| 195 |
|
| 196 |
\end{description} |
| 197 |
|
| 198 |
|
| 199 |
\subsection{Compatibility with \emph{covington.sty}} |
| 200 |
|
| 201 |
Although this package should accept DRSs written for the \emph{covington.sty} |
| 202 |
macros, the appearance of the output is not the same by default. To match |
| 203 |
that style, specify the following formatting parameters: |
| 204 |
|
| 205 |
\begin{itemize} |
| 206 |
\item[] |
| 207 |
\begin{verbatim} |
| 208 |
\renewcommand\drscondfont{\it} |
| 209 |
\renewcommand\drsalignment{l} |
| 210 |
\renewcommand\drsboxalignh{l} |
| 211 |
\end{verbatim} |
| 212 |
\end{itemize} |
| 213 |
|
| 214 |
|
| 215 |
\section{Other packages} |
| 216 |
|
| 217 |
I recommend that you use \emph{drs.sty} in conjunction with \emph{pict2e.sty,} |
| 218 |
which improves \LaTeX's picture drawing capabilities. Your DRS diamonds will look a lot |
| 219 |
better if you do. \emph{Drs.sty} is also compatible with \emph{eepic.sty,} which has similar |
| 220 |
function but only works for DVI output (with PostScript enhancements). \emph{Drs.sty} will not |
| 221 |
automatically load either package, but will take advantage of their capabilities if one is loaded. |
| 222 |
|
| 223 |
I have tried to make \emph{drs.sty} work well with doublespacing. Because of |
| 224 |
shortcomings of the doublespacing macros, the boxes might still be placed |
| 225 |
too close to each other. Perhaps some day this will be corrected in future versions |
| 226 |
of \emph{setspace.sty} (but I requested the fix years ago, so don't hold your breath). Until then, I have provided a work-around which you |
| 227 |
can use if you are using \emph{setspace.sty.} Place the command |
| 228 |
\verb|\drshacksetspace| in your document preamble, somewhere after both packages |
| 229 |
have been included, to redefine certain \emph{setspace} internals so that |
| 230 |
boxes can be properly spaced. This is turned off by default since it |
| 231 |
is a hack and might cause unexpected problems. |
| 232 |
|
| 233 |
Starting with version 1.1, \emph{drs.sty} is compatible with \emph{memoir.cls} and the reimplementation of the \emph{tabular} and \emph{array} environments used by \emph{memoir} and \emph{array.sty.} However, the extra column types these provide cannot be used with \emph{drs} commands. Only {\tt c, l} and {\tt r} are accepted. |
| 234 |
|
| 235 |
\end{document} |
| 236 |
|