texlive[44139] Master/texmf-dist: expex (1may17)
commits+karl at tug.org
commits+karl at tug.org
Mon May 1 23:52:49 CEST 2017
Revision: 44139
http://tug.org/svn/texlive?view=revision&revision=44139
Author: karl
Date: 2017-05-01 23:52:48 +0200 (Mon, 01 May 2017)
Log Message:
-----------
expex (1may17)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/generic/expex/README
trunk/Master/texmf-dist/tex/generic/expex/expex.sty
trunk/Master/texmf-dist/tex/generic/expex/expex.tex
Modified: trunk/Master/texmf-dist/doc/generic/expex/README
===================================================================
--- trunk/Master/texmf-dist/doc/generic/expex/README 2017-05-01 19:44:54 UTC (rev 44138)
+++ trunk/Master/texmf-dist/doc/generic/expex/README 2017-05-01 21:52:48 UTC (rev 44139)
@@ -1,5 +1,5 @@
-ExPex Mar 2014
+ExPex May 2017
-------------------------------------------------------------
ExPex is maintained by John Frampton <j.frampton at neu.edu>
@@ -11,7 +11,7 @@
-------------------------------------------------------------
-COPYRIGHT 2006-2014 by John Frampton <j.frampton at neu.edu>
+COPYRIGHT 2006-2017 by John Frampton <j.frampton at neu.edu>
This program can be redistributed and/or modified under the terms
of the LaTeX Project Public License, which can be found in the CTAN
@@ -19,7 +19,7 @@
-------------------------------------------------------------
-The files in this distribution (v 5.0b) are:
+The files in this distribution (v 5.1a) are:
README
expex.tex Main macro file
@@ -45,21 +45,6 @@
expex.sty, all files needed to run expex-demo should be part of any
Tex installation.
--------------------------------------------------------------
-Changes (from Version 5.0):
+John Frampton 1/5/2017
-1. In earlier versions before 5.0, {} empty items on the gla line were
-possible. In 5.0, {{}} was required. This version restores the old
-behavior.
-
-2. In versions before 5.0, glosses were built in a vbox, hence could
-not split between pages. 5.0 made glosses breakable, provided no
-explicit width was specified. 5.0 restores the old behavior but
-introduces a parameter <glossbreaking>. It is set to false in
-expex.tex so that the default behavior is the old behavior. But it
-can be set to true if the user wants glosses to break between pages.
-
-
-John Frampton 2014/03/10
-
Modified: trunk/Master/texmf-dist/tex/generic/expex/expex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/expex/expex.sty 2017-05-01 19:44:54 UTC (rev 44138)
+++ trunk/Master/texmf-dist/tex/generic/expex/expex.sty 2017-05-01 21:52:48 UTC (rev 44139)
@@ -1,5 +1,5 @@
-\ProvidesPackage{expex}%
- [2014/03/10 v5.0b LaTex wrapper for expex.tex (JF)]
+\ProvidesPackage{expex}
+ [5/1/2017 v5.1a LaTex wrapper for expex.tex (JF)]
\RequirePackage{xkeyval}
\input expex
\endinput
Modified: trunk/Master/texmf-dist/tex/generic/expex/expex.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/expex/expex.tex 2017-05-01 19:44:54 UTC (rev 44138)
+++ trunk/Master/texmf-dist/tex/generic/expex/expex.tex 2017-05-01 21:52:48 UTC (rev 44139)
@@ -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 at 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 at page
% 2013/07/27
\g at addto@macro\cl@@ckpt
@@ -104,11 +128,12 @@
\def\define at linginckey#1#2{%
\define at key{ling}{#2}{%
\ep at expandafterafter\@setinckey
- #1\csname ling#2\endcsname ##1\@nil}%
+ #1\csname ling#2\endcsname ##1\@nil\relax}% test \relax %%%%%%%%%%%%%%%%%%%%%%%
}
-\def\define at lingincdimenkeys#1{\XKV at for@n{#1}\@key{%
+\let\XKVforn=\XKV at for@n % added 2016/04/23 for easy use
+\def\define at lingincdimenkeys#1{\XKVforn{#1}\@key{%
\expandafter\define at linginckey\expandafter\dimen\expandafter{\@key}}}
-\def\define at lingincskipkeys#1{\XKV at for@n{#1}\@key{%
+\def\define at lingincskipkeys#1{\XKVforn{#1}\@key{%
\expandafter\define at linginckey\expandafter\skip\expandafter{\@key}}}
\def\@setinckey#1#2#3#4\@nil{%
\ifx#3!%
@@ -216,6 +241,8 @@
\let\stepexcnt=\ep at globalstepexcnt
\def\keepexcntlocal{\let\stepexcnt=\ep at localstepexcnt}
\def\ex at setup{% also used by \pex
+%% TENTATIVE, insert \par
+% \par
\global\@specialexnofalse
\latex at tagex
\lingEveryex
@@ -340,19 +367,41 @@
\leavevmode
\next
}
+\def\ep at setdimensions{% \epd at numright=\wd\numbox \epd at labelleft=\linglabeloffset
+ \epd at numright=\wd\numbox
+ \epd at labelleft=\linglabeloffset
+ \advance\epd at labelleft by
+ \ifcase\ep at labelanchor
+ \epd at numright
+ \or
+ \lingnumoffset
+ \or
+ 0pt
+ \fi
+ \ep at settosum\epd at labelright\epd at labelleft\linglabelwidth
+ \ifcase\ep at textanchor % numleft
+ \ep at settosum\epd at textleft\lingnumoffset\lingtextoffset
+ \or % normal
+ \ep at settosum\epd at textleft\epd at labelright\lingtextoffset
+ \fi
+}
\def\ep at setdimensions{%
\epd at numright=\wd\numbox
\epd at labelleft=\linglabeloffset
- \advance\epd at labelleft by \ifcase\ep at labelanchor
- \epd at numright\or \lingnumoffset\or 0pt \fi
-% \ep at setdimlabelleft
+ \advance\epd at labelleft by
+ \ifcase\ep at labelanchor
+ \epd at numright
+ \or
+ \lingnumoffset
+ \or
+ 0pt
+ \fi
\ep at settosum\epd at labelright\epd at labelleft\linglabelwidth
- \ifcase\ep at textanchor % numleft
+ \ifcase\ep at textanchor % numleft
\ep at settosum\epd at textleft\lingnumoffset\lingtextoffset
\or % normal
\ep at settosum\epd at textleft\epd at labelright\lingtextoffset
\fi
-% \ep at setdimtextleft
}
%\def\lingnumrightoffset{\the\epd at numright}%
\def\ep at setdimpreambleleft{%
@@ -361,8 +410,7 @@
\epd at numright\or \epd at labelleft\or \epd at textleft \fi
}
\def\ep at pexcntinit{\ifnum\ep at labelgen=2\else
- \pexcnt=\ling at pexcnt
- \advance\pexcnt by -1 \fi}
+ \pexcnt=\ling at pexcnt \fi}
\define at key[epx@]{labels}{tag}{\def\@optionaltag{#1}}
\define at key[epx@]{labels}{label}{\def\@specialexno{#1}}
\def\ep at setlabelkeys{\setkeys[epx@]{labels}}
@@ -386,19 +434,22 @@
\def\@specialexno{}\def\@optionaltag{}%
\@getoptionalarg\ep at putlabel@a
}
+% 03/14/2014 changed defs to edefs below
\def\ep at putlabel@a{%
\ep at useoptionallabelarg
\ifx\@specialexno\empty
\ifcase\ep at labelgen
- \def\ep at label{\the\ep at everylabel \char\the\pexcnt}%
+ \edef\ep at label{\the\ep at everylabel \char\the\pexcnt}%
+% \edef\ep at label{\the\ep at everylabel \char\noexpand\the\pexcnt}%
\advance\pexcnt by 1
\or
- \def\ep at label{\the\ep at everylabel \number\pexcnt}%
+ \edef\ep at label{\the\ep at everylabel \number\pexcnt}%
+% \edef\ep at label{\the\ep at everylabel \number\noexpand\pexcnt}%
\advance\pexcnt by 1
\or
\ep at popLL
\or
- \def\ep at label{\the\ep at everylabel \romannumeral\pexcnt}%
+ \edef\ep at label{\the\ep at everylabel \romannumeral\noexpand\pexcnt}%
\advance\pexcnt by 1
\fi
\else
@@ -423,6 +474,12 @@
\define at choicekey{ling}{labelanchor}[\scratch\ep at labelanchor]%
{numright,numleft,margin}[]{}
\define at lingkey{pexcnt}{\edef\ling at 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 at labelgen
\def\ep at label{\the\ep at everylabel \char\the\pexcnt}%
\or
- \def\ep at label{\the\ep at everylabel \number\pexcnt}
+ \def\ep at label{\the\ep at everylabel \number\pexcnt}%
\or
\or
- \def\ep at label{\the\ep at everylabel \romannumeral\pexcnt}
+ \def\ep at label{\the\ep at everylabel \romannumeral\pexcnt}%
\fi
\ling at usearg
\dimen0=\lingtextoffset
@@ -463,11 +520,12 @@
}
\def\ep at inserttabellabel{\@getoptionaltag\ep at inserttablelabel@a}
\def\ep at inserttablelabel@a{%
- \global\advance\pexcnt by 1
+% \global\advance\pexcnt by 1
\ifx\@optionaltag\empty \else
\deftaglabel{\@optionaltag}%
\fi
\edef\foop{\ep at label.}\foop
+ \global\advance\pexcnt by 1
}
\def\ep at 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 at thertagsfalse
\newwrite\ling at tagsfile
\def\write at tags{\write\ling at tagsfile}
-\def\tagfilesuffix#1{\edef\@tagfilesuffix{#1}}
-\def\@tagfilesuffix{-tags}
\def\gathertags{%
\@setupreadtags
\@g at thertagstrue
- \immediate\openout\ling at tagsfile=\jobname\@tagfilesuffix\relax
+ \immediate\openout\ling at tagsfile=\jobname-tags\relax
\immediate\write at tags{\noexpand\relax}%
}
%------ reading the tag file and defining the tags it encodes -----
@@ -625,10 +683,10 @@
\def\@setupreadtags{\if at readtags
\do at readtags \global\@readtagsfalse \fi}
\def\do at readtags{%
- \immediate\openin\ling at tagsin=\jobname\@tagfilesuffix\relax
+ \immediate\openin\ling at tagsin=\jobname-tags\relax
\ifeof\ling at tagsin \else
\closein\ling at tagsin
- {\catcode`@=11 \input \jobname\@tagfilesuffix\relax}%
+ {\catcode`@=11 \input \jobname-tags\relax}%
\fi
}
%!
@@ -706,26 +764,28 @@
\def\chooseref at a#1#2{#2}
\def\chooseref at g#1#2{#1}
% ----- glosses -----
-\define at choicekey{ling}{glstyle}[\ling at glstyle\gl at stylenum]{wrap,nlevel}{%
- \ifcase\gl at stylenum
- \let\gl at beginglstyle\glw at begingl
- \let\endgl\glw at endgl
- \glw at assignlevels
- \let\glpreamble=\glw at preamble
- \let\glft=\glw at glft
- \else
- \let\gl at beginglstyle\gln at begingl
- \let\endgl\gln at endgl
- \let\glpreamble=\gln at preamble
- \let\glft=\gln at ft
- \fi
+\def\ling at glstyle{wrap}
+\def\ling at glftpos{below}
+\define at choicekey{ling}{glstyle}[\ling at glstyle\gl at style@num]{wrap,nlevel}{%
+ \ifnum\gl at style@num=0 \glw at assignlevels \fi
+ \gl at setprefix
}
\def\begingl{\bgroup\@getoptionalarg\gl at begingl}
+% bug fix 2105/10/27 eliminate stray space
+%\def\gl at begingl{%
+% \ling at usearg
+% \ling at everygl
+% \gl at beginglstyle@a
+%}
\def\gl at begingl{%
+ \let\everylist=\empty
\ling at usearg
\ling at everygl
- \gl at beginglstyle
+ \gl at beginglstyle@a
}
+\def\gl at beginglstyle@a{\@ifnextchar\@space\gl at beginglstyle@b\gl at beginglstyle}
+\def\gl at beginglstyle@b #1{\gl at beginglstyle}
+% end bug fix
% parameters which are used in both gloss styles
\define at ling@cmdkeys{everygl,everyglpreamble,everyglilg, everyglft,
everyglword,glrightskip,glhangindent,glwidth}
@@ -757,7 +817,7 @@
\gltoks at b=\expandafter{#2}%
\edef#2{\the\gltoks at a\the\gltoks at b}%
}
-\def\gl at append #1\to #2{%
+\def\gl at xappend #1\to #2{% renamed from \gl at append
\gltoks at a={\\{#1}}%
\gltoks at b=\expandafter{#2}%
\xdef#2{\the\gltoks at b\the\gltoks at a}%
@@ -765,7 +825,7 @@
\def\gl at lop#1\to#2{\ifx#1\empty
\let#2\empty \else\expandafter\gl at lopoff#1\gl at lopoff#1#2\fi}
\long\def\gl at lopoff\\#1#2\gl at lopoff#3#4{\def#4{#1}\def#3{#2}}
-\def\gl at eappend{\expandafter\gl at append}
+\def\gl at exappend{\expandafter\gl at xappend} % renamed from \gl at eappend
\newif\ifgl at loopmore
\def\gl at lopTL#1\to#2{%
\ifx#1\empty #2={}\else
@@ -772,7 +832,7 @@
\expandafter\gl at lopoffTL#1\gl at lopoffTL#1#2\fi}
\long\def\gl at lopoffTL\\#1#2\gl at lopoffTL#3#4{#4={#1}\def#3{#2}}
%%%%%%%%%%%%%%%%%%%% wrap style glosses %%%%%%%%%%%%%%%%%%%%
-% \glw at begingl sets up the environment
+% \gl at wrap@below at 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 at boolkey{ling}[ling@]{glossbreaking}{}
-\lingset{glossbreaking=false}
-\def\glw at begingl{\glw at begingl@a}
-\def\glw at begingl@a{%
+% introduced "glbreaking" boolean parameter
+\define at boolkey{ling}[ling@]{glbreaking}[true]{}
+\lingset{glbreaking=false}
+\def\ep at setlist#1#2{\def#1{}\XKVforn{#2}\@this{\gl at eappend\@this\to#1}}
+% 2016/04/18 support for LaTex color and xcolor packages
+\define at ling@cmdkeys{glacolor}
+\define at lingkey{glnlinecolors}{\ep at setlist\colorlist{#1}}
+\lingset{glnlinecolors={},glacolor=}
+% various modifications of gloss building macros which follow were made
+% to make use of these parameters
+\def\gl at wrap@below at begin{\gl at wrap@below at begin@a}
+\def\gl at wrap@below at begin@a{%
\bgroup
\parindent0pt
\ep at setglstrut
\ifdim\ling at glwidth=0pt
- \ifling at glossbreaking
+ \ifling at glbreaking
\bgroup
\else
\vtop\bgroup
@@ -809,6 +876,7 @@
\hsize=\ling at 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 at wordfalse
\@itemtype=0
- \gl at append \\{\glstrut}\to\mainlist
- \gl at eappend 0\to\itemtypelist
+ \gl at xappend \\{\glstrut}\to\mainlist
+ \gl at exappend 0\to\itemtypelist
\else
\@setitemtype #1\@nil
- \ifnum\@itemtype=0 \gl at append \\{\glstrut #1}\to\mainlist
- \else \ifnum\@itemtype=5 \gl at eappend\@itembody\to\mainlist
- \else \gl at append \\{}\to\mainlist
+ \ifnum\@itemtype=0 \gl at xappend \\{\glstrut #1}\to\mainlist
+ \else \ifnum\@itemtype=5 \gl at exappend\@itembody\to\mainlist
+ \else \gl at xappend \\{}\to\mainlist
\fi\fi
- \gl at eappend \the\@itemtype \to\itemtypelist
+ \gl at exappend \the\@itemtype \to\itemtypelist
\fi
\ifglw at word
\setbox0=\hbox{\ling at everygla #1}%
\ifdim\glw at maxht<\ht0 \glw at maxht=\ht0 \fi
\ifdim\glw at maxdp<\dp0 \glw at maxdp=\dp0 \fi
- \fi
+ \fi
\glw at gla@b
}
\newdimen\gl at maxdplast
\def\glw at updatelists{%
+ \edef\temp{\csname ling at gl\gl at linelabel color\endcsname}%
+ \gl at exappend\temp \to\colorlist
\edef\temp{\csname lingabovegl\gl at linelabel skip\endcsname}%
- \gl at eappend\temp \to\aboveskiplist
+ \gl at exappend\temp \to\aboveskiplist
\edef\temp{\vrule width0pt height\the\glw at maxht\space depth\the\glw at maxdp\space }%
\global\gl at maxdplast=\glw at maxdp
- \gl at eappend\temp\to\strutlist
+ \gl at exappend\temp\to\strutlist
\expandafter\expandafter\expandafter
- \gl at append\csname ling at everygl\gl at linelabel\endcsname
+ \gl at xappend\csname ling at everygl\gl at linelabel\endcsname
\to\everylist
\gltoks at a=\expandafter{\everylist}%
}
\def\glw at assignlevels{%
- \expandafter\XKV at for@n\expandafter{\glw at levels}\levelname
+ \expandafter\XKVforn\expandafter{\glw at levels}\levelname
{\glw at assign@level\levelname}%
}
\def\glw at assign@level#1{%
- \edef\temp{\noexpand\let
- \expandafter\noexpand\csname gl#1\endcsname
- \expandafter\noexpand\csname glw at 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 at gl#1\endcsname}\fi
\temp
}
-% \glw at gla and \glw at glft get their definitions directly
+% \glw at gla and \gl at wrap@below at ft get their definitions directly
% \glw at gl<name> gets defined via \defineglwlevels, which adds <name> to the
% list \glw at levels of defined glw levels
\def\glw at levels{a,ft}
\def\define at glw@level#1{%
\expandafter\ifx\csname glw at gl#1\endcsname\relax
+ \define at ling@cmdkeys{gl#1color}%
\define at ling@cmdkeys{everygl#1}%
\define at linginckey\skip{abovegl#1skip}%
\XKV at addtolist@o\glw at levels{#1}%
- \lingset{everygl#1=,abovegl#1skip=0pt}
+ \lingset{everygl#1=,abovegl#1skip=0pt,gl#1color=}
\expandafter\def\csname glw at gl#1\endcsname{\glw at glx{#1}}%
- \ifx\gl at stylenum\undefined \else
- \ifnum\gl at stylenum=0 \glw at assign@level{#1}\fi\fi
+ \ifx\gl at style@num\undefined \else
+ \ifnum\gl at style@num=0 \glw at assign@level{#1}\fi\fi
\else
\@expexwarn{Level #1 is already defined}
\fi
}
-\def\defineglwlevels#1{\XKV at for@n{#1}\thislevel
+\def\defineglwlevels#1{\XKVforn{#1}\thislevel
{\expandafter\define at glw@level\expandafter{\thislevel}}%
}
\def\glw at glx#1{% x suggests any label (as argument to \glw at glx)
@@ -941,6 +1015,7 @@
\def\gl at linelabel{#1}%
\@getoptionalarg\glw at glx@a
}
+
\def\glw at glx@a #1// {\bgroup
\ling at usearg
\expandafter\let\expandafter\@every
@@ -962,12 +1037,12 @@
\gl at lop\blist\to\currb
\ifnum\@itemtype=0
\gl at lop\alist\to\curra
- \gl at eappend\curra\to\currb
- \gl at eappend\currb\to\clist
+ \gl at exappend\curra\to\currb
+ \gl at exappend\currb\to\clist
\else \ifnum\@itemtype=5
- \gl at eappend\currb\to\clist
+ \gl at exappend\currb\to\clist
\else
- \gl at append\\{}\to\clist
+ \gl at xappend\\{}\to\clist
\fi\fi
\repeat
\global\let#2=\clist
@@ -976,19 +1051,20 @@
\setbox0=\hbox{\@every #1}%
\ifdim\glw at maxht<\ht0 \glw at maxht=\ht0 \fi
\ifdim\glw at maxdp<\dp0 \glw at maxdp=\dp0 \fi
- \gl at append {\glstrut #1}\to\worklist
+ \gl at xappend {\glstrut #1}\to\worklist
\glw at glx@b
}
\defineglwlevels{b,c}
\newif\ifglw at spacebefore
-\long\def\glw at preamble #1// {%
+\long\def\gl at wrap@below at preamble #1// {%
\@glpreambletrue
- {\hangindent=0pt \hangafter=0 \ling at everyglpreamble #1\strut
+ {\hangindent=0pt \hangafter=0
+ \leavevmode\ling at everyglpreamble #1\strut
\par
\vskip\lingbelowglpreambleskip }%
}
-\def\glw at glft{\@getoptionalarg\glw at glft@a}
-\long\def\glw at glft@a #1//{%
+\def\gl at wrap@below at ft{\@getoptionalarg\gl at wrap@below at ft@a}
+\long\def\gl at wrap@below at ft@a #1//{%
\glw at printilgsetup
\glw at printilg@a
\vskip\lingaboveglftskip
@@ -1003,7 +1079,7 @@
\ling at everyglft
\strut #1\par
}
-\def\glw at endgl{%
+\def\gl at wrap@below at end{%
\if at glft \else \glw at printilg\egroup \fi
\egroup\egroup\egroup
}
@@ -1013,7 +1089,9 @@
\rightskip=\ling at 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 at glpreamble \@ilgborderadjustment \fi
\ifcase\ep at glhangstyle
@@ -1095,11 +1173,27 @@
\newtoks\gltoks at every
\newtoks\gltoks at next
\newbox\debug at glword
+\def\ep at mklinecolorop{%
+ \ifx\@linecolor\empty \let\@linecolorop=\empty
+ \else \ep at mklinecolorop@a \fi}
+\def\ep at mklinecolorop@a{%
+ \edef\@linecolorop{\noexpand\noexpand\noexpand\color{\@linecolor}}%
+}
+\def\pstglcolors{%
+ \def\ep at mklinecolorop@a{%
+ \edef\@@linecolor{\noexpand\csname\@linecolor\noexpand\endcsname}%
+ \edef\@@@linecolor{\ep at expandtwice\@@linecolor}%
+ \edef\@linecolorop{\expandafter\noexpand
+ \expandafter\noexpand\expandafter\noexpand\@@@linecolor}%
+ }%
+}
\def\glw at printglword{%
\begingroup
\gltoks at sofar={}%
\gl at loopmoretrue
\loop\ifgl at loopmore
+ \gl at lop\colorlist\to\@linecolor
+ \ep at mklinecolorop
\gl at lop\aboveskiplist\to\@aboveskip
\expandafter\ifdim\@aboveskip=0pt \def\@above{}\else
\edef\@above{\noalign{\vskip\@aboveskip}}\fi
@@ -1106,13 +1200,14 @@
\gl at lop\strutlist\to\@strut
\gl at lopTL\everylist\to\gltoks at every
\gl at lopTL\@currentitem\to\gltoks at next
- \edef\temp{\the\gltoks at sofar \@above\@strut\the\gltoks at every\the\gltoks at next \cr}%
+ \edef\temp{\the\gltoks at sofar \@above\@strut
+ {\@linecolorop\the\gltoks at every \the\gltoks at next}\cr}%
\gltoks at sofar=\expandafter{\temp}%
\ifx\@currentitem\empty \gl at loopmorefalse \fi
\repeat
\setbox0\vtop{%
\ling at everyglword
- \halign{\glwordalign{##}\cr \the\gltoks at sofar}}%
+ \halign{\glwordalign{##}\cr \the\gltoks at sofar }}%
\box0
\endgroup
}
@@ -1134,8 +1229,8 @@
\fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\def\gln at begingl{\gln at begingl@a}
-\def\gln at begingl@a{%
+\def\gl at nlevel@below at begin{\gl at nlevel@below at begin@a}
+\def\gl at nlevel@below at begin@a{%
\bgroup
\parindent0pt
\bgroup
@@ -1148,19 +1243,33 @@
\hsize=\ling at glwidth
\leftskip=0pt
\fi
- \futurelet\temp\gln at begingl@b
+ \futurelet\tempt\gl at nlevel@below at begin@b
}
-\def\gln at begingl@b{%
- \ifx\temp\glpreamble \let\next=\relax
+\def\gl at nlevel@below at begin@b{%
+ \ifx\tempt\glpreamble \let\next=\gl at nlevel@below at preamble@c
\else \let\next=\gln at ilg \fi \next}
-\def\gln at preamble #1\endpreamble{%
+\def\gl at nlevel@below at preamble@c #1{\gl at nlevel@below at preamble@d}
+\def\gl at nlevel@below at preamble@d #1\endpreamble{%
+ \bgroup
\ling at everyglpreamble
#1\strut
\vskip\lingbelowglpreambleskip
\vskip\lingextraglskip
- \egroup\bgroup
+ \egroup
\gln at ilg
}
+%\def\gl at nlevel@below at begin@b{%
+% \ifx\temp\glpreamble \let\next=\relax
+% \else \let\next=\gln at ilg \fi \next}
+%\def\gl at nlevel@below at preamble #1\endpreamble{%
+% \ling at everyglpreamble
+% #1\strut
+% \vskip\lingbelowglpreambleskip
+% \vskip\lingextraglskip
+% \egroup
+% \bgroup
+% \gln at ilg
+%}
\def\gln at ilg{%
\ling at everyglilg
\lineskip=\lingextraglskip
@@ -1191,8 +1300,8 @@
}
\def\nogloss#1{{#1}[]}%
\def\gln at ilg@f{\@ifnextchar\@space\gln at ilg@fi\gln at ilg@fii}
-\def\gln at ilg@fi #1#2/{\gl at append #2\to\@currentitem \gln at ilg@g}
-\def\gln at ilg@fii#1/{\gl at append #1\to\@currentitem \gln at ilg@g}
+\def\gln at ilg@fi #1#2/{\gl at xappend #2\to\@currentitem \gln at ilg@g}
+\def\gln at ilg@fii#1/{\gl at xappend #1\to\@currentitem \gln at ilg@g}
\def\gln at ilg@g{\@ifnextchar\@nil\gln at ilg@h\gln at ilg@f}
\def\gln at ilg@h #1{%
\gln at printglword
@@ -1207,6 +1316,8 @@
\ling at everyglword
\gl at loopmoretrue
\loop\ifgl at loopmore
+ \gl at lop\colorlist\to\@linecolor
+ \ep at mklinecolorop
\gl at lop\gln at abovelineskip\to\@aboveskip
\ifx\@aboveskip\empty \let\@above=\empty
\else \edef\@above{\noalign{\vskip\@aboveskip}}\fi
@@ -1213,7 +1324,7 @@
\gl at lopTL\gln at everyline\to\gltoks at every
\gl at lopTL\@currentitem\to\gltoks at next
\edef\temp{\the\gltoks at sofar \@above
- \glstrut \the\gltoks at every \the\gltoks at next \cr}%
+ \glstrut {\@linecolorop \the\gltoks at every \the\gltoks at next}\cr}%
\gltoks at sofar=\expandafter{\temp}%
\ifx\@currentitem\empty \gl at loopmorefalse \fi
\repeat
@@ -1243,7 +1354,7 @@
}
\def\ep at diacriticerror#1{%
\@expexerror{bad gloss diacritic: #1 (only @ and + permitted)}\end}
-\def\gln at ft{%
+\def\gl at nlevel@below at ft{%
\vskip\lingaboveglftskip
\vskip\lingextraglskip
\egroup\bgroup
@@ -1251,13 +1362,20 @@
\strut
\ling at everyglft
}
-\def\gln at endgl{\par\egroup\egroup\egroup\egroup}
+\def\gl at nlevel@below at end{\par\egroup\egroup\egroup\egroup}
\define at lingkey{glneveryline}{\ep at setlist\gln at everyline{#1}}
\define at lingkey{glnabovelineskip}{\ep at setlist\gln at abovelineskip{#1}%
- \gl at lop\gln at abovelineskip\to\temp
+ \gl at lop\gln at abovelineskip\to\temp % no first line abovelineskip
\gl at push{}\to\gln at abovelineskip
- }
-\def\ep at setlist#1#2{\def#1{}\XKV at for@n{#2}\@this{\gl at eappend\@this\to#1}}
+}
+% bug fix 4/9/2016
+\def\gl at append #1\to #2{%
+ \gltoks at a={\\{#1}}%
+ \gltoks at b=\expandafter{#2}%
+ \edef#2{\the\gltoks at b\the\gltoks at a}%
+}
+\def\gl at eappend{\expandafter\gl at append}
+% end bug fix
\lingset{glneveryline={\it},glnabovelineskip={}}
%%%%%%%%%%%%%%%% end nlevel %%%%%%%%%%%%%%%%%%%%
@@ -1305,29 +1423,19 @@
\ep at glmkcascade
}
% ----- side by side (ss) gloss style -----
-\define at choicekey{ling}{glftpos}[\temp\ep at glftpos]%
- {below,right}{%
- \ifcase\ep at glftpos
- \let\gl at beginglstyle\glw at begingl
- \let\endgl\glw at endgl
- \let\glft=\glw at glft
- \or
- \let\gl at beginglstyle=\glw at ss@begingl
- \let\endgl=\glw at ss@endgl
- \let\glft\glw at ss@glft
- \fi
-}
+\def\gl at setprefix{\edef\gl at prefix{gl@\ling at glstyle @\ling at glftpos @}}
+\def\glft{\csname \gl at prefix ft\endcsname}
+\def\gl at beginglstyle{\csname \gl at prefix begin\endcsname}
+\def\endgl{\csname \gl at prefix end\endcsname}
+\def\glpreamble{\csname \gl at prefix preamble\endcsname}
+
+\define at choicekey{ling}{glftpos}[\ling at glftpos\gl at ftpos@num]%
+ {below,right}{\gl at setprefix}
+
\define at lingcmdkeys{sssep,ssratio,ssrightskip}
\lingset{sssep=2em,ssratio=.6,ssrightskip=0pt plus 2em}
\newdimen\ssleftwd
\newdimen\ssrightwd
-\def\glw at ss@begingl{%
- \ep at setssdims
- \leavevmode\bgroup\hbox\bgroup
- \hsize=\ssleftwd
- \lingset{glwidth=\ssleftwd}
- \glw at begingl
-}
\def\ep at setssdims{%
\dimen0 =\hsize
\advance\dimen0 by -\leftskip
@@ -1336,9 +1444,16 @@
\ssrightwd=\dimen0
\advance\ssrightwd by -\ssleftwd
}
-\def\glw at ss@endgl{\egroup\egroup}
-\def\glw at ss@glft #1//{%
- \glw at endgl
+\def\gl at wrap@right at begin{%
+ \ep at setssdims
+ \leavevmode\bgroup\hbox\bgroup
+ \hsize=\ssleftwd
+ \lingset{glwidth=\ssleftwd}
+ \gl at wrap@below at begin
+}
+\def\gl at wrap@right at end{\egroup\egroup}
+\def\gl at wrap@right at ft #1//{%
+ \gl at wrap@below at end
\hskip\lingsssep
\vtop{%
\leftskip=0pt
@@ -1349,21 +1464,50 @@
#1}%
\ignorespaces
}
+\expandafter\def\expandafter\gl at nlevel@right at medial\expandafter
+ {\gl at nlevel@below at end \gl at nlevel@right at medial@a}
+\def\gl at nlevel@right at medial@a{\egroup
+ \def\gl at prefix{gl at nlevel@right@}%
+ \hskip\lingsssep
+ \vtop\bgroup
+ \leftskip=0pt
+ \rightskip=\lingssrightskip
+ \parindent=0pt
+ \hsize=\ssrightwd
+ \ling at everyglft
+}
+\def\gl at nlevel@right at begin{%
+ \ep at setssdims
+ \leavevmode
+ \vtop\bgroup
+ \hsize=\ssleftwd
+ \leftskip=0pt
+ \def\gl at prefix{gl at nlevel@below@}
+ \let\gl at nlevel@below at ft=\gl at nlevel@right at medial \begingl }
+ \def\gl at nlevel@right at end{\egroup\egroup}
% ----- gloss with a side panel
+%2015 added macros for side panel in nlevel style
\define at lingcmdkeys{everypanel}
\lingset{everypanel={}}
\def\beginglpanel{\@getoptionalarg\beginglpanel at a}
\def\beginglpanel at a{%
\bgroup
- \let\endgl=\endgl at panel
+ \ifcase\gl at style@num
+ \let\endgl=\gl at wrap@panel at end
+ \else
+ \let\endgl=\gl at nlevel@panel at end
+ \fi
+ \begin at glpanel@right
+}
+\def\begin at glpanel@right{%
\ling at usearg
\ep at setssdims
\leavevmode
- \lingset{glwidth=\ssleftwd}
- \begingl
+ \lingset{glwidth=\ssleftwd}
+ \begingl
}
-\def\endgl at panel{%
- \glw at endgl
+\def\gl at wrap@panel at end{%
+ \gl at wrap@below at end
\hfill
\vtop\bgroup
\hsize=\ssrightwd
@@ -1371,8 +1515,19 @@
\rightskip=\lingssrightskip
\lingeverypanel
}
+\def\gl at nlevel@panel at end{%
+ \gl at nlevel@below at 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
@@ -1379,8 +1534,9 @@
\noalign{\vskip-\ling at glufcloseup}
\ling at everygluf \strut#2\cr
}}}
+% ----------
\define at 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
More information about the tex-live-commits
mailing list