summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/covington/covington.tex
blob: c9c9ea7b0f8455f7141ebf6e6ae0875c002f4d87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% File covington.tex
%%
%% Documentation of covington
%%
%% This file is part of the covington LaTeX package
%%
%% Original author:
%% ================
%% Michael A. Covington
%% Artificial Intelligence Programs
%% The University of Georgia
%% Athens, Georgia 30602-7415 USA
%% mcovingt@aisun1.ai.uga.edu
%%
%% Current maintainer:
%% ===================
%% Juergen Spitzmueller <juergen@spitzmueller.org>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%% 
%% The Current Maintainer of this work is Juergen Spitzmueller.
%%
%% Code repository and issue tracker: https://github.com/jspitz/covington
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[english]{article}

\usepackage[libertine]{newtxmath}
\usepackage[osf]{libertine}
\usepackage[scaled=0.75]{beramono}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}

\usepackage{covington}

\usepackage{url}
\usepackage[bookmarks=true,
			bookmarksnumbered=false,
			bookmarksopen=false,
			breaklinks=false,
			pdfborder={0 0 0},
			backref=false,
			colorlinks=false
]{hyperref}
\hypersetup{%
	pdftitle={The covington manual},
	pdfauthor={Jürgen Spitzmüller},
	pdfkeywords={latex,linguistics}
}

\usepackage{microtype}

% Tweak the TOC (make it more compact)
\usepackage{tocloft}
\setlength{\cftbeforesecskip}{0pt}
\renewcommand{\cfttoctitlefont}{\normalsize\bfseries}
\renewcommand{\cftsecfont}{\footnotesize}
\renewcommand{\cftsecpagefont}{\footnotesize}
\renewcommand{\cftsubsecfont}{\footnotesize}
\renewcommand{\cftsubsecpagefont}{\footnotesize}

\usepackage{babel}

\usepackage{listings}
\lstset{language={[LaTeX]TeX},
	basicstyle={\small\ttfamily},
	frame=single}

% markup
\newcommand*\jmacro[1]{\textbf{\texttt{#1}}}
\newcommand*\jenv[1]{\textbf{\texttt{#1}}}
\newcommand*\jcsmacro[1]{\jmacro{\textbackslash{#1}}}
\newcommand*\joption[1]{\textbf{\texttt{#1}}}
\newcommand*\jfmacro[1]{\texttt{#1}}
\newcommand*\jfenv[1]{\texttt{#1}}
\newcommand*\jfcsmacro[1]{\jfmacro{\textbackslash{#1}}}

% Strings
\newcommand*{\cvt}{\textsf{covington}}
\newcommand*{\Cvt}{\textsf{Covington}}

%
% Titling
%
\def\pversion{Version 1.7}
\def\pdate{September 8, 2018}

\title{\textbf{The \cvt\ Package\\Macros for Linguistics}}
\author{Michael A. Covington \and J\"urgen Spitzm\"uller\thanks{Current maintainer.
		Please report issues via \protect\url{https://github.com/jspitz/covington}}}

\date{\pversion, \pdate}

\begin{document}

\maketitle

\begin{abstract}
\noindent This package, initially a collection of Michael A. Covington's private macros, provides
numerous minor \LaTeX\ enhancements for linguistics, including multiple diacritics on the
same letter, interlinear glosses (word-by-word translations), Discourse Representation Structures,
and example numbering.
\end{abstract}

\tableofcontents

\clearpage

\section{Introduction}

This is the documentation for \MakeLowercase{\pversion}
of \cvt\ (\pdate), which is a \LaTeX\ package providing macros
for typing some special notations common in linguistics.%
\footnote{The package has a long history. It started off as a collection of private macros back in the
\LaTeX\ 2.09 days and was initially released as \texttt{covingtn.sty} (following the old 8.3 \textsc{fat}
file name limit). In em\TeX\ under \textsc{ms-dos}, the file was distributed as \texttt{covingto.sty}.
Eventually, it has been renamed to \cvt\ and adapted to \LaTeXe.}

To use \cvt\ with \LaTeXe, load the package as usual by adding the command
\lstinline"\usepackage{covington}" to your document preamble.
The package has the following options:
\begin{description}
	\item{\joption{force}:} Force the redefinition of environments that have already been
	defined by other packages or the class.
	
	This applies to the \jenv{example}, \jenv{examples}, \jenv{subexamples} and \jenv{exercise} environments,
	which are by default not touched if they are already defined before \cvt\ is loaded.
	See sec.~\ref{sec:ex}, \ref{sec:exs}, \ref{sec:subexs} and \ref{sec:exercises} for details.
	\item{\joption{keeplayout}:} Do not tweak the layout.
	
	\Cvt\ sets \jfcsmacro{raggedbottom} and redefines the value of the \jfcsmacro{textfloatsep} length.
	This just follows the preferences of the original package author and is not necessary
	for the package's functionality. Yet for backwards compatibility reasons, we cannot change this.
	Thus, we provide the option described here to opt out this presetting.
\end{description}
%
In what follows we presume that you know how to use \LaTeX\ and have 
access to \LaTeX\ manuals. Note that \cvt\ does not 
provide any special fonts or character sets.  However, it can be used in 
combination with other style sheets that do.

If you are using \cvt\ and \texttt{uga.sty} (UGa thesis style) 
together, you should load \texttt{uga} before \cvt.

 
\section{Stacked diacritics}\label{sec:accents}

\LaTeX\ provides a generous range of diacritics that can be placed on or below any
letter, such as:
\begin{flushleft}
\`{x} \'{x} \^{x} \"{x} \~{x} \={x} \H{x} \t{xx} \c{x} \d{x} \b{x}
\end{flushleft}
which are typed, respectively, as:
\begin{lstlisting}
\`{x} \'{x} \^{x} \"{x} \~{x} \={x} \H{x} \t{xx} \c{x} \d{x} \b{x}
\end{lstlisting}
Out of the box, however, \LaTeX\ doesn't give you a convenient way to put \emph{two}
diacritical marks on the same letter.  To fill this gap, \cvt\ provides
the following macros:
\begin{flushleft}
	\jcsmacro{twodias\{<upper diac.>\}\{<lower diac.>\}\{<char>\}}\\to combine any two diacritics, e.\,g.,
	               \lstinline[moretexcs={twodias}].\twodias{\~}{\=}{a}. = \twodias{\~}{\=}{a}\\[6pt]
	\jcsmacro{acm\{\ldots\}} \quad for acute over macron, e.\,g., \lstinline[moretexcs={acm}].\acm{a}. = \acm{a}\\
	\jcsmacro{grm\{\ldots\}} \quad for grave over macron, e.\,g., \lstinline[moretexcs={grm}].\grm{a}. = \grm{a}\\
	\jcsmacro{cim\{\ldots\}} \quad for circumflex over macron, e.\,g., \lstinline[moretexcs={cim}].\cim{a}. = \cim{a}
\end{flushleft}
The first of these is the general case\footnote{%
	Alternatively, there's also the old syntax \jcsmacro{twoacc[<upper diac.>|<char with lower diacr.>],}
	e.\,g. \jfcsmacro{twoacc[\textbackslash\textasciitilde|\textbackslash=\{a\}]} to the same effect, which is however discouraged
	due to its rather odd form.} and the latter three are special
cases that are often used in Greek transcription. Now you can type
\emph{Koin\acm{e}} with both accents in place.

The vertical distance between the two diacritics can be adjusted via the macro \jcsmacro{SetDiaOffset\{<length>\}}
which lets you increase or decrease the vertical space that is currently in effect.
If you'd use \verb"\SetDiaOffset{-0.25ex}", the above examples would come out as

\SetDiaOffset{-.25ex}
\begin{flushleft}
	\jcsmacro{twodias\{<upper diac.>\}\{<lower diac.>\}\{<char>\}}\\to combine any two diacritics, e.\,g.,
	\lstinline[moretexcs={twodias}].\twodias{\~}{\=}{a}. = \twodias{\~}{\=}{a}\\[6pt]
	\jcsmacro{acm\{\ldots\}} \quad for acute over macron, e.\,g., \lstinline[moretexcs={acm}].\acm{a}. = \acm{a}\\
	\jcsmacro{grm\{\ldots\}} \quad for grave over macron, e.\,g., \lstinline[moretexcs={grm}].\grm{a}. = \grm{a}\\
	\jcsmacro{cim\{\ldots\}} \quad for circumflex over macron, e.\,g., \lstinline[moretexcs={cim}].\cim{a}. = \cim{a}
\end{flushleft}
with a slightly better matching distance for the font used here.

Note that not all accent macros work in the \jfenv{tabbing} environment.
Use the \jfenv{Tabbing} package or refer to \cite{pakin} for alternative solutions.


\section{Numbered examples}

Linguistic papers often include numbered examples. With \cvt, generating those is straightforward.
In this section, we describe how you can typeset a self-stepping example number (see section~\ref{sec:exno}),
a single numbered example (sec.~\ref{sec:ex}), a consecutive range of numbered examples (sec.~\ref{sec:exs}),
and alpha-numerically labeled sub-examples (sec.~\ref{sec:subexs}).
All numbered examples can be referred to in the text via \jfcsmacro{label} and \jfcsmacro{ref} as usual
(see sec.~\ref{sec:ref} for details).

\subsection{Example numbers}\label{sec:exno}

The macro \jcsmacro{exampleno} generates a new example number, stepped by 1. It can be 
used anywhere you want the number to appear.  For example, to display a 
sentence with a number at the extreme right, do this:
\begin{lstlisting}[moretexcs={exampleno}]
\begin{flushleft}
This is a sentence. \hfill (\exampleno)
\end{flushleft}
\end{lstlisting}
Here's what you get:
\begin{flushleft}
This is a sentence. \hfill (\exampleno)
\end{flushleft}
The example counter is actually the same as \LaTeX's equation counter, 
so that if you use equations and numbered examples in the same
paper, you get a single continuous series of numbers. If you want to 
output the number without stepping it, use \jfcsmacro{theequation}.

Normally, however, you do not need to manually place \jcsmacro{exampleno} yourselves,
as in the example above. For the common case where example numbers in parentheses are
placed left to the example, \cvt\ provides more convenient solutions. These are described in turn.

\subsection[The \texttt{example} environment]{The \jenv{example} environment}\label{sec:ex}

The \jenv{example} environment (alias \jenv{covexample}) displays a single example
with a generated example number to the left of it.
If you type
\begin{lstlisting}
\begin{example}
This is a sentence.
\end{example}
\end{lstlisting}
or
\begin{lstlisting}
\begin{covexample}
This is a sentence.
\end{covexample}
\end{lstlisting}
you get:
\begin{example}
This is a sentence.\label{expl}
\end{example}
The example can be of any length; it can consist of many lines (separated by \verb"\\"), or even whole paragraphs.

If you need more space between the example number and the text, you can increase it by means of
the length \jcsmacro{examplenumbersep} (which is preset to \texttt{0pt}). Doing \lstinline|\setlength\examplenumbersep{1em}|,
for instance, will increase the space by 1\,em (negative values will decrease the space accordingly).

Note that, as of version 1.1, \cvt\ checks if there is already an \jenv{example} environment defined
(e.\,g., by the class). If so, \cvt\ does not
define its own one. However, there is always the alias environment \jenv{covexample} which can be used in order to
produce \texttt{covington's} example. If you use the package option \joption{force}, \cvt\ will override
existing \jenv{example} environments. In any case, the package will issue a warning if \jenv{example} is already defined
(this is the case, for instance, if you use \cvt\ with the \texttt{beamer} class).

One way to number sub-examples is to use \jfenv{itemize} or \jfenv{enumerate}
within an example, like this:
\begin{lstlisting}
\begin{example}
\begin{itemize}
\item[(a)] This is the first sentence.
\item[(b)] This is the second sentence.
\end{itemize}
\end{example}
\end{lstlisting}
This prints as:
\begin{example}
\begin{itemize}
\item[(a)] This is the first sentence.
\item[(b)] This is the second sentence.
\end{itemize}
\end{example}
However, the \jenv{examples} and \jenv{subexamples} environments, described in turn, are usually more 
convenient for this task.

\subsection[The \texttt{examples} environment]{The \jenv{examples} environment}\label{sec:exs}

To display a series of examples together, each with its own example 
number, use \jenv{examples} (or \jenv{covexamples}) instead of \jenv{example} or \jenv{covexample}.  The only 
difference is that there can be more than one example, and each of them 
has to be introduced by \jfcsmacro{item}, like this:
\begin{lstlisting}
\begin{examples}
\item This is the first sentence.
\item This is the second sentence.
\end{examples}
\end{lstlisting}
or, respectively:
\begin{lstlisting}
\begin{covexamples}
\item This is the first sentence.
\item This is the second sentence.
\end{covexamples}
\end{lstlisting}
This prints as:
\begin{examples}
\item This is the first sentence.
\item This is the second sentence.
\end{examples}
As for \jenv{example}, \cvt\ checks if there is already an \jenv{examples} environment defined,
and if this is the case, \cvt\ does not define its own one. The alias environment \jenv{covexamples}
is always available as a fallback. If you use the package option \joption{force}, \cvt\ will override
existing \jenv{examples} environments. The package will issue a warning if \jenv{examples} is already defined
(this is the case, for instance, if you use \cvt\ with the \texttt{beamer} class), telling you
how it has dealt with the situation.


\subsection[The \texttt{subexamples} environment]{The \jenv{subexamples} environment}\label{sec:subexs}

Sometimes a set of (paradigmatic) sub-examples gets only one main example number with alphabetic sub-numbering,
as in \pxref{sbex}. To achieve this most conveniently, \cvt\ provides the \jenv{subexamples} (or \jenv{covsubexamples})
environment.  The difference to \jenv{examples}\slash \jenv{covexamples} is the numbering:
\begin{lstlisting}
\begin{subexamples}
\item This is the first sentence.
\item This is the second sentence.
\end{subexamples}
\end{lstlisting}
or, respectively:
\begin{lstlisting}
\begin{covsubexamples}
\item This is the first sentence.
\item This is the second sentence.
\end{covsubexamples}
\end{lstlisting}
prints as:
\begin{subexamples}
	\item This is the first sentence.\label{sbex}
	\item This is the second sentence.
\end{subexamples}
Again, \cvt\ checks if there is already an \jenv{subexamples} environment defined,
and if this is the case, \cvt\ does not define its own one. The alias environment \jenv{covsubexamples}
is always available as a fallback. If you use the package option \joption{force}, \cvt\ will override
existing \jenv{subexamples} environments. The package will issue a warning if \jenv{subexamples} is already defined.

If you do not want the subexample letter in parentheses, you can redefine (via \jfcsmacro{renewcommand*}) the macro
\jcsmacro{covsubexnumber} which has the following default definition:
\begin{lstlisting}
\newcommand*\covsubexnumber[1]{(#1)}
\end{lstlisting}

The distance between example number and subnumber (letter) can be changed via the length \jcsmacro{examplenumbersep}
(which is preset to \texttt{0pt}). The distance between example subnumber and text can be changed  via the length
\jcsmacro{subexamplenumbersep} (preset to \texttt{0pt} as well). In both cases, a positive value will increase, a negative
value will decrease the respective distance.
Doing 
\begin{lstlisting}
\setlength{\examplenumbersep}{-0.5em}
\setlength{\subexamplenumbersep}{0.5em}
\end{lstlisting}
for instance, will come out like this:

\bgroup
\setlength{\examplenumbersep}{-0.5em}
\setlength{\subexamplenumbersep}{0.5em}

\begin{subexamples}
	\item This is the first sentence.
	\item This is the second sentence.
\end{subexamples}
\egroup


\subsection{Referring to examples}\label{sec:ref}

References to examples and sub-examples can be made the usual way via the \jcsmacro{ref} command
(which refers to a \jcsmacro{label} that is placed in the respective example paragraph).
The references do not have parentheses by default, i.\,e., a reference to the example
in section~\ref{sec:ex} would be printed as \ref{expl}, a reference to the sub-example
in section~\ref{sec:subexs} as \ref{sbex}.
For convenience, though, \cvt\ provides a command \jcsmacro{pxref} that also prints the parentheses,
as in \pxref{expl} and \pxref{sbex}.


\section{Glossing sentences word-by-word}\label{sec:gloss}

To gloss a sentence is to annotate it word-by-word.  Most commonly, a 
sentence in a foreign language is followed by a word-for-word 
translation (with the words lined up vertically) and then a smooth 
translation (not lined up), like this:%
\footnote{The macros for handling glosses are adapted with permission 
from \texttt{gloss.tex}, by Marcel R. van der Goot.}
\gll Dit is een Nederlands voorbeeld. 
     This is a Dutch example. 
\glt `This is an example in Dutch.'
\glend
That particular example would be typed as:
\begin{lstlisting}[moretexcs={gll,glt,glend}]
\gll Dit is een Nederlands voorbeeld. 
     This is a Dutch example. 
\glt `This is an example in Dutch.'
\glend
\end{lstlisting}
Notice that the words do not have to be typed lining up; instead, \TeX\ 
counts them.  If the words in the two languages do not correspond 
one-to-one, you can use curly brackets to group words.
For example, to print
\gll Dit is een voorbeeldje     in het Nederlands.
     This is a {little example} in {}  Dutch.
\glt `This is a little example in Dutch.'
\glend
you would type:
\begin{lstlisting}[moretexcs={gll,glt,glend}]
\gll Dit is een voorbeeldje     in het Nederlands.
     This is a {little example} in {}  Dutch.
\glt `This is a little example in Dutch.'
\glend
\end{lstlisting}
Note that \cvt\ locally activates the end of line in glosses in order to identify the different lines of the gloss (via category code change). This does not work inside macros (e.\,g., if the gloss is in a footnote). To work around this, a special version of the \jcsmacro{gll} macro is provided that does without the character activation: \jcsmacro{xgll}. This can also be used in macro arguments; however, the end of each gloss line needs to be explicitly specified by the \jcsmacro{xgle} macro in this case. If you want to put the above gloss in a footnote, thus, you would type:
\begin{lstlisting}[moretexcs={xgll,xgle,glt,glend}]
\xgll Dit is een voorbeeldje     in het Nederlands.\xgle
      This is a {little example} in {}  Dutch.\xgle
\glt `This is a little example in Dutch.'
\glend
\end{lstlisting}
%
Sometimes, an additional fourth line is needed (for instance to gloss cited forms, morphology, or an additional translation). To support this as well,
\cvt\ provides \jcsmacro{glll} and \jcsmacro{xglll}, each allowing for, and actually requiring, an additional line (see below for an example).

All together, \cvt\ provides eight macros for dealing with glosses:
\begin{itemize}
\item \jcsmacro{gll} introduces two lines of words vertically aligned, and 
activates an environment very similar to \jfenv{flushleft}. The two lines are separated by a normal line break (carriage return).
\item \jcsmacro{glll} is like \jcsmacro{gll} except that it introduces
\emph{three} lines of lined-up words.
\item \jcsmacro{xgll} is similar to \jcsmacro{gll} except that it does not make the line ending active. It thus works inside macros such as footnotes but requires explicit gloss line termination via \jcsmacro{xgle}.
\item \jcsmacro{xglll} is similar to \jcsmacro{glll} except that it does not make the line ending active. It thus works inside macros such as footnotes but requires explicit gloss line termination via \jcsmacro{xgle}.
\item \jcsmacro{xgle} is a gloss line ending marker to be used with \jcsmacro{xgll} and \jcsmacro{xglll}.
\item \jcsmacro{glt} ends the set of lined-up lines and introduces a line 
(or more) of translation.
\item \jcsmacro{gln} is like \jcsmacro{glt} but does not start a new line 
(useful when no translation follows but you want to put a number on the 
right).
\item \jcsmacro{glend} ends the special \jfenv{flushleft}-like environment.
\end{itemize}
Here are several examples.  First, a sentence with three lines aligned, 
instead of just two:
\glll  Hoc est aliud exemplum.
       \textsc{n.sg.nom} \textsc{3sg} \textsc{n.sg.nom} \textsc{n.sg.nom}
       This is another example.
\glt   `This is another example.'
\glend
This is typed as:
\begin{lstlisting}[moretexcs={glll,glt,glend}]
\glll  Hoc est aliud exemplum.
       \textsc{n.sg.nom} \textsc{3sg} \textsc{n.sg.nom} \textsc{n.sg.nom}
       This is another example.
\glt   `This is another example.'
\glend
\end{lstlisting}
Next, an example with a gloss but no translation, with an example number 
at the right:
\gll  Hoc habet numerum.
      This has number
\gln  \hfill (\exampleno)
\glend
That one was typed as:
\begin{lstlisting}[moretexcs={gll,gln,glend,exampleno}]
\gll  Hoc habet numerum.
      This has number
\gln  \hfill (\exampleno)
\glend
\end{lstlisting}
Finally we'll put a glossed sentence inside the \texttt{example} 
environment, which is a very common way of using it:
\begin{example}
\gll  Hoc habet numerum praepositum.
      This has number preposed
\glt  `This one has a number in front of it.'
\glend
\end{example}
This last example was, of course, typed as:
\begin{lstlisting}[moretexcs={gll,glt,glend}]
\begin{example}
\gll  Hoc habet numerum praepositum.
      This has number preposed
\glt  `This one has a number in front of it.'
\glend
\end{example}
\end{lstlisting}
Notice that every glossed sentence begins with either \jcsmacro{gll}, \jcsmacro{xgll},
\jcsmacro{glll} or \jcsmacro{xglll}, then contains either \jcsmacro{glt} or \jcsmacro{gln}, and ends 
with \jcsmacro{glend}.  Layout is critical in the part preceding 
\jcsmacro{glt} or \jcsmacro{gln}, and fairly free afterward.

\section{Phrase structure rules}

To print phrase structure rules such as \psr{S}{NP~VP} you can use \texttt{covington's} macro
\lstinline[moretexcs={psr}]"\psr{<constituent>}{<sub-constituents>}" (for the given example,
\lstinline[moretexcs={psr}]"\psr{S}{NP~VP}").

\section{Feature structures}

To print a feature structure such as
\begin{flushleft}
\fs{case:nom \\ person:P}
\end{flushleft}
you can type:
\begin{lstlisting}[moretexcs={fs}]
\fs{case:nom \\ person:P}
\end{lstlisting}

The feature structure can appear anywhere --- in continuous text, in a
displayed environment such as \jfenv{flushleft}, or inside a
phrase-structure rule, or even inside another feature structure.

To put a category label at the top of the feature structure, like this,
\begin{flushleft}
\lfs{N}{case:nom \\ person:P}
\end{flushleft}
here's what you type:
\begin{lstlisting}[moretexcs={lfs}]
\lfs{N}{case:nom \\ person:P}
\end{lstlisting}
And here is an example of a \textsc{ps}-rule made of labeled feature structures:
\begin{flushleft}
\psr{\lfs{S}{tense:T}}
    {\lfs{NP}{case:nom \\  number:N}
     \lfs{VP}{tense:T \\ number:N} }
\end{flushleft}
which was obviously coded as:
\begin{lstlisting}[moretexcs={lfs,psr}]
\psr{\lfs{S}{tense:T}}
    {\lfs{NP}{case:nom \\  number:N}
     \lfs{VP}{tense:T \\ number:N} }
\end{lstlisting}


\section{Discourse Representation Structures}

Several macros in \cvt\ facilitate display of discourse 
Representation Structures (\textsc{drs}es) in the box notation introduced by 
Hans Kamp.  The simplest one is \jcsmacro{drs}, which takes two arguments:
a list of discourse variables joined by \verb"~", and a list of \textsc{drs} 
conditions separated by \verb"\\".  Nesting is permitted.  Note that the 
\jcsmacro{drs} macro itself does not give you a displayed environment; you 
must use \jfenv{flushleft} or the like to display the \textsc{drs}.
Here are some examples:

\begin{minipage}{.5\textwidth}
\begin{lstlisting}[moretexcs={drs}]
\begin{flushleft}
  \drs{X}{donkey(X)\\green(X)}
\end{flushleft}
\end{lstlisting}
\end{minipage}\hfill
\begin{minipage}{.4\textwidth}
\begin{flushleft}
\drs{X}{donkey(X)\\green(X)}
\end{flushleft}
\end{minipage}

\medskip

\begin{minipage}{.5\textwidth}
\begin{lstlisting}[moretexcs={drs}]
\begin{flushleft}
  \drs{X}
  {named(X,`Pedro') \\
    \drs{Y}{donkey(Y)\\owns(X,Y)}~~
    {\large $\Rightarrow$}~
    \drs{~}{feeds(X,Y)}
  }
\end{flushleft}
\end{lstlisting}
\end{minipage}\hfill
\begin{minipage}{.4\textwidth}
	\begin{flushleft}
		\drs{X}
		{named(X,`Pedro') \\
			\drs{Y}{donkey(Y)\\owns(X,Y)}~~
			{\large $\Rightarrow$}~
			\drs{~}{feeds(X,Y)}
		}
	\end{flushleft}
\end{minipage}

\medskip

\noindent To display a sentence above the \textsc{drs}, use \jcsmacro{sdrs}, as in:

\begin{lstlisting}[moretexcs={sdrs}]
\begin{flushleft}
  \sdrs{A donkey is green.}{X}{donkey(X)\\green(X)}
\end{flushleft}
\end{lstlisting}
which prints as:

\begin{flushleft}
		\sdrs{A donkey is green.}{X}{donkey(X)\\green(X)}
\end{flushleft}

Some \textsc{drs} connectives are also provided (normally for forming
\textsc{drs}es that are to be nested within other \textsc{drs}es).
The macro \jcsmacro{negdrs} forms a \textsc{drs} preceded by a negation symbol:
\begin{lstlisting}[moretexcs={negdrs}]
\negdrs{X}{donkey(X)\\green(X)}
\end{lstlisting}
\begin{flushleft}
\negdrs{X}{donkey(X)\\green(X)}
\end{flushleft}
Finally, \jcsmacro{ifdrs} forms a pair of \textsc{drs}es joined by a big arrow,
like this:
\begin{lstlisting}[moretexcs={ifdrs}]
\ifdrs{X}{donkey(X)\\hungry(X)}
      {~}{feeds(Pedro,X)}
\end{lstlisting}
\begin{flushleft}
\ifdrs{X}{donkey(X)\\hungry(X)}
      {~}{feeds(Pedro,X)}
\end{flushleft}
If you have an ``if''-structure appearing among ordinary predicates 
inside a \textsc{drs}, you may prefer to use \jcsmacro{alifdrs}, which is just like 
\jcsmacro{ifdrs} but shifted slightly to the left for better alignment.

\section{Exercises}\label{sec:exercises}

The \jenv{exercise} environment (alias \jenv{covexercise}) generates an exercise numbered according 
to chapter, section, and subsection (suitable for use in a large book; 
in this example, the subsection number is going to come out as 0). Here is an example:
\begin{exercise}[Project]
Prove that the above assertion is true.
\end{exercise}
This was coded as
\begin{lstlisting}
\begin{exercise}[Project]
Prove that the above assertion is true.
\end{exercise}
\end{lstlisting}
The argument (\verb"[Project]" in the example) is optional.

Note that, as of version 1.1, \cvt\ checks if there is already an \jenv{exercise} environment
defined (e.\,g., by the class). If so, \cvt\ does not define its own one. However, there is always
the alias environment \jenv{covexercise} which can be used in order to produce \texttt{covington's} exercise.
If you use the package option \joption{force}, \cvt\ will override existing \jenv{exercise}
environments. In any case, the package will issue a warning if \jenv{exercise} is already defined.

\section{Reference Lists}\label{sec:reflists}

To type a simple \textsc{lsa}-style hanging-indented reference list, you can use the \jenv{reflist}
environment.  (\emph{Note:} \jenv{reflist} is not integrated with Bib\TeX\ in any way.%
\footnote{For Bib\TeX, there are several options: the \textsc{lsa} style, as used in the journal \emph{Language},
can be obtained by means of the style files \texttt{lsalike.bst}
(\url{http://www.icsi.berkeley.edu/ftp/pub/speech/jurafsky/lsalike.bst}) or \texttt{language.bst}
(\url{http://ron.artstein.org/resources/language.bst}); the latter uses \texttt{natbib}.
The so-called \emph{Unified Style Sheet for Linguistics}, as proposed by the \textsc{cel}x\textsc{j}
(\emph{Committee of Editors of Linguistics Journals}), which slightly differs from the \textsc{lsa} style,
is followed by the style file \texttt{unified.bst} (available at \url{http://celxj.org/downloads/unified.bst}).
A \texttt{biblatex} style file for the unified style is available at
\url{https://github.com/semprag/biblatex-sp-unified} or on \textsc{ctan} as part of the \textsf{univie-ling} bundle.})  For example,
\begin{lstlisting}
\begin{reflist}
Barton, G. Edward; Berwick, Robert C.; and Ristad, Eric Sven.  1987.
Computational complexity and natural language.  Cambridge, 
Massachusetts: MIT Press.

Chomsky, Noam.  1965.  Aspects of the theory of syntax.  Cambridge,
Massachusetts: MIT Press.

Covington, Michael.  1993.  Natural language processing for Prolog
programmers.  Englewood Cliffs, New Jersey: Prentice-Hall.
\end{reflist}
\end{lstlisting}
prints as:
\begin{reflist}
Barton, G. Edward; Berwick, Robert C.; and Ristad, Eric Sven.  1987.
Computational complexity and natural language.  Cambridge, 
Massachusetts: MIT Press.

Chomsky, Noam.  1965.  Aspects of the theory of syntax.  Cambridge,
Massachusetts: MIT Press.

Covington, Michael A.  1993.  Natural language processing for Prolog 
programmers.  Englewood Cliffs, New Jersey: Prentice-Hall.
\end{reflist}
By default, the references have a hanging indentation of 3\,em. This can
be globally changed by altering the length \jcsmacro{reflistindent}.
Doing \lstinline|\setlength\reflistindent{1.5em}|, for instance,
will shorten the indentation by half. Likewise, the length \jcsmacro{reflistitemsep}
(6\,pt by default) and \jcsmacro{reflistparsep} (ca. 4\,pt by default) can be adjusted
to alter the vertical separation (\jfcsmacro{itemsep} and \jfcsmacro{parsep}, for that
matter) of reference entries.

Notice that within the reference list, ``French spacing'' is in effect 
--- that is, spaces after periods are no wider than normal spaces. Thus 
you do not have to do anything special to avoid excessive space after 
people's initials.


\section{Displayed sentences}

The macro \jcsmacro{sentence} displays an italicized sentence (it is a 
combination of \jfenv{flushleft} and \jfmacro{itshape}).  If you type
\begin{lstlisting}[moretexcs={sentence}]
\sentence{This is a sentence.}
\end{lstlisting}
you get:
\sentence{This is a sentence.}


\section{Big curly brackets (disjunctions)}

Last of all, the two-argument macro \jcsmacro{either} expresses alternatives
within a sentence or \textsc{ps}-rule:
\begin{flushleft}
\lstinline[moretexcs={either}]"the \either{big}{large} dog" $=$ the \either{big}{large} dog \\
\end{flushleft}
\begin{flushleft}
\lstinline[moretexcs={either,psr}]"\psr{A}{B~\either{C}{D}~E} " $=$ \psr{A}{B~\either{C}{D}~E}
\end{flushleft}

That's all there is for now.
Suggestions for improving \cvt\ are welcome, and bug
reports are actively solicited (via \url{https://github.com/jspitz/covington}).  Please note, however, that this is free
software, and the authors make no commitment to do any further work on 
it.

\section{Release history}

\subsection*{1.7 (2018 September 8)}

\begin{itemize}
	\item Fix alignment in \jenv{subexamples}.
	\item Improve manual.
\end{itemize}

\subsection*{1.6 (2018 September 7)}

\begin{itemize}
	\item Introduce new environment \jenv{subexamples} (see sec.~\ref{sec:subexs}).
	\item Introduce new command \jcsmacro{pxref} (see sec.~\ref{sec:ref}).
\end{itemize}

\subsection*{1.5 (2018 August 24)}

\begin{itemize}
	\item Introduce new option \joption{keeplayout} which allows to opt-out the
	      layout presettings \cvt\ does (\jfcsmacro{raggedbottom}, \jfcsmacro{textfloatsep}).
\end{itemize}

\subsection*{1.4 (2017 May 23)}

\begin{itemize}
	\item Introduce a new macro \jcsmacro{twodias} that supersedes the rather odd \jcsmacro{twoacc}
	      (which is kept for backwards compatibility). See sec.~\ref{sec:accents} for details.
	\item Introduce macro \jcsmacro{SetDiaOffset} for more convenient setting of vertical distance
	      in stacked diacritics. See sec.~\ref{sec:accents} for details.
	\item \LaTeX\ 2.09 is no longer officially supported (it might continue to work, but is not
	      tested).
\end{itemize}

\subsection*{1.3 (2017 April 5)}

\begin{itemize}
	\item Gloss variants \jcsmacro{xgll} and \jcsmacro{xglll} that work
	      inside macros (such as footnotes) but require explicit gloss
	      line end markers (\jcsmacro{xgle}). See sec.~\ref{sec:gloss} for details.
	\item New lengths \jcsmacro{reflistindent}, \jcsmacro{reflistparsep} and
	      \jcsmacro{reflistitemsep} to globally adjust the indentation or vertical
	      space, respectively, of reflist items.
	      See sec.~\ref{sec:reflists} for details.
\end{itemize}

\subsection*{1.2 (2016 August 26)}

\begin{itemize}
	\item New length \jcsmacro{examplenumbersep} to adjust (increase) the horizontal space
	between example number and example text. See sec.~\ref{sec:ex} for details.
	\item Add some more info about bibliography generation.
\end{itemize}

\subsection*{1.1a (2016 July 7)}

\begin{itemize}
	\item Fix encoding problem in documentation and some typos. No change in functionality.
\end{itemize}

\subsection*{1.1 (2016 July 6)}

\begin{itemize}
	\item The package now uses \textsc{nfss} font commands if available (fallback for \LaTeX\ 2.09 is still provided).
	\item Work around clash with classes\slash packages that define their own \jenv{example} and
               \jenv{examples} environments (most notably the \texttt{beamer} class) as well as \jenv{execise} environments.
               The \cvt\ package no longer blindly attempts to define these environments. By default, it does not
               define them if they are already defined (\texttt{covington's} own environments, however, are still available via aliases).
               By means of a new package option, a redefinition can also be forced.  See sec.~\ref{sec:ex} and \ref{sec:exs} for details.
	\item New length \jcsmacro{twoaccsep} allows for the adjustment of the distance between stacked accents (see sec.~\ref{sec:accents}).
	\item Update manual.
	\item New maintainer: J. Spitzm\"uller.
	\item License has been changed to \textsc{lppl} (in agreement with M. Covington)
	\item Introduce version numbers. Arbitrarily, we start with 1.1.
\end{itemize}

\subsection*{2014 May 16}

\begin{itemize}
	\item Patches by Robin Fairbairns:
	\begin{itemize}
		\item Setting of \jfcsmacro{textfloatsep} uses \jfcsmacro{setlength} rather than \jfcsmacro{renewcommand}
		\item Style file converted to un*x line endings
	\end{itemize}
\end{itemize}

\subsection*{2001 March 27}

\begin{itemize}
	\item It is no longer necessary to type \jfcsmacro{it} to get proper italic type in feature structures.
	\item Instructions have been rewritten with \LaTeXe\ users in mind.
\end{itemize}

\subsection*{Older versions}

\begin{itemize}
	\item Multiple accents on a single letter (e.\,g., \emph{\acm{a}}) are supported.
	\item This package is now called \cvt\ (with the o)
	and is compatible with \LaTeXe\ and \textsc{nfss} as well as \LaTeX\ 2.09.
	\item The vertical placement of labeled feature structures has 
	been changed
	so that the category labels line up regardless of the size of
	the structures.
\end{itemize}

\begin{thebibliography}{99}
	\bibitem{pakin} Pakin, Scott. The Comprehensive \LaTeX\ Symbol List.
	30 November 2015. \url{http://www.ctan.org/pkg/comprehensive}.
\end{thebibliography}

\end{document}