diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/expex/expex.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/expex/expex.tex | 408 |
1 files changed, 284 insertions, 124 deletions
diff --git a/Master/texmf-dist/tex/generic/expex/expex.tex b/Master/texmf-dist/tex/generic/expex/expex.tex index 7d6f1de5c9c..dc6f11d22ff 100644 --- a/Master/texmf-dist/tex/generic/expex/expex.tex +++ b/Master/texmf-dist/tex/generic/expex/expex.tex @@ -1,5 +1,5 @@ \def\ExPexMessage - {2014/03/10 v5.0b ExPex linguistics example formatter (JF)} + {5/1/2017 v5.1a ExPex linguistics example formatter (JF)} % ------------------------------------------------------- % jf 2011/12/09 (v4.0a) % 1) fixed bug in how exceptional gla items are detected @@ -36,18 +36,42 @@ % for more detail about the changes % jf 2014/03/08 (v5.0b) % 1. restored allowing {} empty items in wrap glosses -% 2. introduced <glossbreaking> parameter +% 2. introduced <glbreaking> parameter +% jf 2014/03/14 (v5.0c) +% 1. fixed reference for IJAL style +% 2. fixed initialization for roman number parts in \pex +% jf 2015/01/06 (v5.0d) +% glftpos=right now works with the nlevel style +% many internal names were changed to the general form +% \gl@<style>@<ftpos>@<name> to make the code for switching style and +% ftpos much more transparent +% jf 2015/09/30 (v5.0e) +% right panel in nlevel style +% jf 4/11/2016 (v5.0f) +% fixed \ep@setlist so that it does not make global asssigment +% changed some names of the append commands to better fit their effect +% jf 3/9/2017 (v5.1) +% fixed bug so that \glbreaking works if extraglskip has stretch and/or +% shrink components +% jf 5/1/2017 (v5.1a) +% 1. made \sc equivalent to \scshape if the LaTex engine is used +% 2. made \it equivalent to \itshape if the LaTex engine is used +% 3. fixed bug in \getref in the IJAL style % -------------------------------------------------------- \edef\resetatcatcode{\catcode`\noexpand\@\the\catcode`\@\relax} \catcode`\@=11\relax \ifx\XKeyValLoaded\endinput \else \input xkeyval \fi +\newif\ifeplatex \ifx\ProvidesFile\@undefined + \eplatexfalse \message{\ExPexMessage} \else \ProvidesFile{expex.tex}[\ExPexMessage] + \eplatextrue \@addtofilelist{expex.tex} \let\it=\itshape + \let\sc=\scshape \let\pageno=\c@page % 2013/07/27 \g@addto@macro\cl@@ckpt @@ -104,11 +128,12 @@ \def\define@linginckey#1#2{% \define@key{ling}{#2}{% \ep@expandafterafter\@setinckey - #1\csname ling#2\endcsname ##1\@nil}% + #1\csname ling#2\endcsname ##1\@nil\relax}% test \relax %%%%%%%%%%%%%%%%%%%%%%% } -\def\define@lingincdimenkeys#1{\XKV@for@n{#1}\@key{% +\let\XKVforn=\XKV@for@n % added 2016/04/23 for easy use +\def\define@lingincdimenkeys#1{\XKVforn{#1}\@key{% \expandafter\define@linginckey\expandafter\dimen\expandafter{\@key}}} -\def\define@lingincskipkeys#1{\XKV@for@n{#1}\@key{% +\def\define@lingincskipkeys#1{\XKVforn{#1}\@key{% \expandafter\define@linginckey\expandafter\skip\expandafter{\@key}}} \def\@setinckey#1#2#3#4\@nil{% \ifx#3!% @@ -216,6 +241,8 @@ \let\stepexcnt=\ep@globalstepexcnt \def\keepexcntlocal{\let\stepexcnt=\ep@localstepexcnt} \def\ex@setup{% also used by \pex +%% TENTATIVE, insert \par +% \par \global\@specialexnofalse \latex@tagex \lingEveryex @@ -340,19 +367,41 @@ \leavevmode \next } +\def\ep@setdimensions{% \epd@numright=\wd\numbox \epd@labelleft=\linglabeloffset + \epd@numright=\wd\numbox + \epd@labelleft=\linglabeloffset + \advance\epd@labelleft by + \ifcase\ep@labelanchor + \epd@numright + \or + \lingnumoffset + \or + 0pt + \fi + \ep@settosum\epd@labelright\epd@labelleft\linglabelwidth + \ifcase\ep@textanchor % numleft + \ep@settosum\epd@textleft\lingnumoffset\lingtextoffset + \or % normal + \ep@settosum\epd@textleft\epd@labelright\lingtextoffset + \fi +} \def\ep@setdimensions{% \epd@numright=\wd\numbox \epd@labelleft=\linglabeloffset - \advance\epd@labelleft by \ifcase\ep@labelanchor - \epd@numright\or \lingnumoffset\or 0pt \fi -% \ep@setdimlabelleft + \advance\epd@labelleft by + \ifcase\ep@labelanchor + \epd@numright + \or + \lingnumoffset + \or + 0pt + \fi \ep@settosum\epd@labelright\epd@labelleft\linglabelwidth - \ifcase\ep@textanchor % numleft + \ifcase\ep@textanchor % numleft \ep@settosum\epd@textleft\lingnumoffset\lingtextoffset \or % normal \ep@settosum\epd@textleft\epd@labelright\lingtextoffset \fi -% \ep@setdimtextleft } %\def\lingnumrightoffset{\the\epd@numright}% \def\ep@setdimpreambleleft{% @@ -361,8 +410,7 @@ \epd@numright\or \epd@labelleft\or \epd@textleft \fi } \def\ep@pexcntinit{\ifnum\ep@labelgen=2\else - \pexcnt=\ling@pexcnt - \advance\pexcnt by -1 \fi} + \pexcnt=\ling@pexcnt \fi} \define@key[epx@]{labels}{tag}{\def\@optionaltag{#1}} \define@key[epx@]{labels}{label}{\def\@specialexno{#1}} \def\ep@setlabelkeys{\setkeys[epx@]{labels}} @@ -386,19 +434,22 @@ \def\@specialexno{}\def\@optionaltag{}% \@getoptionalarg\ep@putlabel@a } +% 03/14/2014 changed defs to edefs below \def\ep@putlabel@a{% \ep@useoptionallabelarg \ifx\@specialexno\empty \ifcase\ep@labelgen - \def\ep@label{\the\ep@everylabel \char\the\pexcnt}% + \edef\ep@label{\the\ep@everylabel \char\the\pexcnt}% +% \edef\ep@label{\the\ep@everylabel \char\noexpand\the\pexcnt}% \advance\pexcnt by 1 \or - \def\ep@label{\the\ep@everylabel \number\pexcnt}% + \edef\ep@label{\the\ep@everylabel \number\pexcnt}% +% \edef\ep@label{\the\ep@everylabel \number\noexpand\pexcnt}% \advance\pexcnt by 1 \or \ep@popLL \or - \def\ep@label{\the\ep@everylabel \romannumeral\pexcnt}% + \edef\ep@label{\the\ep@everylabel \romannumeral\noexpand\pexcnt}% \advance\pexcnt by 1 \fi \else @@ -423,6 +474,12 @@ \define@choicekey{ling}{labelanchor}[\scratch\ep@labelanchor]% {numright,numleft,margin}[]{} \define@lingkey{pexcnt}{\edef\ling@pexcnt{#1}} +% IJAL style +\definelingstyle{IJAL}{labelwidth=2em,labelanchor=numleft, + labeloffset=0pt,labelformat=(A),everylabel=\actualexno, + textanchor=normal,textoffset=1em,preambleanchor=text, + preambleoffset=0pt,avoidnumlabelclash, + appendtopexarg={samplelabel=(\actualexno a)}} %----------------------------------------- %----- judgments ----- \def\judge#1{\rm #1\kern .1em \ignorespaces} @@ -447,10 +504,10 @@ \ifcase\ep@labelgen \def\ep@label{\the\ep@everylabel \char\the\pexcnt}% \or - \def\ep@label{\the\ep@everylabel \number\pexcnt} + \def\ep@label{\the\ep@everylabel \number\pexcnt}% \or \or - \def\ep@label{\the\ep@everylabel \romannumeral\pexcnt} + \def\ep@label{\the\ep@everylabel \romannumeral\pexcnt}% \fi \ling@usearg \dimen0=\lingtextoffset @@ -463,11 +520,12 @@ } \def\ep@inserttabellabel{\@getoptionaltag\ep@inserttablelabel@a} \def\ep@inserttablelabel@a{% - \global\advance\pexcnt by 1 +% \global\advance\pexcnt by 1 \ifx\@optionaltag\empty \else \deftaglabel{\@optionaltag}% \fi \edef\foop{\ep@label.}\foop + \global\advance\pexcnt by 1 } \def\ep@omitlabel{\omit\hskip\linglabeloffset\hfil} %\def\endpextable{\egroup\egroup \par \prevdepth=\dp\strutbox} @@ -524,7 +582,9 @@ fullrefformat=XA,labelalign=left,labelwidth=.92em} \definelabeltype{numeric}{labelgen=number,pexcnt=1,labelformat=A., fullrefformat=X.A,labelalign=right,labelwidth=.75em} -\definelabeltype{roman}{labelgen=romannumber,pexcnt=1,labelformat=(A), +% 03/14/14 bug fix (wrong start to roman series labels) +\definelabeltype{roman}{labelgen=romannumber,pexcnt=2,labelformat=(A), +%\definelabeltype{roman}{labelgen=romannumber,pexcnt=1,labelformat=(A), fullrefformat=XA,labelalign=left,labelwidth=1.5em} %-- tags and reference ----- %----- local reference to example numbers ----- @@ -604,12 +664,10 @@ \@g@thertagsfalse \newwrite\ling@tagsfile \def\write@tags{\write\ling@tagsfile} -\def\tagfilesuffix#1{\edef\@tagfilesuffix{#1}} -\def\@tagfilesuffix{-tags} \def\gathertags{% \@setupreadtags \@g@thertagstrue - \immediate\openout\ling@tagsfile=\jobname\@tagfilesuffix\relax + \immediate\openout\ling@tagsfile=\jobname-tags\relax \immediate\write@tags{\noexpand\relax}% } %------ reading the tag file and defining the tags it encodes ----- @@ -625,10 +683,10 @@ \def\@setupreadtags{\if@readtags \do@readtags \global\@readtagsfalse \fi} \def\do@readtags{% - \immediate\openin\ling@tagsin=\jobname\@tagfilesuffix\relax + \immediate\openin\ling@tagsin=\jobname-tags\relax \ifeof\ling@tagsin \else \closein\ling@tagsin - {\catcode`@=11 \input \jobname\@tagfilesuffix\relax}% + {\catcode`@=11 \input \jobname-tags\relax}% \fi } %! @@ -706,26 +764,28 @@ \def\chooseref@a#1#2{#2} \def\chooseref@g#1#2{#1} % ----- glosses ----- -\define@choicekey{ling}{glstyle}[\ling@glstyle\gl@stylenum]{wrap,nlevel}{% - \ifcase\gl@stylenum - \let\gl@beginglstyle\glw@begingl - \let\endgl\glw@endgl - \glw@assignlevels - \let\glpreamble=\glw@preamble - \let\glft=\glw@glft - \else - \let\gl@beginglstyle\gln@begingl - \let\endgl\gln@endgl - \let\glpreamble=\gln@preamble - \let\glft=\gln@ft - \fi +\def\ling@glstyle{wrap} +\def\ling@glftpos{below} +\define@choicekey{ling}{glstyle}[\ling@glstyle\gl@style@num]{wrap,nlevel}{% + \ifnum\gl@style@num=0 \glw@assignlevels \fi + \gl@setprefix } \def\begingl{\bgroup\@getoptionalarg\gl@begingl} +% bug fix 2105/10/27 eliminate stray space +%\def\gl@begingl{% +% \ling@usearg +% \ling@everygl +% \gl@beginglstyle@a +%} \def\gl@begingl{% + \let\everylist=\empty \ling@usearg \ling@everygl - \gl@beginglstyle + \gl@beginglstyle@a } +\def\gl@beginglstyle@a{\@ifnextchar\@space\gl@beginglstyle@b\gl@beginglstyle} +\def\gl@beginglstyle@b #1{\gl@beginglstyle} +% end bug fix % parameters which are used in both gloss styles \define@ling@cmdkeys{everygl,everyglpreamble,everyglilg, everyglft, everyglword,glrightskip,glhangindent,glwidth} @@ -757,7 +817,7 @@ \gltoks@b=\expandafter{#2}% \edef#2{\the\gltoks@a\the\gltoks@b}% } -\def\gl@append #1\to #2{% +\def\gl@xappend #1\to #2{% renamed from \gl@append \gltoks@a={\\{#1}}% \gltoks@b=\expandafter{#2}% \xdef#2{\the\gltoks@b\the\gltoks@a}% @@ -765,14 +825,14 @@ \def\gl@lop#1\to#2{\ifx#1\empty \let#2\empty \else\expandafter\gl@lopoff#1\gl@lopoff#1#2\fi} \long\def\gl@lopoff\\#1#2\gl@lopoff#3#4{\def#4{#1}\def#3{#2}} -\def\gl@eappend{\expandafter\gl@append} +\def\gl@exappend{\expandafter\gl@xappend} % renamed from \gl@eappend \newif\ifgl@loopmore \def\gl@lopTL#1\to#2{% \ifx#1\empty #2={}\else \expandafter\gl@lopoffTL#1\gl@lopoffTL#1#2\fi} \long\def\gl@lopoffTL\\#1#2\gl@lopoffTL#3#4{#4={#1}\def#3{#2}} %%%%%%%%%%%%%%%%%%%% wrap style glosses %%%%%%%%%%%%%%%%%%%% -% \glw@begingl sets up the environment +% \gl@wrap@below@begin sets up the environment % \gla, \glb, etc. fill in the various lists which are initialized in % the environment % The input (something like the following) @@ -787,16 +847,23 @@ % are built. The vboxes are fed into Tex's regular paragraph % building machinary. %%%%%%%%%%%%%%%%%%%%%%%%%%%% -% introduced "glossbreaking" boolean parameter -\define@boolkey{ling}[ling@]{glossbreaking}{} -\lingset{glossbreaking=false} -\def\glw@begingl{\glw@begingl@a} -\def\glw@begingl@a{% +% introduced "glbreaking" boolean parameter +\define@boolkey{ling}[ling@]{glbreaking}[true]{} +\lingset{glbreaking=false} +\def\ep@setlist#1#2{\def#1{}\XKVforn{#2}\@this{\gl@eappend\@this\to#1}} +% 2016/04/18 support for LaTex color and xcolor packages +\define@ling@cmdkeys{glacolor} +\define@lingkey{glnlinecolors}{\ep@setlist\colorlist{#1}} +\lingset{glnlinecolors={},glacolor=} +% various modifications of gloss building macros which follow were made +% to make use of these parameters +\def\gl@wrap@below@begin{\gl@wrap@below@begin@a} +\def\gl@wrap@below@begin@a{% \bgroup \parindent0pt \ep@setglstrut \ifdim\ling@glwidth=0pt - \ifling@glossbreaking + \ifling@glbreaking \bgroup \else \vtop\bgroup @@ -809,6 +876,7 @@ \hsize=\ling@glwidth \leftskip=0pt \fi + \leavevmode \bgroup \parindent=0pt \@glpreamblefalse @@ -818,6 +886,7 @@ \let\aboveskiplist=\empty \let\strutlist=\empty \let\everylist=\empty + \let\colorlist=\empty } % As the list of lists is assembled, heights and depths of each % item are computed and maximum row heights and maximum row depths @@ -876,63 +945,68 @@ % action for empty words added 2014/03/08 \glw@wordfalse \@itemtype=0 - \gl@append \\{\glstrut}\to\mainlist - \gl@eappend 0\to\itemtypelist + \gl@xappend \\{\glstrut}\to\mainlist + \gl@exappend 0\to\itemtypelist \else \@setitemtype #1\@nil - \ifnum\@itemtype=0 \gl@append \\{\glstrut #1}\to\mainlist - \else \ifnum\@itemtype=5 \gl@eappend\@itembody\to\mainlist - \else \gl@append \\{}\to\mainlist + \ifnum\@itemtype=0 \gl@xappend \\{\glstrut #1}\to\mainlist + \else \ifnum\@itemtype=5 \gl@exappend\@itembody\to\mainlist + \else \gl@xappend \\{}\to\mainlist \fi\fi - \gl@eappend \the\@itemtype \to\itemtypelist + \gl@exappend \the\@itemtype \to\itemtypelist \fi \ifglw@word \setbox0=\hbox{\ling@everygla #1}% \ifdim\glw@maxht<\ht0 \glw@maxht=\ht0 \fi \ifdim\glw@maxdp<\dp0 \glw@maxdp=\dp0 \fi - \fi + \fi \glw@gla@b } \newdimen\gl@maxdplast \def\glw@updatelists{% + \edef\temp{\csname ling@gl\gl@linelabel color\endcsname}% + \gl@exappend\temp \to\colorlist \edef\temp{\csname lingabovegl\gl@linelabel skip\endcsname}% - \gl@eappend\temp \to\aboveskiplist + \gl@exappend\temp \to\aboveskiplist \edef\temp{\vrule width0pt height\the\glw@maxht\space depth\the\glw@maxdp\space }% \global\gl@maxdplast=\glw@maxdp - \gl@eappend\temp\to\strutlist + \gl@exappend\temp\to\strutlist \expandafter\expandafter\expandafter - \gl@append\csname ling@everygl\gl@linelabel\endcsname + \gl@xappend\csname ling@everygl\gl@linelabel\endcsname \to\everylist \gltoks@a=\expandafter{\everylist}% } \def\glw@assignlevels{% - \expandafter\XKV@for@n\expandafter{\glw@levels}\levelname + \expandafter\XKVforn\expandafter{\glw@levels}\levelname {\glw@assign@level\levelname}% } \def\glw@assign@level#1{% - \edef\temp{\noexpand\let - \expandafter\noexpand\csname gl#1\endcsname - \expandafter\noexpand\csname glw@gl#1\endcsname}% + \edef\Temp{#1}\def\XTemp{ft}% + \ifx\Temp\XTemp \let\temp\relax \else + \edef\temp{\noexpand\let + \expandafter\noexpand\csname gl#1\endcsname + \expandafter\noexpand\csname glw@gl#1\endcsname}\fi \temp } -% \glw@gla and \glw@glft get their definitions directly +% \glw@gla and \gl@wrap@below@ft get their definitions directly % \glw@gl<name> gets defined via \defineglwlevels, which adds <name> to the % list \glw@levels of defined glw levels \def\glw@levels{a,ft} \def\define@glw@level#1{% \expandafter\ifx\csname glw@gl#1\endcsname\relax + \define@ling@cmdkeys{gl#1color}% \define@ling@cmdkeys{everygl#1}% \define@linginckey\skip{abovegl#1skip}% \XKV@addtolist@o\glw@levels{#1}% - \lingset{everygl#1=,abovegl#1skip=0pt} + \lingset{everygl#1=,abovegl#1skip=0pt,gl#1color=} \expandafter\def\csname glw@gl#1\endcsname{\glw@glx{#1}}% - \ifx\gl@stylenum\undefined \else - \ifnum\gl@stylenum=0 \glw@assign@level{#1}\fi\fi + \ifx\gl@style@num\undefined \else + \ifnum\gl@style@num=0 \glw@assign@level{#1}\fi\fi \else \@expexwarn{Level #1 is already defined} \fi } -\def\defineglwlevels#1{\XKV@for@n{#1}\thislevel +\def\defineglwlevels#1{\XKVforn{#1}\thislevel {\expandafter\define@glw@level\expandafter{\thislevel}}% } \def\glw@glx#1{% x suggests any label (as argument to \glw@glx) @@ -941,6 +1015,7 @@ \def\gl@linelabel{#1}% \@getoptionalarg\glw@glx@a } + \def\glw@glx@a #1// {\bgroup \ling@usearg \expandafter\let\expandafter\@every @@ -962,12 +1037,12 @@ \gl@lop\blist\to\currb \ifnum\@itemtype=0 \gl@lop\alist\to\curra - \gl@eappend\curra\to\currb - \gl@eappend\currb\to\clist + \gl@exappend\curra\to\currb + \gl@exappend\currb\to\clist \else \ifnum\@itemtype=5 - \gl@eappend\currb\to\clist + \gl@exappend\currb\to\clist \else - \gl@append\\{}\to\clist + \gl@xappend\\{}\to\clist \fi\fi \repeat \global\let#2=\clist @@ -976,19 +1051,20 @@ \setbox0=\hbox{\@every #1}% \ifdim\glw@maxht<\ht0 \glw@maxht=\ht0 \fi \ifdim\glw@maxdp<\dp0 \glw@maxdp=\dp0 \fi - \gl@append {\glstrut #1}\to\worklist + \gl@xappend {\glstrut #1}\to\worklist \glw@glx@b } \defineglwlevels{b,c} \newif\ifglw@spacebefore -\long\def\glw@preamble #1// {% +\long\def\gl@wrap@below@preamble #1// {% \@glpreambletrue - {\hangindent=0pt \hangafter=0 \ling@everyglpreamble #1\strut + {\hangindent=0pt \hangafter=0 + \leavevmode\ling@everyglpreamble #1\strut \par \vskip\lingbelowglpreambleskip }% } -\def\glw@glft{\@getoptionalarg\glw@glft@a} -\long\def\glw@glft@a #1//{% +\def\gl@wrap@below@ft{\@getoptionalarg\gl@wrap@below@ft@a} +\long\def\gl@wrap@below@ft@a #1//{% \glw@printilgsetup \glw@printilg@a \vskip\lingaboveglftskip @@ -1003,7 +1079,7 @@ \ling@everyglft \strut #1\par } -\def\glw@endgl{% +\def\gl@wrap@below@end{% \if@glft \else \glw@printilg\egroup \fi \egroup\egroup\egroup } @@ -1013,7 +1089,9 @@ \rightskip=\ling@glrightskip \lineskiplimit=0pt \lineskip=\lingextraglskip - \ifdim\lingextraglskip=0pt \global\let\@ilgborderadjustment=\relax +% bug fix, 3/9/2017 +% \ifdim\lingextraglskip=0pt \global\let\@ilgborderadjustment=\relax + \ifdim\lineskip=0pt \global\let\@ilgborderadjustment=\relax \else \xdef\@ilgborderadjustment{\vskip\the\lineskip}\fi \if@glpreamble \@ilgborderadjustment \fi \ifcase\ep@glhangstyle @@ -1095,24 +1173,41 @@ \newtoks\gltoks@every \newtoks\gltoks@next \newbox\debug@glword +\def\ep@mklinecolorop{% + \ifx\@linecolor\empty \let\@linecolorop=\empty + \else \ep@mklinecolorop@a \fi} +\def\ep@mklinecolorop@a{% + \edef\@linecolorop{\noexpand\noexpand\noexpand\color{\@linecolor}}% +} +\def\pstglcolors{% + \def\ep@mklinecolorop@a{% + \edef\@@linecolor{\noexpand\csname\@linecolor\noexpand\endcsname}% + \edef\@@@linecolor{\ep@expandtwice\@@linecolor}% + \edef\@linecolorop{\expandafter\noexpand + \expandafter\noexpand\expandafter\noexpand\@@@linecolor}% + }% +} \def\glw@printglword{% \begingroup \gltoks@sofar={}% \gl@loopmoretrue \loop\ifgl@loopmore + \gl@lop\colorlist\to\@linecolor + \ep@mklinecolorop \gl@lop\aboveskiplist\to\@aboveskip \expandafter\ifdim\@aboveskip=0pt \def\@above{}\else \edef\@above{\noalign{\vskip\@aboveskip}}\fi \gl@lop\strutlist\to\@strut \gl@lopTL\everylist\to\gltoks@every \gl@lopTL\@currentitem\to\gltoks@next - \edef\temp{\the\gltoks@sofar \@above\@strut\the\gltoks@every\the\gltoks@next \cr}% + \edef\temp{\the\gltoks@sofar \@above\@strut + {\@linecolorop\the\gltoks@every \the\gltoks@next}\cr}% \gltoks@sofar=\expandafter{\temp}% \ifx\@currentitem\empty \gl@loopmorefalse \fi \repeat \setbox0\vtop{% \ling@everyglword - \halign{\glwordalign{##}\cr \the\gltoks@sofar}}% + \halign{\glwordalign{##}\cr \the\gltoks@sofar }}% \box0 \endgroup } @@ -1134,8 +1229,8 @@ \fi } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\def\gln@begingl{\gln@begingl@a} -\def\gln@begingl@a{% +\def\gl@nlevel@below@begin{\gl@nlevel@below@begin@a} +\def\gl@nlevel@below@begin@a{% \bgroup \parindent0pt \bgroup @@ -1148,19 +1243,33 @@ \hsize=\ling@glwidth \leftskip=0pt \fi - \futurelet\temp\gln@begingl@b + \futurelet\tempt\gl@nlevel@below@begin@b } -\def\gln@begingl@b{% - \ifx\temp\glpreamble \let\next=\relax +\def\gl@nlevel@below@begin@b{% + \ifx\tempt\glpreamble \let\next=\gl@nlevel@below@preamble@c \else \let\next=\gln@ilg \fi \next} -\def\gln@preamble #1\endpreamble{% +\def\gl@nlevel@below@preamble@c #1{\gl@nlevel@below@preamble@d} +\def\gl@nlevel@below@preamble@d #1\endpreamble{% + \bgroup \ling@everyglpreamble #1\strut \vskip\lingbelowglpreambleskip \vskip\lingextraglskip - \egroup\bgroup + \egroup \gln@ilg } +%\def\gl@nlevel@below@begin@b{% +% \ifx\temp\glpreamble \let\next=\relax +% \else \let\next=\gln@ilg \fi \next} +%\def\gl@nlevel@below@preamble #1\endpreamble{% +% \ling@everyglpreamble +% #1\strut +% \vskip\lingbelowglpreambleskip +% \vskip\lingextraglskip +% \egroup +% \bgroup +% \gln@ilg +%} \def\gln@ilg{% \ling@everyglilg \lineskip=\lingextraglskip @@ -1191,8 +1300,8 @@ } \def\nogloss#1{{#1}[]}% \def\gln@ilg@f{\@ifnextchar\@space\gln@ilg@fi\gln@ilg@fii} -\def\gln@ilg@fi #1#2/{\gl@append #2\to\@currentitem \gln@ilg@g} -\def\gln@ilg@fii#1/{\gl@append #1\to\@currentitem \gln@ilg@g} +\def\gln@ilg@fi #1#2/{\gl@xappend #2\to\@currentitem \gln@ilg@g} +\def\gln@ilg@fii#1/{\gl@xappend #1\to\@currentitem \gln@ilg@g} \def\gln@ilg@g{\@ifnextchar\@nil\gln@ilg@h\gln@ilg@f} \def\gln@ilg@h #1{% \gln@printglword @@ -1207,13 +1316,15 @@ \ling@everyglword \gl@loopmoretrue \loop\ifgl@loopmore + \gl@lop\colorlist\to\@linecolor + \ep@mklinecolorop \gl@lop\gln@abovelineskip\to\@aboveskip \ifx\@aboveskip\empty \let\@above=\empty \else \edef\@above{\noalign{\vskip\@aboveskip}}\fi \gl@lopTL\gln@everyline\to\gltoks@every \gl@lopTL\@currentitem\to\gltoks@next \edef\temp{\the\gltoks@sofar \@above - \glstrut \the\gltoks@every \the\gltoks@next \cr}% + \glstrut {\@linecolorop \the\gltoks@every \the\gltoks@next}\cr}% \gltoks@sofar=\expandafter{\temp}% \ifx\@currentitem\empty \gl@loopmorefalse \fi \repeat @@ -1243,7 +1354,7 @@ } \def\ep@diacriticerror#1{% \@expexerror{bad gloss diacritic: #1 (only @ and + permitted)}\end} -\def\gln@ft{% +\def\gl@nlevel@below@ft{% \vskip\lingaboveglftskip \vskip\lingextraglskip \egroup\bgroup @@ -1251,13 +1362,20 @@ \strut \ling@everyglft } -\def\gln@endgl{\par\egroup\egroup\egroup\egroup} +\def\gl@nlevel@below@end{\par\egroup\egroup\egroup\egroup} \define@lingkey{glneveryline}{\ep@setlist\gln@everyline{#1}} \define@lingkey{glnabovelineskip}{\ep@setlist\gln@abovelineskip{#1}% - \gl@lop\gln@abovelineskip\to\temp + \gl@lop\gln@abovelineskip\to\temp % no first line abovelineskip \gl@push{}\to\gln@abovelineskip - } -\def\ep@setlist#1#2{\def#1{}\XKV@for@n{#2}\@this{\gl@eappend\@this\to#1}} +} +% bug fix 4/9/2016 +\def\gl@append #1\to #2{% + \gltoks@a={\\{#1}}% + \gltoks@b=\expandafter{#2}% + \edef#2{\the\gltoks@b\the\gltoks@a}% +} +\def\gl@eappend{\expandafter\gl@append} +% end bug fix \lingset{glneveryline={\it},glnabovelineskip={}} %%%%%%%%%%%%%%%% end nlevel %%%%%%%%%%%%%%%%%%%% @@ -1305,29 +1423,19 @@ \ep@glmkcascade } % ----- side by side (ss) gloss style ----- -\define@choicekey{ling}{glftpos}[\temp\ep@glftpos]% - {below,right}{% - \ifcase\ep@glftpos - \let\gl@beginglstyle\glw@begingl - \let\endgl\glw@endgl - \let\glft=\glw@glft - \or - \let\gl@beginglstyle=\glw@ss@begingl - \let\endgl=\glw@ss@endgl - \let\glft\glw@ss@glft - \fi -} +\def\gl@setprefix{\edef\gl@prefix{gl@\ling@glstyle @\ling@glftpos @}} +\def\glft{\csname \gl@prefix ft\endcsname} +\def\gl@beginglstyle{\csname \gl@prefix begin\endcsname} +\def\endgl{\csname \gl@prefix end\endcsname} +\def\glpreamble{\csname \gl@prefix preamble\endcsname} + +\define@choicekey{ling}{glftpos}[\ling@glftpos\gl@ftpos@num]% + {below,right}{\gl@setprefix} + \define@lingcmdkeys{sssep,ssratio,ssrightskip} \lingset{sssep=2em,ssratio=.6,ssrightskip=0pt plus 2em} \newdimen\ssleftwd \newdimen\ssrightwd -\def\glw@ss@begingl{% - \ep@setssdims - \leavevmode\bgroup\hbox\bgroup - \hsize=\ssleftwd - \lingset{glwidth=\ssleftwd} - \glw@begingl -} \def\ep@setssdims{% \dimen0 =\hsize \advance\dimen0 by -\leftskip @@ -1336,9 +1444,16 @@ \ssrightwd=\dimen0 \advance\ssrightwd by -\ssleftwd } -\def\glw@ss@endgl{\egroup\egroup} -\def\glw@ss@glft #1//{% - \glw@endgl +\def\gl@wrap@right@begin{% + \ep@setssdims + \leavevmode\bgroup\hbox\bgroup + \hsize=\ssleftwd + \lingset{glwidth=\ssleftwd} + \gl@wrap@below@begin +} +\def\gl@wrap@right@end{\egroup\egroup} +\def\gl@wrap@right@ft #1//{% + \gl@wrap@below@end \hskip\lingsssep \vtop{% \leftskip=0pt @@ -1349,21 +1464,50 @@ #1}% \ignorespaces } +\expandafter\def\expandafter\gl@nlevel@right@medial\expandafter + {\gl@nlevel@below@end \gl@nlevel@right@medial@a} +\def\gl@nlevel@right@medial@a{\egroup + \def\gl@prefix{gl@nlevel@right@}% + \hskip\lingsssep + \vtop\bgroup + \leftskip=0pt + \rightskip=\lingssrightskip + \parindent=0pt + \hsize=\ssrightwd + \ling@everyglft +} +\def\gl@nlevel@right@begin{% + \ep@setssdims + \leavevmode + \vtop\bgroup + \hsize=\ssleftwd + \leftskip=0pt + \def\gl@prefix{gl@nlevel@below@} + \let\gl@nlevel@below@ft=\gl@nlevel@right@medial \begingl } + \def\gl@nlevel@right@end{\egroup\egroup} % ----- gloss with a side panel +%2015 added macros for side panel in nlevel style \define@lingcmdkeys{everypanel} \lingset{everypanel={}} \def\beginglpanel{\@getoptionalarg\beginglpanel@a} \def\beginglpanel@a{% \bgroup - \let\endgl=\endgl@panel + \ifcase\gl@style@num + \let\endgl=\gl@wrap@panel@end + \else + \let\endgl=\gl@nlevel@panel@end + \fi + \begin@glpanel@right +} +\def\begin@glpanel@right{% \ling@usearg \ep@setssdims \leavevmode - \lingset{glwidth=\ssleftwd} - \begingl + \lingset{glwidth=\ssleftwd} + \begingl } -\def\endgl@panel{% - \glw@endgl +\def\gl@wrap@panel@end{% + \gl@wrap@below@end \hfill \vtop\bgroup \hsize=\ssrightwd @@ -1371,16 +1515,28 @@ \rightskip=\lingssrightskip \lingeverypanel } +\def\gl@nlevel@panel@end{% + \gl@nlevel@below@end + \hfill + \vtop\bgroup + \hsize=\ssrightwd + \leftskip=0pt + \rightskip=\lingssrightskip + \lingeverypanel +}% \def\endpanel{\egroup\egroup\par} % ----- underfixes ----- +% removed 11/4/2015 +% put back temporarily 3/9/2017 (still needed in manual) \def\gluf/#1/#2/{% \vtop{\offinterlineskip\halign{\hfil##\hfil\cr \strut #1\cr \noalign{\vskip-\ling@glufcloseup} \ling@everygluf \strut#2\cr }}} +% ---------- \define@ling@cmdkeys{everygluf,glufcloseup} -%\lingset{glufcloseup=.4ex,everygluf=\sc} +\lingset{glufcloseup=.4ex,everygluf=\sc} % ----- gloss comments and citations ----- \def\rightcomment#1{\leavevmode\rlap{% \hbox to\hsize{\hfil \rm #1\hskip\leftskip}}\ignorespaces} @@ -1444,11 +1600,15 @@ glwidth=0pt, glufcloseup=.4ex, everygluf=, -% everybrack=\rm, -% glbracketsep=.15em, glstyle=wrap, extraglskip=.5ex, mincitesep=1.5em, glstruts=true } +%%%%%%%%%%%%%%%% additions to the CTAN file +\def\tspacea{\hskip\lingdima} +\def\tspaceb{\hskip\lingdimb} +\def\tspacec{\hskip\lingdimc} +\lingset{dimb=1.5em,dimc=1.5em} + \resetatcatcode |