summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-08-16 19:41:08 +0000
committerKarl Berry <karl@freefriends.org>2023-08-16 19:41:08 +0000
commitc871073e4f4ba0d87362a24f70ceb0e71974187d (patch)
treec5f5aa0afe3339aacc0d4f720432aa94f0f6b98d /Master/texmf-dist/tex
parent6cdd8eb4bcdd93931a03d6216427dea334e2cdaf (diff)
expex-glossonly (16aug23)
git-svn-id: svn://tug.org/texlive/trunk@67944 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/expex-glossonly/expex-glossonly.sty97
1 files changed, 97 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/expex-glossonly/expex-glossonly.sty b/Master/texmf-dist/tex/latex/expex-glossonly/expex-glossonly.sty
new file mode 100644
index 00000000000..b33b6b41c06
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/expex-glossonly/expex-glossonly.sty
@@ -0,0 +1,97 @@
+\def\EPGL@version{0.6}
+\def\EPGL@date{2023/08/15}
+% expex-glossonly is a package which allows gb4e and linguex users to use the glossing macros
+% of the ExPex package, while still using the standard example and subexample numbering macros of
+% those respective packages.
+%
+% Copyright 2016 by Alan Munn
+%
+% This package may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This package has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this package is Alan Munn.
+%
+% This package consists of the file expex-glossonly.sty and documentation files
+% expex-glossonly.tex and expex-glossonly.pdf plus two test files: gb4e-expex.tex and linguex-expex.tex
+%
+% This package is currently experimental. Use at your own risk.
+%
+\ProvidesPackage{expex-glossonly}[\EPGL@date\ Compatibility package for using ExPex glosses with gb4e and linguex v. \EPGL@version ]
+\DeclareOption*{\PackageWarning{expex-glossonly}{Unknown option `\CurrentOption`}}
+\ProcessOptions
+\RequirePackage{calc}
+\RequirePackage{expex}
+% First define a command to patch the ExPex main gloss command
+% Need to find out if other gloss commands need to be patched.
+\def\EPGL@patchexpexgloss{%
+ \let\xe\relax
+ \let\pex\relax
+\def\gl@wrap@below@begin@a{%
+ \bgroup
+ \parindent0pt
+ \ep@setglstrut
+ \ifdim\ling@glwidth=0pt
+ \ifling@glbreaking
+ \bgroup
+ \else
+ \vtop\bgroup
+ \advance\hsize by -\leftskip
+ \advance\hsize by -\rightskip
+ %\leftskip=0pt
+ \EPGL@setglossmargin % this is the changed line
+ \fi
+ \else
+ \vtop\bgroup
+ \hsize=\ling@glwidth
+ \leftskip=0pt
+ \fi
+ \leavevmode
+ \bgroup
+ \parindent=0pt
+ \@glpreamblefalse
+ \@glftfalse
+ \let\mainlist=\empty
+ \let\itemtypelist=\empty
+ \let\aboveskiplist=\empty
+ \let\strutlist=\empty
+ \let\everylist=\empty
+ \let\colorlist=\empty
+}}
+% First check to see whether we are loaded first
+% Since there is some overlap in commands, gb4e and linguex must be loaded second
+\@ifpackageloaded{linguex}{\PackageError{expex-glossonly}{Please load expex-glossonly BEFORE linguex}{Please load expex-glossonly BEFORE linguex}}{}
+\@ifpackageloaded{gb4e}{\PackageError{expex-glossonly}{Please load expex-glossonly BEFORE gb4e}{Please load expex-glossonly BEFORE gb4e}}{}
+% Now only patch the command if the packages have been loaded
+% This means that the package will do no harm if loaded by itself
+\AtBeginDocument{%
+\@ifpackageloaded{linguex}{
+ \def\EPGL@setglossmargin{%
+ \ifnum\theExDepth=1%
+ \setlength{\leftskip}{\Exindent+\Exlabelsep+\Exlabelwidth+.5em}
+ \else
+ \setlength{\leftskip}{\Exindent+\Exlabelsep+\Exlabelwidth+\SubExleftmargin+.5em}
+ \fi}
+ \EPGL@patchexpexgloss
+ \PackageInfo{expex-glossonly}{Patching ExPex for use with linguex}
+ \typeout{Patching ExPex for use with linguex}
+}
+{\@ifpackageloaded{gb4e}{
+ \def\EPGL@setglossmargin{%
+ \ifnum\@xnumdepth=1%
+ \setlength{\leftskip}{\leftmargin+\widthof{\@exwidth}+1em}
+ \else
+ \setlength{\leftskip}{\leftmargin+\labelwidth+\labelsep+1.5em}
+ \fi}
+ \EPGL@patchexpexgloss
+ \PackageInfo{expex-glossonly}{Patching ExPex for use with gb4e}
+ \typeout{Patching ExPex for use with gb4e}
+}{}}
+}
+\endinput \ No newline at end of file