Debian Codegraph @

texmf-dist/doc/latex/gb4e/gb4e-doc.tex

raw
1 % -*- LaTeX -*-
2 %%%% Latex2e:
3 \documentclass[11pt,a4paper]{article}
4 \usepackage{gb4e}
5 %%%% LaTeX209:
6 %\documentstyle[a4,11pt,gb4e]{article}
7 %%
8 \def\bs{$\backslash$}
9 \frenchspacing\parskip1.2ex
10 \parindent0pt
11 \def\bit{\vskip.05\baselineskip\hspace*{1em}\hangindent4em\hangafter1}
12 \title{Preliminary documentation for {\tt gb\gbVersion.sty}\thanks{%
13 Parts of ``Government-Binding style'' {\tt gb\gbVersion.sty} are
14 loosely based on ideas and code by M.~Covington, M.~van der Goot,
15 J.~Frampton and L.~Holt. In particular it automatically includes {\tt
16 cgloss\gbVersion.sty}, a (heavily adapted) version of M.~Covington's
17 \LaTeX-adaptation of M.~van der Goot's plain\TeX{} Midnight gloss
18 macros.} and {\tt cgloss\gbVersion.sty}}
19 \author{Hans-Peter Kolb \\[2pt]
20 Craig Thiersch $<${\sf c\[email protected]}$>$}
21 \date{}
22 \begin{document}
23 \maketitle
24 \tableofcontents
25 \vspace*{1cm}
26 \vfill
27 \subsection*{Important note:}
28 The file {\tt gb\gbVersion.sty}\footnote{%
29 This version of {\tt gb{\em x}.sty}
30 redesigns the entire series of {\tt \bs ex}
31 commands. It also contains changes to the gloss-macros to make them
32 work in footnotes etc. {\bf NB: The {\em {\tt e}xport\/} version does
33 not provide a
34 soft-landing system of command-compatibility with earlier
35 versions}.
36
37 NB: Make sure to get {\tt cgloss\gbVersion.sty} together with {\tt
38 gb\gbVersion.sty}.
39
40 This version of gb4e includes some \emph{minimal} bug-fixes and enhancements by
41 Alexis Dimitriadis, with emphasis on backward compatibility.
42 }
43 allows \verb"_" (subscript) and
44 \verb"^" (superscript) to be used in ordinary text, which is handy,
45 but because it changes their definitions it must be loaded {\bf after}
46 any file that uses them in their \TeX\ meaning.
47 \pagebreak
48 \section{Linguistic examples in \LaTeX}
49 {\tt gb\gbVersion.sty} is a style option to be used
50 with \LaTeX's major document styles. To make its commands available,
51 add it to your document's preamble like this:
52 \bit (in LaTex2e:)~~~~~~\verb,\usepackage{gb4e},
53 \bit (in LaTex 2.09:)~~{\tt \bs documentstyle[\ldots gb\gbVersion]\{\ldots\}}
54
55
56 Its core is an environment for the formatting of
57 linguistic examples.
58
59 The format is simple:\\
60 (Batches of) examples are introduced by
61 \verb,\begin{exe}, which sets up the top level example environment.
62 Obviously, this environment has to be closed after the example(s) by
63 \verb,\end{exe},. You can create sub- and subsubexamples by
64 embedding several {\tt xlist}-environments (up to three levels deep).
65
66 Here is an elaborate example:
67 \begin{verbatim}
68 \begin{exe} % sets up the top-level example environment
69 \ex\label{here} Here is one. % example with running number
70 \ex[*]{Here another is.} % judged ex. with running number
71 \ex Here are some with judgements.
72 \begin{xlist} % first embedding (alphabetical numbering)
73 \ex[]{A grammatical sentence am I.}
74 \ex[*]{An ungrammatical sentence is you.}
75 \ex[??]{A dubious sentence is she.}
76 \ex % just the number
77 \begin{xlist} % second embedding (roman numbering)
78 \ex[**]{Need one a second embedding?}
79 \ex[\%]{sometime.}
80 \end{xlist} % end second embedding
81 \ex Dare to judge me!
82 \end{xlist} % end first embedding
83 \ex This concludes our demonstration.
84 \end{exe} % end example environment
85 \end{verbatim}
86 This produces:
87 \begin{exe} % sets up the top-level example environment
88 \ex\label{here} Here is one. % example with running number
89 \ex[*]{Here another is.} % judged ex. with running number
90 \ex Here are some with judgements.
91 \begin{xlist} % first embedding (alphabetical numbering)
92 \ex[]{A grammatical sentence am I.}
93 \ex[*]{An ungrammatical sentence is you.}
94 \ex[??]{A dubious sentence is she.}
95 \ex % just the number
96 \begin{xlist} % second embedding (roman numbering)
97 \ex[**]{Need one a second embedding?}
98 \ex[\%]{sometime.}
99 \end{xlist} % end second embedding
100 \ex Dare to judge me!
101 \end{xlist} % end first embedding
102 \ex This concludes our demonstration.
103 \end{exe} % end example environment
104
105 All example-list commands have an optional argument which allows you to
106 set the labelwidth to, e.g., the widest label to come (in the style of
107 \verb,\begin{bibliography},). So,
108 \verb,\begin{exe}[(234)], will set the labelwidth to the width
109 of ``{\tt (234)}''---which is also the default. The other defaults
110 are ``{\tt m.}'' for {\tt xlist}, and ``{\tt iii.}'' for {\tt xlisti}.
111 The default labelwidth for the {\tt exe}-environment can also be changed
112 globally by issuing a \verb,\exewidth{<string>}, command in the
113 preamble of your document (i.e.\ between
114 \verb'\documentclass' and \verb'\begin{document}').
115
116 \subsection{Examples with running numbers}
117 As just shown, every example with a running number
118 is introduced by \verb'\ex'.
119 Obviously, \verb,\ex, is {\em context-sensitive\/}: at the top
120 level the number produced is {\em arabic} and accumulative
121 throughout the document; in embedded {\tt xlist}-environments it is
122 {\em alphabetic\/} on the first level, {\em roman\/} on the second, and
123 {\em arabic\/} on the third, starting with $a.$, $i.$, and $1.$,
124 repectively. For total control over the shape
125 of your subexample-numbering there are some special forms listed
126 below:\footnote{%
127 Note that for all
128 {\tt \bs begin\{<env>\}} \ldots {\tt \bs end\{<env>\}} pairs the forms
129 {\tt \bs<env>} \ldots {\tt \bs end<env>} are also permissible in \LaTeX.
130 So if you like you can go on using {\tt\bs xlist} \ldots
131 {\tt\bs endxlist} for {\tt \bs begin\{xlist\}} \ldots {\tt \bs end\{xlist\}}
132 etc., but \LaTeX-syntaxcheckers and utilities like AUC-\TeX\ won't
133 recognize them as necessarily paired and won't report unmatched
134 expressions. (Have you ever tried {\tt <Ctrl>-C <Ctrl>-C}
135 (= LaTeX-environment) or {\tt <Ctrl>-C <Ctrl>-F}
136 (= LaTeX-close-environment) in EMACS' AUC-\TeX\ mode? You should---it
137 saves a lot of typing.)}
138 \begin{center}
139 \begin{tabular}{|l|l|}\hline
140 {\em Environment}& {\em Default numbering}\\ \hline\hline
141 \verb,\begin{exe}, \ldots \verb,\end{exe},& (1) arabic
142 (Toplevel)\\ \hline\hline
143 \verb,\begin{xlist}, \ldots \verb,\end{xlist},& depends on level of
144 embedding\\ \hline
145 \verb,\begin{xlista}, \ldots \verb,\end{xlista},& a. alphabetical\\
146 \verb,\begin{xlisti}, \ldots \verb,\end{xlisti},& ii. roman\\
147 \verb,\begin{xlistn}, \ldots \verb,\end{xlistn},& 3. arabic\\
148 \verb,\begin{xlistI}, \ldots \verb,\end{xlistI},& IV. Roman\\
149 \verb,\begin{xlistA}, \ldots \verb,\end{xlistA},& E. Alphabetical\\ \hline
150 \end{tabular}
151 \end{center}
152 In all cases, \verb,\label,/\verb,\ref, commands will do The Right
153 Thing.
154
155 The syntax of \verb,\ex, is as follows:
156 \bit\verb'\ex' $\Longrightarrow$ a label with running number (e.g., if a
157 sublist of examples follows).
158 \bit\verb'\ex <example>' $\Longrightarrow$ a numbered example.
159 \bit\verb'\ex[<judgement>]{<example>}' $\Longrightarrow$ a numbered example
160 with judgement.
161
162 The space reserved for judgements can be controlled by the command\break
163 \verb,\judgewidth{<string>},, which sets it to the width of
164 \verb,<string>, (Default: ``{\tt ??}''). It can be issued in the
165 preamble to change the
166 default globally, or within an {\tt exe}-environment for a
167 local change.
168
169 \paragraph*{In short:} Use \verb"\ex" for all numbered
170 examples; if they have no optional argument (judgement)
171 they will be flush left;
172 if they have {\tt [ ] }'s then there will be a space reserved for
173 judgements. (NB: In this case you have to
174 indicate the scope of the example itself with \{\ldots\}'s.)
175
176
177 \subsection{Examples with other identifiers}
178 Sometimes it is necessary not to use running numbers but to specify
179 the identifier of an example manually as in:
180 \begin{quote}
181 \ldots let us now contemplate Chomsky (1981:264, ex.29f):
182 \begin{exe}
183 \exi{(29)} \al\lb{INFL} AGR]\lb{VP} V\ldots]
184 \exi{(30)}
185 \begin{xlist}[(ii)]
186 \exi{(i)} \be\lb{VP} V-AGR\ldots]
187 \exi{(ii)} \be\lb{VP}\lb{VP} V-AGR\ldots] NP]
188 \end{xlist}
189 \end{exe}
190 \end{quote}
191 For cases like this there is the command \verb'\exi{<identifier>}'
192 which works exactly like \verb'\ex':
193 \bit\verb'\exi{<identifier>}' $\Longrightarrow$ the identifier as label
194 \bit\verb'\exi{<identifier>} <example>' $\Longrightarrow$ the example
195 labelled with identifier
196 \bit\verb'\exi{<identifier>}[<judgement>]{<example>}'
197 $\Longrightarrow$ the judged example,\\ labelled with identifier.\\
198
199
200 So the example above is produced by:
201
202 \pagebreak[2]
203 \begin{verbatim}
204 \ldots let us now contemplate Chomsky (1981:264, ex.29f):
205 \begin{exe}
206 \exi{(29)} \al\lb{INFL} AGR]\lb{VP} V\ldots]
207 \exi{(30)}
208 \begin{xlist}[(ii)]
209 \exi{(i)} \be\lb{VP} V-AGR\ldots]
210 \exi{(ii)} \be\lb{VP}\lb{VP} V-AGR\ldots] NP]
211 \end{xlist}
212 \end{exe}
213 \end{verbatim}
214
215 \verb'\exi' can be used to deal with many labelling problems. The
216 three most commons ones are predefined:
217 \begin{itemize}
218 \item Crossreferences (\verb'\exr{<label>}'):
219 \begin{itemize}
220 \item[]
221 \ldots a sentiment already expressed in (\ref{here})
222 on page \pageref{here}, repeated here:
223 \begin{exe}
224 \exr{here} Here is one.
225 \end{exe}
226 \begin{verbatim}
227 \ldots a sentiment already expressed in (\ref{here})
228 on page \pageref{here}, repeated here:
229 \begin{exe}
230 \exr{here} Here is one.
231 \end{exe}
232 \end{verbatim}
233 \end{itemize}
234 \item Crossreferences with primes (\verb'\exp{<label>}'):
235 \begin{itemize}\item[]
236 \ldots which contrasts sharply with
237 \begin{exe}
238 \exp{here}[??]{Here is two}
239 \end{exe}
240 \begin{verbatim}
241 \ldots which contrasts sharply with
242 \begin{exe}
243 \exp{here}[??]{Here is two.}
244 \end{exe}
245 \end{verbatim}
246 \end{itemize}
247 \item Unnumbered examples (\verb'\sn'):
248 \begin{itemize}\item[]
249 \ldots here we have an example
250 \begin{exe}
251 \sn[\%]{Colourless green ideas sleep furiously.}
252 \end{exe}
253 of a sentence too famous to be numbered\ldots
254 \begin{verbatim}
255 \ldots here we have an example
256 \begin{exe}
257 \sn[\%]{Colourless green ideas sleep furiously.}
258 \end{exe}
259 of a sentence too famous to be numbered\ldots
260 \end{verbatim}
261 \end{itemize}
262 \end{itemize}
263 Again, these commands work exactly as \verb'\ex' or
264 \verb'\exi{<identifier>}'.
265
266 \pagebreak[2]
267 \section{Glosses}\label{gloss}
268 {\tt gb\gbVersion.sty} offers a set of commands for typesetting glosses based
269 on M.\ Covington's \LaTeX-adaptation of M.\ van der Goot's Midnight gloss
270 \TeX-macros.\footnote{They are defined in the file {\tt cgloss\gbVersion.sty}
271 which is automatically read by {\tt gb\gbVersion.sty}.}\\[5pt]
272 A gloss basically contains two elements:
273 \bit \verb'\gll' (obligatory):
274 introduces the actual sentence/gloss pair;\footnote{%
275 There is also a three-line version of {\tt \bs gll}, {\tt \bs glll} for
276 special morphological/phonological information (not for the free
277 translation!).}
278 \bit \verb'\glt' or \verb'\trans' (optional): introduces a free
279 translation.
280
281 \pagebreak[2]
282 So the following
283 \begin{verbatim}
284 \begin{exe}
285 \ex
286 \gll Wenn jemand in die W\"uste zieht ... \\
287 If someone in the desert draws and lives ... \\
288 \trans `if one retreats to the desert and ... '
289 \end{exe}
290 \end{verbatim}
291 produces:
292 \begin{exe}
293 \ex
294 \gll Wenn jemand in die W\"uste zieht und lebt dort von Heuschrecken
295 oder sich im Wald verirrt hat und n\"ahrt sich von Wurzeln und
296 Beeren, \ldots\\
297 If someone in the desert draws and lives there from grasshoppers or
298 self {in the} woods errored has and nourisches self from roots and
299 berries \ldots\\
300 \trans `if one retreats to the desert and lives there from
301 grasshoppers or gets lost in the woods and lives off of roots and berries'
302 \end{exe}
303
304 Since the macro counts words, to match one word with a
305 multi-word gloss or vice versa, you either have to put the words in
306 braces or use
307 hyphens. For example, German {\em zum} could be glossed as either
308 \verb"{to the}" or \verb"to-the". And of course, if you have a word that is
309 not glossed, like WH-trace $e_i$ or a proper name, you have to tell the
310 gloss line that there's something there, e.g. with \{~\}.
311 \begin{exe}
312 \ex
313 \gll Den Fritz_1 habe ich \_\_{}_1 zum Essen eingeladen.\\
314 the fred have I {} {to the} eating invited.\\
315 \glt I invited Fred for dinner.
316 \end{exe}
317 is produced by
318 \begin{verbatim}
319 \begin{exe}
320 \ex
321 \gll Den Fritz_1 habe ich \_\_{}_1 zum Essen eingeladen.\\
322 the fred have I {} {to the} eating invited.\\
323 \glt I invited Fred for dinner.
324 \end{exe}
325 \end{verbatim}
326
327 Although it is possible to treat an optional judgement just as the
328 first word of the sentence with a null-translation as in (\ref{null}),
329 the standard way of using an optional argument with \verb'\ex' as in
330 (\ref{arg}) is simpler (and conceptually more consistent).
331 \begin{exe}
332 \ex\label{null}
333 \gll * Dit is een voorboeldje.\\
334 {} This is an example.\\
335 \trans `Here's where the translation would be'
336
337 \ex[*]{\label{arg}
338 \gll Dit is een voorboeld.\\ This is an example.\\
339 \trans `and this would be the translation line'
340 }
341 \end{exe}
342 \pagebreak[2]
343 This output is produced by
344 \begin{verbatim}
345 \ex
346 \gll * Dit is een voorboeldje.\\
347 {} This is an example.\\
348 \trans `Here's where the translation would be'
349 \end{verbatim}
350 and
351 \begin{verbatim}
352 \ex[*]{
353 \gll Dit is een voorboeld.\\
354 This is an example.\\
355 \trans `and this would be the translation line'}
356 \end{verbatim}
357 respectively.
358
359
360 By default the glosses appear in
361 ``Linguistic Inquiry style'' with all lines in \verb"\rm". To change a line
362 (e.g.\ to italics if required for a particular journal), just put
363 the appropriate lines in the preamble of your document, e.g.,
364 \verb"\let\eachwordone=\it".\footnote{Font commands that take an argument, such as {\tt \bs textit}, can only be used with versions of gb4e after 2009/12/28. Upgrade to the latest version or use argument-less font commands, such as {\tt \bs it}.}
365 The same for
366 \verb"\eachwordtwo" and \verb"\eachwordthree" (used by the three line
367 glosses introduced by \verb'\glll'). Note that it will
368 {\em not} work
369 to put \verb"\it" before the line in your text, as the words are parsed
370 separately.
371 For example,
372 \verb"\let\eachwordone=\it" yields
373 \begin{exe}
374 \let\eachwordone=\it
375 \ex[?]{
376 \gll Und hier k\"onnen wir sehen was f\"ur Unfug wird gemacht wenn er einen
377 ganz langen Satz binnen kriegt\\
378 and hier can we see what for nonsense will-be made if he a very long
379 sentence inside gets.\\
380 \glt `and here's what happens to a looooong sentence'}
381 \end{exe}
382 and \verb"\let\eachwordtwo=\sf" gives
383 \begin{exe}\let\eachwordtwo=\sf
384 \ex[*]{
385 \gll Cette phrase n'a pas une traduction.\\
386 This sentence {not has} nought a translation.\\}
387 \end{exe}
388 As you can see by these examples, you can also re-define the {\tt eachword}
389 variables in your file for individual examples by using the \verb"\let"
390 command within the \verb"\begin{exe}" environment, and then the style change is
391 local.
392
393 By default, the glosses will be single-spaced even in double-spaced
394 environments. If you---or rather the journal you're submitting
395 to---don't like that, just give the command \verb,\nosinglegloss, in the
396 preamble of your document.
397
398 \section{Varia}
399 {\tt gb\gbVersion.sty} contains a few additional goodies (mostly
400 abbreviations for frequently used constructions) which will be
401 properly documented in a subsequent life. For now just some sample of
402 uses:
403 \begin{itemize}
404 \item X-bar styles: Per default \verb,\obar{X} \ibar{X} \iibar{X} \mbar{X},
405 yields \obar{X} \ibar{X} \iibar{X} \mbar{X}. With \verb,\primebars,
406 in the preamble, the outcome is \obar{X} X^{'} XP \mbar{X}.
407 \item Labelled bracketings:
408 \verb,\lb{NP}[1]\lb{D}[1] the]\lb{\ibar{N}},\break \verb,example]], yields
409 \lb{NP}[1]\lb{D}[1] the]\lb{\ibar{N}} example]]. An analogous
410 right-bracket (\verb,\rb,) is also defined.
411 \item Greek letters: the frequently used letters \al\be\ga\de\ and
412 \th\ have abbreviations \verb,\al \be \ga \de \th, which also work
413 outside mathmode.
414 \item Sub- \& superscripts (\verb,_, and \verb,^,) work outside mathmode, too.
415 \\
416 {\bf Note:} This feature is known to cause problems for a number of
417 other packages. It is retained for backward compatibility. In case of problems,
418 you can disable it by adding the command \verb|\noautomath| in your preamble
419 immediately after loading the gb4e package. You can also re-enable it later with
420 the command \verb|\automath|. [Added 2009/12/28]
421
422 \end{itemize}
423 At the very end of the style-file a couple of special accents for
424 ``exotic'' languages are defined. Also, check out the \verb,\attop,-,
425 \verb,\atcenter,-macros (by Lex Holt) for aligning naughty
426 ({\tt picture}-)examples to their numbers, as well as J.~Frampton's
427 movement-arrows:
428 \begin{exe}
429 \ex\atcenter{
430 \arrowalign{
431 \fillright\pd&\link3&\fillleft{\vrule\hfil}\cr
432 Did&\ &John&\ &t_{\mathrm{Agr}}&\ appear &t&\ to be likely &t&\ to win.\cr
433 &&\fillright\pu&\link3&\centr{\vrule\spacer\pu}&\lf&\fillleft\vrule\cr}
434 }
435 \end{exe}
436 \begin{verbatim}
437 \begin{exe}
438 \ex\atcenter{
439 \arrowalign{\fillright\pd&\link3&\fillleft{\vrule\hfil}\cr
440 Did&\ &John&\ &t_{\mathrm{Agr}}&\ appear &t&\ to be likely
441 &t&\ to win.\cr
442 &&\fillright\pu&\link3&\centr{\vrule\spacer\pu}&\lf
443 &\fillleft\vrule\cr}
444 }
445 \end{exe}
446 \end{verbatim}
447
448
449 \end{document}