summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/expex/source/09_Glosses-Basic.tex
blob: 6927698442a98dbe02cd712bb5c099dfb5971fc4 (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
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
\everymath={}

\section Glosses

\begininventory
\macros
\idx{|\begingl[]|},
\idx{|\glpreamble[]|},
\idx{|\gla[]|},
\idx{|\glb[]|},
\idx{|\glc[]|},
\idx{|\glft[]|},
\idx{|\endgl|}
\endmc
\endinventory
%
Before I introduce the parameters that control the
characteristics of gloss displays, here are a few examples done
with the initial settings of the parameters.

\medskip
\framedisplay
\ex<wapm>
\begingl
\gla k- wapm -a -s'i -m -wapunin -uk //
\glb CL V AGR NEG AGR TNS AGR //
\glb 2 see {\sc 3acc} {} {\sc 2pl} preterit {\sc 3pl} //
\glft `you (pl) didn't see them'//
\endgl
\xe
\endframedisplay
\codedisplay~
\ex
\begingl
\gla k- wapm -a -s'i -m -wapunin -uk //
\glb CL V AGR NEG AGR TNS AGR //
\glb 2 see {\sc 3acc} {} {\sc 2pl} preterit {\sc 3pl} //
\glft `you (pl) didn't see them'//
\endgl
\xe
|endcodedisplay

\framedisplay
\ex<sicher>
\begingl
\gla Mary$_i$ ist sicher, dass es den Hans nicht st\"oren w\"urde
seiner Freundin ihr$_i$ Herz auszusch\"utten.//
\glb Mary is sure that it the-{\sc acc} Hans not annoy would
his-{\sc dat} girlfriend-{\sc dat} her-{\sc acc} heart-{\sc acc} {out to
throw}//
\glft  `Mary is sure that it would not annoy John to reveal her
heart to his girlfriend.'//
\endgl
\xe
\endframedisplay
\codedisplay~
\ex
\begingl
\gla Mary$_i$ ist sicher, dass es den Hans nicht st\"oren w\"urde
seiner Freundin ihr$_i$ Herz auszusch\"utten.//
\glb Mary is sure that it the-{\sc acc} Hans not annoy would
his-{\sc dat} girlfriend-{\sc dat} her-{\sc acc}
heart-{\sc acc} {out to throw}//
\glft  `Mary is sure that it would not annoy John to reveal her
heart to his girlfriend.'//
\endgl
\xe
|endcodedisplay


\framedisplay
\ex<um>
\begingl
\glpreamble Um-\"asudda' h\"am yan i taotao ni si Juan
ilek-\~na nu guahu mal\"agu' gui
asudd\"a'-\~na.//
\gla Um-\"asudda' h\"am yan [ i taotao [ {\it O\/} ni si Juan
ilek-\~na nu guahu [ mal\"agu' gui [ asudd\"a'-\~na {\it
t\/} ] ] ] ] @ .//
\glb agr-meet we with the person Op Comp the Juan say-agr Obl me
agr.want he {\it WH\/}[obl].meet-agr//
\glft ``I met the person who Juan told me he wanted to
meet.''//
\endgl
\xe
\endframedisplay
\codedisplay~
\ex
\begingl
\glpreamble Um-\"asudda' h\"am yan i taotao ni si Juan
   ilek-\~na nu guahu mal\"agu' gui asudd\"a'-\~na.//
\gla Um-\"asudda' h\"am yan [ i taotao [ {\it O\/} ni si Juan
   ilek-\~na nu guahu [ mal\"agu' gui [ asudd\"a'-\~na {\it
   t\/} ] ] ] ] @ .//
\glb agr-meet we with the person Op Comp the Juan say-agr Obl me
   agr.want he {\it WH\/}[obl].meet-agr//
\glft ``I met the person who Juan told me he wanted to
   meet.''//
\endgl
\xe
|endcodedisplay

Glosses (|\begingl| \dots\ |\endgl|) have up to three
parts.  First, an optional preamble (|\glpreamble| \dots\ |//|).
Second, an interlinear gloss, which is also optional provided there is
a preamble.\footnote{%
Contrary to first impressions, there are good reasons to allow the
interlinear gloss to be omitted in certain situations.}  Third, a free
translation (|\glft| \dots\ |//|), which can be omitted if there is an
interlinear gloss. They are illustrated below, which repeats (\lastx)
with a narrower hsize.

\begingroup
\input pstricks-add
\ex
\def\TOP{\pnode(3.4in,1.5ex)}%
\def\BOT{\pnode(0,-.5ex)}%
\begingl[glwidth=3.2in]
\glpreamble \TOP{A1}Um-\"asudda' h\"am yan i taotao ni si Juan
ilek-\~na nu guahu mal\"agu' gui
asudd\"a'-\~na.\BOT{B1}//
\gla \TOP{A2}Um-\"asudda' h\"am yan [ i taotao [ {\it O\/} ni si Juan
ilek-\~na nu guahu [ mal\"agu' gui [ asudd\"a'-\~na {\it
t\/} ] ] ] ] @ .//
\glb agr-meet we with the person Op Comp the Juan say-agr Obl me
agr.want he {\it WH\/}[obl].meet-agr\BOT{B2}//
\glft \TOP{A3}``I met the person who Juan told me he wanted to
meet.''\BOT{B3}//
\endgl
\SpecialCoor
\psbrace[ref=lC](A1|B1)(A1){ preamble}
\psbrace[ref=lC](A1|B2)(A2){ interlinear gloss}
\psbrace[ref=lC](A1|B3)(A3){ free translation}
\xe
\endgroup

The interlinear gloss consists of a sequence of lines of the form
$$\hbox{|\gl|{\it levelname\/} \dots\ |//|}$$
where {\it levelname\/} is |a|, |b|, or |c|.\footnote{%
This will be extended later to allow the user to define new level
names.}  There must be one and only one |\gla| line, which must come
first in the interlinear gloss. |\glb| and |\glc| lines can come in
any order and can be repeated arbitrarily.

The material delineated by |\gl|{\it levelname\/} and |//| is parsed
as a sequence of space separated items.  The parser only looks for
spaces at the top-level.  Consequently, in (\blastx), for example, it
is not sensitive to the space in items like |the-{\sc acc}| since the
space is inside a group, therefore not at the top level.  Spaces that
directly precede terminating |//| are disregarded.  A line in the
interlinear gloss can have fewer items on it than the line above it. It
acts as if it ended with empty |{}| items.  But {\it no line in the
interlinear gloss can have more items than the line above it}.  If
there are ``excess'' items on a line, they will act as if they are on
the higher line (recursively).

\subsection Parameters

\def\\#1{\noalign{\smallskip}\quad #1\cr}%
\hrule
\medskip
\parinventory
\\{Horizontal spacing\hidewidth}
\quad & \idx{|glspace|\user}& \inc dimension& \textdim{1 em}\cr
\\{Font changes, struts, etc.\hidewidth}
& \idx{|everygl|}& token list& |{}|\cr
& \idx{|everyglpreamble|}& token list& |{}|\cr
& \idx{|everygla|}& token list& |\it|\cr
& \idx{|everyglb|}& token list& |{}|\cr
& \idx{|everyglc|}& token list& |{}|\cr
& \idx{|everyglft|}& token list& |{}|\cr
\\{Vertical spacing\hidewidth}
& \idx{|belowglpreambleskip|\user}& (!)dimension& \textdim{1 ex}\cr
& \idx{|aboveglbskip|\user}& (!)dimension& \textdim{0 pt}\cr
& \idx{|aboveglcskip|\user}& (!)dimension& \textdim{0 pt}\cr
& \idx{|aboveglftskip|\user}& (!)dimension& \textdim{1 ex}\cr
\endparinventory
\vskip-1ex
\hrule
\medskip

Suppose for example that rather than the gloss in (\getref{wapm}) the
following style is desired.

\framedisplay
\ex
\begingl[glspace=2em]
\gla[everygla=] k- wapm -a -s'i -m -wapunin -uk //
\glb[everyglb=\sc,aboveglbskip=-.4ex]
   cl v agr neg agr tns agr //
\glb 2 see {\sc 3acc} {} {\sc 2pl} preterit {\sc 3pl} //
\glft[everyglft=\it,aboveglftskip=0pt] `you (pl) didn't see them'//
\endgl
\xe
\endframedisplay
There are several differences with (\getref{wapm}).  The words are
more widely separated; the font in the |\gla| line is not italic;  the
font in the free translation is italic; the first |\glb| line is set
in a smaller font and is moved up closer to the |\gla| line; and there
is no extra vertical skip between the free translation and the last
line of the interlinear gloss, as there is in (\getref{wapm}).

Here is one way to write the code:

\codedisplay
\ex
\begingl[glspace=2em]
\gla[everygla=] k- wapm -a -s'i -m -wapunin -uk //
\glb[everyglb=\sc,aboveglbskip=-.4ex]
   cl v agr neg agr tns agr //
\glb 2 see {\sc 3acc} {} {\sc 2pl} preterit {\sc 3pl} //
\glft[everyglft=\it,aboveglftskip=0pt] `you (pl) didn't see them'//
\endgl
\xe
|endcodedisplay

Here is an alternative which produces the same output.  It has the
advantage that all of the parameter settings are gathered in one
place, making it easier to modify.

\codedisplay
\ex
\begingl[glspace=2em,everygla=,everyglb=\sc,
   aboveglbskip=-.4ex,everyglft=\it,aboveglftskip=0pt]
\gla k- wapm -a -s'i -m -wapunin -uk //
\glb cl v agr neg agr tns agr //
\glc 2 see {\sc 3acc} {} {\sc 2pl} preterit {\sc 3pl} //
\glft `you (pl) didn't see them'//
\endgl
\xe
|endcodedisplay

If you use multiple instances of the same gloss format, a style should
be defined

\codedisplay
\definelingstyle{Potawatami}{glspace=2em,everygla=,everyglb=\sc,
   aboveglbskip=-.4ex,everyglft=\it,aboveglftskip=0pt}
|endcodedisplay

Then, typesetting a gloss in that style is done simply.

\codedisplay
\ex
\begingl[lingstyle=Potawatami]
\gla k- wapm -a -s'i -m -wapunin -uk //
\glb Ccl V Agr Neg Agr Tns Agr //
\glc 2 see {\sc 3acc} {} {\sc 2pl} preterit {\sc 3pl} //
\glft `you (pl) didn't see them'//
\endgl
\xe
|endcodedisplay

If you want a sequence of glosses to all be done in this style, you can say:

\def\goop{\quad $\vdots$}
\codedisplay
\begingroup
\lingset{lingstyle=Potawatami}
|goop
\endgroup
|endcodedisplay

\subsection The width of the gloss

In the wrap style (the only gloss style currently implemented),
the gloss is built in a vbox whose width is determined implicitly
if the parameter |glwidth| is set to \textdim{0 pt}. The width is
$h-l-r$, where $h$, $l$, and $r$, are the current values of
|\hsize|, |\leftskip|, and |\rightskip|, respectively.  This
implicit determination of the width of the gloss is appropriate
for use with the \ExPex\ macros which typeset examples because
they adjust the leftskip appropriately inside examples.

If you want to supply an example number or explicit label, it will not
work to say something like the following if |glwidth| is set to
\textdim{0 pt}.

\def\goop{\dots\ }
\codedisplay
[A]\quad \begingl |goop \endgl
|endcodedisplay
%
The vbox built by the gloss macro will not fit on the same line with
the [A].

You must say:

\def\temp{\dots }
\codedisplay
\ex[exno=A,exnoformat={[X]}] \begingl |temp \endgl
|endcodedisplay
The braces around |[A]| are needed to so that the optional argument
is correctly delineated.  For example:

\framedisplay
\ex[exno={(6), p. 14},exnoformat={[X]}]
\begingl
\gla Mary$_i$ ist sicher, dass es den Hans nicht st\"oren w\"urde
seiner Freundin ihr$_i$ Herz auszusch\"utten.//
\glb Mary is sure that it the-{\sc acc} Hans not annoy would
his-{\sc dat} girlfriend-{\sc dat} her-{\sc acc} heart-{\sc acc} {out to
throw}//
\endgl
\xe
\endframedisplay
\codedisplay~
\ex[exno={(6), p. 14},exnoformat={[X]}]
\begingl
\gla Mary$_i$ ist sicher, dass es den Hans nicht st\"oren w\"urde
seiner Freundin ihr$_i$ Herz auszusch\"utten.//
\glb Mary is sure that it the-{\sc acc} Hans not annoy would
his-{\sc dat} girlfriend-{\sc dat} her-{\sc acc} heart-{\sc acc} {out to
throw}//
\endgl
\xe
|endcodedisplay

If the parameter |glwidth| is set to a nonzero dimension, the width of
the vbox that the gloss is constructed in is the specified dimension.

The following example illustrates the usefulness of the explicit
width option.

\ex[glwidth=2.6in]<sicher2>
a.\quad
\begingl
\gla Mary$_i$ ist sicher, dass es den Hans nicht st\"oren w\"urde
seiner Freundin ihr$_i$ Herz auszusch\"utten.//
\glb Mary is sure that it the-{\sc acc} Hans not annoy would
his-{\sc dat} girlfriend-{\sc dat} her-{\sc acc} heart-{\sc acc} {out to
throw}//
\glft  `Mary is sure that it would not annoy John to reveal her
heart to his girlfriend.'//
\endgl
\hfil
b.\quad
\begingl
\gla Mary$_i$ ist sicher, dass seiner Freunden ihr$_i$ Herz
auszuch\"utten dem Hans nicht schaden w\"urde.//
\glb Mary is sure that his-{\sc dat} girlfriend-{\sc dat} her-{\sc acc}
heart-{\sc acc} {out to throw} the-{\sc dat} Hans not damage would//
\glft `Mary is sure that to reveal her heart to his girlfriend
would not damage John.'//
\endgl
\xe

\codedisplay~
\ex[glwidth=2.6in]
a.\quad
\begingl
\gla Mary$_i$ ist sicher, dass es den Hans nicht st\"oren w\"urde
seiner Freundin ihr$_i$ Herz auszusch\"utten.//
\glb Mary is sure that it the-{\sc acc} Hans not annoy would
his-{\sc dat} girlfriend-{\sc dat} her-{\sc acc} heart-{\sc acc} {out to
throw}//
|exbreak\glft  `Mary is sure that it would not annoy John to reveal her
heart to his girlfriend.'//
\endgl
\hfil
b.\quad
\begingl
\gla Mary$_i$ ist sicher, dass seiner Freunden ihr$_i$ Herz
auszuch\"utten dem Hans nicht schaden w\"urde.//
\glb Mary is sure that his-{\sc dat} girlfriend-{\sc dat} her-{\sc acc}
heart-{\sc acc} {out to throw} the-{\sc dat} Hans not damage would//
\glft `Mary is sure that to reveal her heart to his girlfriend
would not damage John.'//
\endgl
\xe
|endcodedisplay


\subsection Comments and citations

\begininventory
\macros
\idx{|\trailingcitation|}, \idx{|\rightcomment|}\endmc
\parameters*
|mincitesep|& dimension& \hfil \textdim{1.5 em}\cr
\endinventory

The following illustrates two different ways to append a comment or
citation to a gloss.

\framedisplay
\ex
\begingl
\gla \rightcomment{[Potawatami]}k- wapm -a -s'i -m -wapunin -uk //
\glb \rightcomment{category}Cl V Agr$_1$ Neg Agr$_2$ Tns Agr$_3$//
\glb 2 see {\sc 3acc} {} {\sc 2pl} preterit {\sc 3pl} //
\glft `you (pl) didn't see them'\trailingcitation{(Hockett 1948,
   p. 143)}//
\endgl
\xe
\endframedisplay
\codedisplay~
\ex
\begingl
\gla \rightcomment{[Potawatami]}k- wapm -a -s'i -m -wapunin -uk //
\glb \rightcomment{category}Cl V Agr$_1$ Neg Agr$_2$ Tns Agr$_3$//
\glb 2 see {\sc 3acc} {} {\sc 2pl} preterit {\sc 3pl} //
\glft `you (pl) didn't see them'\trailingcitation{(Hockett 1948,
   p. 143)}//
\endgl
\xe
|endcodedisplay
|\trailingcitation| will put the citation on the same line as the last
line of the free translation if there is enough room for it, otherwise at the
end of the  following line.  The parameter |mincitesep| determines the
minimum whitespace between the end of the free translation and the
citation that is tolerated; the default is \textdim{1.5 em}.

|\rightcomment{|\dots|}| must come first in the first item on the
line.  The macro is very primitive.  It does not
consider the width of the citation or the amount of whitespace at
the right of the gloss.  The citation will overlap the gloss if
there is not room for it at the right.  For example, if the gloss
(\lastx) is attempted with an hsize of \textdim{3.5 in} and
|glspace=.5em|, the result is (\nextx).

\framedisplay
\hsize=3.5in
\ex
\rightcomment{[Potawatami]}
\begingl
\gla k- wapm -a -s'i -m -wapunin -uk //
\glb \rightcomment{category}Cl V Agr$_1$ Neg Agr$_2$ Tns Agr$_3$//
\glb 2 see {\sc 3acc} {} {\sc 2pl} preterit {\sc 3pl} //
\glft `you (pl) didn't see them'\trailingcitation{(Hockett 1948,
   p. 143)}//
\endgl
\xe
\endframedisplay

In spite of its limitations, |\rightcomment| is occasionally
quite useful.

\subsection  Exceptional {\tt \char"5C gla} items

Items on the |\gla| line are generally associated with items on
the other lines of the interlinear gloss.  There are however a
few items, called here {\it exceptional items}, which are
interpreted in an exceptional fashion. There are four exceptional
items, all consisting of a single character: |+|, |@|, |[|, and
|]|.

\subsubsection {\tt +}

\sidx{|+|, exceptional gloss item}%
Sometimes it is desirable to override natural wrapping and
break up the gloss so that the syntax is emphasized, as in the
following.

\framedisplay
\ex
\begingl
\gla Mary$_i$ ist sicher, + dass es den Hans nicht st\"oren w\"urde
+ seiner Freundin ihr$_i$ Herz auszusch\"utten.//
\glb Mary is sure that it the-{\sc acc} Hans not annoy would
his-{\sc dat} girlfriend-{\sc dat} her-{\sc acc} heart-{\sc acc} {out to
throw}//
\glft  `Mary is sure that it would not annoy John to reveal her
heart to his girlfriend.'//
\endgl
\xe
\endframedisplay

\bigskip
This is accomplished by inserting `|+|' appropriately, as shown in the
code below.  When |+| is encountered, the line is broken and a new
line started, ignoring any hanging indentation.

\codedisplay
\ex\begingl
\gla Mary$_i$ ist sicher, + dass es den Hans nicht st\"oren w\"urde
+ seiner Freundin ihr$_i$ Herz auszusch\"utten.//
\glb Mary is sure that it the-{\sc acc} Hans not annoy would
his-{\sc dat} girlfriend-{\sc dat} her-{\sc acc} heart-{\sc acc} {out to
throw}//
|exbreak
\glft  `Mary is sure that it would not annoy John to reveal her
heart to his girlfriend.'//
\endgl
\xe
|endcodedisplay

\subsubsection {\tt @}

\sidx{|@|, exceptional gloss item}%
Sometimes it is desirable to omit the space between two entries.

\framedisplay
\ex<wiye>
\begingl
\gla wiye kepi e- @ ca//
\glb two whitemen {\sc 1p:3d}- found//
\endgl
\xe
\endframedisplay

This is accomplished by inserting `|@|' appropriately, as shown
in the code below.

\codedisplay
\ex
\begingl
\gla wiye kepi e- @ ca//
\glb two whitemen {\sc 1p:3d}- found//
\endgl
\xe
|endcodedisplay
In the unlikely event that you need an entry which
would normally be entered as |@|, enter it as |{{@}}|
so that it is not interpreted as a directive to omit a space.
(\getref{@period}) below shows another use for the |@| diacritic.

\exbreak
\subsubsection {\tt [} and {\tt ]}: Bracketing in glosses

\sidx{|[|, exceptional gloss item}%
\sidx{|]|, exceptional gloss item}%
\begininventory
\macros \idx{|\printlbrack|}, \idx{|\printrbrack|}\endmc
\parameters
\idx{|glbrackbracksep|\user}& dimension& \hfil \textdim{.05 em}\cr
\idx{|glbrackwordsep|\user}& dimension& \hfil \textdim{.1 em}\cr
\endinventory
%
Suppose you want to produce a gloss display like the one below.

\framedisplay
\pex[everygla=,glhangstyle=normal]<@period>
\a
\begingl
\gla Fa'nu'i yu' ni [ [ {\it O} t{\it in\/}aitai-mu {\it t\/} ] na
lepblu ] @ .//
\glb show me Obl Op {\it WH\/}[obj].read-agr {} L book//
\glft ``Show me the book that you read.''//
\endgl
\a \begingl
\gla Um-\"asudda' h\"am yan [ i taotao [ {\it O\/} ni si Juan
ilek-\~na nu guahu [ mal\"agu' gui [ asudd\"a'-\~na {\it
t\/} ] ] ] ] @ .//
\glb agr-meet we with the person Op Comp the Juan say-agr Obl me
agr.want he {\it WH\/}[obl].meet-agr//
\glft ``I met the person who Juan told me he wanted to meet.''//
\endgl
\xe
\endframedisplay
\noindent The brackets are not glossed; there is a little extra space
between brackets; and there is a little extra space between words and
brackets.

(\lastx) is produced by:

\codedisplay
\pex[everygla=]
\a \begingl
\gla Fa'nu'i yu' ni [ [ {\it O} t{\it in\/}aitai-mu {\it t\/} ] na
lepblu ] @ .//
\glb show me Obl Op {\it WH\/}[obj].read-agr {} L book//
\glft ``Show me the book that you read.''//
\endgl
\a \begingl
\gla Um-\"asudda' h\"am yan [ i taotao [ {\it O\/} ni si Juan
ilek-\~na nu guahu [ mal\"agu' gui [ asudd\"a'-\~na {\it
t\/} ] ] ] ] @ .//
\glb agr-meet we with the person Op Comp the Juan say-agr Obl me
agr.want he {\it WH\/}[obl].meet-agr//
\glft ``I met the person who Juan told me he wanted to meet.''//
\endgl
\xe
|endcodedisplay

\noindent |@| is used in the gla-line to eliminate an unwanted
space before the period.

\ExPex\ uses the macros |\printrbrack| and
|\printlbrack| to typeset the brackets.  The definitions of
these macros could be changed to cause [ and ] in glosses to
insert something other than simple brackets.


\everymath={}
\lingset{glwidth=2.4in,everygl=,glhangstyle=none}
\psset{framesep=1ex}


\def\minigloss#1#2{\outlinebox{%
   \vtop{\halign{\ministrut ##\hfil\cr #1\cr #2\cr}}}\hskip1pt}%
\let\ministrut=\relax
\def\miniglossbare#1#2{\vtop{\halign{##\hfil\cr
   #1\cr #2\cr}}}
\psset{linewidth=.4pt}
\def\outlinebox{\psframebox[framesep=0,boxsep=false,linewidth=.4pt]}

\subsection  Line spacing in wrapped glosses

\subsubsection Changes from version 4.0

\begininventory
\parameters*
\idx{|abovemoreglskip|}\user& (!)skip& \hfil \textdim{1 ex}& now obsolete\cr
\endinventory

\noindent
Executing the macro |\gloldstyle| will return \ExPex\ to a state in
which glosses written using version 4.0 should display as they
did using version 4.0.  The parameter |abovemoreglskip| which
was used to control wrap spacing in glosses is still recognized,
but it is now considered obsolete and should be avoided in future
work.

\subsubsection Simple control

\begininventory
\parameters*
\idx{|autoglskip|}& boolean& \hfil true\cr
\idx{|extraglskip|}\user& \inc skip& \hfil \textdim{0 pt}\cr
\endinventory

\noindent In deciding on a gloss format, the main decision is
the value of what I call the {\it glskip}, as illustrated
below.

\ex[textoffset=1in,dima=.5em]<Chung1>
\begingl[extraglskip=1.2ex]
\gla Ti ma'a'\~nao hao kumuentusi\pnode(\lingdima,0){B2} \pnode(-\lingdima,0){A1}ni h\'ayiyi ha'.//
\glb \pnode(-.5em,0){A2}not agr.afraid you
Infin.speak.to\pnode(\lingdima,0){B1} not anyone Emp//
\glft ``You're not afraid to talk to anyone.''//
\endgl
\pcline{|*-|*}(A2)(A1)
\pcline{<->}(A2)(A1)
\nbput[ref=r]{glskip\ }
\pcline{|*-|*}(B1|B2)(B1)
\pcline{<->}(B1|B2)(B1)
\naput[ref=l]{\ baselineskip}
\xe
Generally, the desired glskip is equal to the baselineskip or
equal to the baselineskip plus some specified increment.  When I
have occasion to typeset glosses, I generally make the glskip
equal to the baselineskip plus \textdim{.6 ex}.  The extra space,
although small, makes it much easier to parse the gloss visually.
The extra glskip in (\lastx) is \textdim{1.2 ex}.

ExPex initializes the glossing algorithm so that it produces
glosses like~(\nextx). The glskip is equal to the baselineskip.
This is done in {\it expex.tex\/} by setting |autoglskip| to true
and |extraglskip| to \textdim{0 pt}. In adjusting the glskip,
struts are used.  It is assumed that the strut height plus the
strut depth is equal to the baselineskip. Most users will never
reset |autoglskip|.  The next section discusses vertical spacing
when |autoglskip| is set to false. (|glwidth| is set to
\textdim{2.4 in} in all of the examples in this section in the
interests of ``economy of space''.)

\setss .52 .48

\beginss
\ex
\begingl
\gla Ti ma'a'\~nao hao kumuentusi
   ni h\'ayiyi ha'.//
\glb not agr.afraid you
   Infin.speak.to not anyone Emp//
\endgl
\xe|midss
\ex<Ti>
\begingl
\gla Ti ma'a'\~nao hao kumuentusi ni h\'ayiyi ha'.//
\glb not agr.afraid you Infin.speak.to not anyone Emp//
\endgl
\xe
\endss

It is easy to produce glosses like (\nextx) by adjusting the
parameter |extraglskip|.  In (\nextx), the glskip is \textdim{1.2
ex} larger than the baselineskip.

\beginss
\ex
\begingl[extraglskip=1.2ex]
\gla Ti ma'a'\~nao hao kumuentusi
   ni h\'ayiyi ha'.//
\glb not agr.afraid you
   Infin.speak.to not anyone Emp//
\endgl
\xe|midss
\ex
\begingl[extraglskip=1.2ex]
\gla Ti ma'a'\~nao hao kumuentusi ni h\'ayiyi ha'.//
\glb not agr.afraid you Infin.speak.to not anyone Emp//
\endgl
\xe
\endss

If |extraglskip| is expressed in font dependent units, the format
for glosses will not need adjustment for glosses in footnotes
which are set in smaller type with tighter baselines. This
assumes that the footnote environment adjusts the strut size
appropriately, as it should, with the height plus depth of struts
made equal to the baselineskip. The text in (\nextx) is set in a
\textdim{12 pt} font with \textdim{14 pt} baselines.  Struts are
\textdim{10 pt} high and 4pt deep. |\fnenvironment| switches to a
\textdim{10 pt} font with \textdim{12 pt} baselines, with struts
that are 8.5pt high and 3.5pt deep.

\lingset{autoglskip=true}

\beginss
\ex
\begingl[extraglskip=1ex]
\gla Ti ma'a'\~nao hao kumuentusi
   ni h\'ayiyi ha'.//
\glb not agr.afraid you
   Infin.speak.to not anyone Emp//
\endgl
\xe|midss
\ex
\begingl[extraglskip=1ex]
\gla Ti ma'a'\~nao hao kumuentusi ni h\'ayiyi ha'.//
\glb not agr.afraid you Infin.speak.to not anyone Emp//
\endgl
\xe
\endss
\vskip-2ex

\beginss
\fnenvironment
\ex
\begingl[extraglskip=1ex]
\gla Ti ma'a'\~nao hao kumuentusi
   ni h\'ayiyi ha'.//
\glb not agr.afraid you
   Infin.speak.to not anyone Emp//
\endgl
\xe|midss
\lingset{autoglskip=true,extraglskip=1ex}
\baselineskip=12pt
\setbox\strutbox=\hbox{\vrule height 8.5pt depth 3.5pt width 0pt}
\footnotesize
\ex
\begingl[extraglskip=1ex]
\gla Ti ma'a'\~nao hao kumuentusi ni h\'ayiyi ha'.//
\glb not agr.afraid you Infin.speak.to not anyone Emp//
\endgl
\xe
\endss

Most users will never need to know more about glossing than that
provided in this section. But some, at some point, might face
some unusual situation requiring more control over the line
spacing than the control which |extraglskip| allows.  The
next section is for such users only.

\subsubsection The techonology behind vertical spacing in glosses

\begininventory
\parameters
\idx{|gllineskip|}\user & \inc skip& \hfil\textdim{1 ex}\cr
\idx{|glstruts|}& boolean& \hfil true\cr
\endinventory



\noindent  Wrapping is carried out by first forming a sequence of
boxes, as in (\nextx) and then feeding this sequence to Tex's
apparatus for breaking paragraphs into lines and stacking
sequences of lines into pages.  The baseline of these boxes is
the baseline of the top line.  As far as Tex is concerned, the
sequence of boxes is a sequence of words; a paragraph.  We use
(\getref{Ti}) as an illustration.  If struts are inserted before
every word of every box, we get (\nextx b), otherwise (\nextx a).
Generally, struts are inserted because this gives much better
control of the line spacing.

\pex[nopreamble,interpartskip=3ex]<seq>
\let\\=\minigloss
\spaceskip=\lingglspace
\a \\{Ti}{not}, \\{ma'a'\~nao}{agr.afraid}, \\{hao}{you},
\\{kumuentusi}{Infin.speak.to}, \\{ni}{not}, \\{h\'ayiyi}{anyone},
\\{ha'}{Emp}
\let\ministrut=\strut
\a \\{Ti}{not}, \\{ma'a'\~nao}{agr.afraid}, \\{hao}{you},
\\{kumuentusi}{Infin.speak.to}, \\{ni}{not}, \\{h\'ayiyi}{anyone},
\\{ha'}{Emp}
\xe
The boxes will be called {\it glwords}.

Suppose we feed (\lastx b), for example, to Tex's page formation
machinery.  The outcome, will depend on many Tex parameters.  Of
particular interest for the line spacing are |\baselineskip| and
|\lineskip|.  |\lineskiplimit| is set to \textdim{0 pt} in
glosses. There are nested environments; one governing stacking
words into glwords, the other governing stacking lines of
glwords. Call these the interior and exterior environments.  If
we consider (\nextx), for example, note that the dimension of
most interest, the vertical spacing between the {\it b\/} and
{\it c\/} lines is not a distance between baselines in either the
interior or exterior environments.  When glwords are built, the
baseline spacing is between the {\it a\/} and {\it b\/} lines
(the {c-d\/} spacing is the same).  When the glwords are formed
into a paragraph, the baseline spacing is between the {\it a\/}
and {\it c\/} lines. Line {\it a\/} is the baseline of the top
row of glwords and line {\it c\/} is the baseline of bottom row.

\ex[linestyle=dotted,linewidth=1pt]
\begingl[extraglskip=1ex]
\gla \pnode{A1}Ti ma'a'\~nao hao kumuentusi\pnode{B1} ni h\'ayiyi
ha'.\pnode{B3}//
\glb not agr.afraid you Infin.speak.to\pnode(1em,0){B2} not anyone
Emp\pnode{B4}//
\endgl
\pcline(A1|B1)(B2|B1)
\pcline(A1|B2)(B2|B2)
\pcline(A1|B3)(B2|B3)
\pcline(A1|B4)(B2|B4)
\rput(B2|B1){\pnode(1em,0){C1}}
\rput(C1){\tenit a}
\rput(C1|B2){\tenit b}
\rput(C1|B3){\tenit c}
\rput(C1|B4){\tenit d}
\xe
A desired value for the {\it b-c\/} line spacing must be achieved
indirectly.

ExPex leaves both the baselineskip in the exterior environment
the same as it is inside the glwords. This means that the
baselineskip will have no effect when the paragraph (\lastx a) or
(\lastx b) is typeset because the glwords are deeper than the
baselineskip.  \ExPex\ adjusts the |\lineskip| in the exterior
environment to achieve the desired {\it b-c\/} line spacing; that
is, to achieve the desired glskip.

(\nextx) illustrates the relation between |\lineskip| and the
glskip, assuming that strut insertion has taken place.

\ex[textoffset=.8in,aboveexskip=!1ex]
\def\outlinebox{\psframebox[framesep=0,boxsep=false,linewidth=.15pt]}
\let\\=\minigloss
\let\ministrut=\strut
\psscalebox{2}{\vtop{\leftskip=0pt \raggedright \hsize=2.4in
\lineskip=2ex
\leavevmode
\\{\pnode{Y1}Ti}{\pnode{Y3}not}\
\\{ma'a'\~nao}{agr.\pnode(0,-\dp\strutbox){A1}afraid}\
\\{hao}{you}\
\\{kumuentusi}{Infin.speak.to}\
\\{\pnode(-.2em,0){Y2}ni}{not}\
\\{h\'ayiyi\pnode(0,\ht\strutbox){A2}}{anyone}\
\\{ha'}{Emp}%
}}
\pcline[linewidth=1pt]{<->}(A1)(A1|A2)
\naput[ref=l]{lineskip}
\pcline[linewidth=1pt]{<->}(Y2|Y3)(Y2|Y2)
\pcline[linewidth=1pt]{|*-|*}(Y2|Y3)(Y2|Y2)
\nbput[ref=r]{glskip}
\xe

If autoglskip is turned on, |\lineskip| is adjusted so that the
glskip is equal to the baselineskip plus the value of
|extraglskip|.  If $|\baselineskip|=b$, $|\dp\strutbox|=d$,
$|\ht\strutbox|=h$, and $|extraglskip|=e$, then |\lineskip|
is set to $b+e-d-h$.

If |autoglskip| is turned off, struts are inserted only if
|glstruts| is turned on; |\lineskip| is made equal to
|gllineskip|.  With |glstruts| turned off, the glskip will depend
on |gllineskip|, the depth of the deepest character on the bottom
row of the top line of glwords, and the height of the tallest
character on the top row of the bottom line of glwords.

%\def\showchar#1{\setbox0=\hbox{#1}\writeln{#1: \the\ht0, \the\dp0}}
%\showchar{g}
%\showchar{p}
%\showchar{y}
%\showchar{\it h}
%\showchar{\it \'a}
%\showchar{\it '}
%\showchar{\it i}

The above will be clearer if you do the following exercise:
Calculate the glskip in the 3~examples below. The font is
\textdim{12 pt} with struts that are \textdim{10 pt} high and
\textdim{4 pt} deep.  The baselineskip is \textdim{18 pt}.  Roman
g, y, and p are all \textdim{2.60 pt} deep; italic h, italic ',
and italic i are all \textdim{7.96 pt} tall; and italic \'a is
\textdim{7.93 pt} tall.

\beginss
\ex
\begingl[autoglskip=true,
   extraglskip=4pt]
\gla Ti ma'a'\~nao hao kumuentusi
   ni h\'ayiyi ha'.//
\glb not agr.afraid you
   Infin.speak.to not anyone Emp//
\endgl
\xe|midss
\ex
\baselineskip=18pt
\begingl[autoglskip=true,extraglskip=4pt]
\gla Ti ma'a'\~nao hao kumuentusi ni h\'ayiyi ha'.//
\glb not agr.afraid you Infin.speak.to not anyone Emp//
\endgl
\xe
\endss

\beginss
\ex
\begingl[autoglskip=false,
   glstruts=true,gllineskip=8pt]
\gla Ti ma'a'\~nao hao kumuentusi
   ni h\'ayiyi ha'.//
\glb not agr.afraid you
   Infin.speak.to not anyone Emp//
\endgl
\xe|midss
\ex
\baselineskip=18pt
\begingl[autoglskip=false,glstruts=true,gllineskip=8pt]
\gla Ti ma'a'\~nao hao kumuentusi ni h\'ayiyi ha'.//
\glb not agr.afraid you Infin.speak.to not anyone Emp//
\endgl
\xe
\endss

\def\goop{$\,^{\the\fnno}$}
\beginss
\ex
\begingl[autoglskip=false,
   glstruts=false,gllineskip=8pt]
\gla Ti ma'a'\~nao hao kumuentusi
   ni h\'ayiyi ha'.//
\glb not agr.afraid you
   Infin.speak.to not anyone Emp//
\endgl
\xe|putfnno|midss
\ex
\baselineskip=18pt
\begingl[autoglskip=false,glstruts=false,gllineskip=8pt]
\gla Ti ma'a'\~nao hao kumuentusi ni h\'ayiyi ha'.//
\glb not agr.afraid you Infin.speak.to not anyone Emp//
\endgl
\xe
\endss
\footnotebody{\hbox{\rput[tr]{180}{Answers: \textdim{22 pt}, \textdim{22 pt},
and \textdim{18.56 pt}}}
}

\subsubsection How to avoid overfull boxes in glosses

\begininventory
\parameters
\idx{|glspace|}& skip& \textdim{.5 em} plus \textdim{.4 em} minus
   \textdim{.15 em}\hfil\cr
\idx{|glrightskip|}& skip& 0\dimskip pt plus .1|\hsize|\hfil \cr
\endinventory
%
Hopefully, you will never encounter the problem which the
parameterization in this section is designed to solve, the
``overfull line'' error message.  The default setting puts
\textdim{.5 em} of glue between the glwords on a line, plus
\textdim{.4 em} of stretchability and \textdim{.15 em} of
shrinkage.  The interglword spacing on a line can therefore vary
from \textdim{.35 em} up to \textdim{.9 em} to accommodate the
needs of the Tex linebreaking algorithm.\footnote{%
This is a much larger range than is typical in running text, but
it is appropriate in glosses, which typically have many large
whitespace gaps on one line or the other.}
Further, the default settings allow up to 10\% of the hsize of
whitespace to appear at the end of the line of glwords.  The
possible extra space at the right edge and
stretchability/shrinkability of the space between glwords means
that line breaking in glosses will rarely encounter problems with
overfull lines.

In unusual cases, there may be a problem.  Your publisher (or
you) may be particularly fussy and demand a particular spacing
and/or better right alignment in glosses.  Or you might want to make a
unusually narrow gloss, which increases the chances that there
might not be enough flexibility in the spacing.

If you do run into the problem of overfull lines in a gloss, two
parameters allow for a great deal of flexibility; |glspace| and
|glrightskip|. |glspace| is an incremental parameter, so you could say,
for example, |\lingset{glspace=!0pt plus .2em}|, increasing the
stretchability of the interglword space by \textdim{.2 em}. Or,
you might want to increase the stretchability of the rightskip
in a particular troublesome gloss to allow more whitespace at the
right edge.  An acceptable solution will depend on your
particular typesetting aesthetics. Solving line breaking problems
is often troublesome and requires experimentation.

\medskip
The Chamorro examples in (\getref{@period}) and (\getref{Chung1})
are adapted from Sandy Chung's {\it The Design of Agreement}. See
(59a) on page 237, (82a) on page 247, and (59b) on page 97.  The
Potawatami example (\getref{wapm}) is from Halle and Marantz's
``Distributed Morphology'' article. The German examples in
(\getref{sicher2}) are from an article by Idan Landau. The Kiowa
example (\getref{wiye}) was contributed by Daniel Harbour.