summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/gb4e
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-12-31 01:29:16 +0000
committerKarl Berry <karl@freefriends.org>2009-12-31 01:29:16 +0000
commitcf62e0a822d36480a91d09794f1abb2892d98303 (patch)
tree6c7bc5ffabca6c372d43ffc43a1e92cc049e0e55 /Master/texmf-dist/tex/latex/gb4e
parent72c3c38a59e5666807c0f2bdbcec365259e98d96 (diff)
gb4e update (29dec09)
git-svn-id: svn://tug.org/texlive/trunk@16540 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/gb4e')
-rw-r--r--Master/texmf-dist/tex/latex/gb4e/cgloss4e.sty13
-rw-r--r--Master/texmf-dist/tex/latex/gb4e/gb4e.sty49
2 files changed, 52 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/latex/gb4e/cgloss4e.sty b/Master/texmf-dist/tex/latex/gb4e/cgloss4e.sty
index eedaf886e00..b066dbd9937 100644
--- a/Master/texmf-dist/tex/latex/gb4e/cgloss4e.sty
+++ b/Master/texmf-dist/tex/latex/gb4e/cgloss4e.sty
@@ -1,6 +1,6 @@
% -*- LaTeX -*-
% Following borrows from Covington's style files inspired by Midnight by M.
-% de Groot, adapted to be used with gb4e.sty: examples beginning with \ex can
+% van der Goot, adapted to be used with gb4e.sty: examples beginning with \ex can
% contain glosses directly. Default is
% Linguistic Inquiry style with all lines in \rm; to change a line (eg. to
% \it for a particular journal, change the appropriate line: e.g.,
@@ -86,9 +86,12 @@
%\glossglue = 5pt plus 2pt minus 1pt % allow stretch/shrink between words
\newif\ifnotdone
-\@ifundefined{eachwordone}{\let\eachwordone=\rm}{\relax}
-\@ifundefined{eachwordtwo}{\let\eachwordtwo=\rm}{\relax}
-\@ifundefined{eachwordthree}{\let\eachwordthree=\rm}{\relax}
+% For any REALLY old distributions without \rmfamily
+\@ifundefined{rmfamily}{\let\rmfamily=\rm}
+
+\@ifundefined{eachwordone}{\let\eachwordone=\rmfamily}{\relax}
+\@ifundefined{eachwordtwo}{\let\eachwordtwo=\rmfamily}{\relax}
+\@ifundefined{eachwordthree}{\let\eachwordthree=\rmfamily}{\relax}
\def\lastword#1#2#3% #1 = \each, #2 = line box, #3 = word box
{\setbox#2=\vbox{\unvbox#2%
@@ -108,7 +111,7 @@
}
\gdef\getwords(#1,#2)#3 #4\\% #1=linebox, #2=\each, #3=1st word, #4=remainder
- {\setbox#1=\vbox{\hbox{#2\strut#3 }% adds space
+ {\setbox#1=\vbox{\hbox{#2{\strut#3} }% adds space
\unvbox#1%
}%
\def\more{#4}%
diff --git a/Master/texmf-dist/tex/latex/gb4e/gb4e.sty b/Master/texmf-dist/tex/latex/gb4e/gb4e.sty
index b212ba00f61..b156829f61a 100644
--- a/Master/texmf-dist/tex/latex/gb4e/gb4e.sty
+++ b/Master/texmf-dist/tex/latex/gb4e/gb4e.sty
@@ -3,10 +3,13 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Version 4export (= v. 4 minus the compatibility code)
% Based on hpk's gb.sty, revised for GM syllabus by ct,
-% and incorporating macros adapted from J.Frampton, M. de Groot en M.
-% Covington. Full documentation soon to come in gb4doc.tex. Bug-reports
+% and incorporating macros adapted from J.Frampton, M. van der Goot en M.
+% Covington. Full documentation soon to come in gb4e-doc.tex. Bug-reports
% and suggestions for improvements, other used features, please!
%
+% The package gb4e may be distributed under the conditions of the LaTeX Project
+% Public License (LPPL). See the README file for more details.
+%
% Notes:
%
% Various styles for X-bar levels; can be changed, but note that {picture}
@@ -16,6 +19,11 @@
% This file allows _ and ^ to be used in ordinary text, hence must be
% loaded AFTER any file that uses them in their TeX meaning. Hence
% cgloss(n).sty is loaded early in this file.
+% This feature is known to cause problems but is maintained for backward
+% compatibility. If you have problems, you can try disabling it by
+% placing the command \noautomath immediately after loading the gb4e package.
+% [Added 2009/12/28]
+%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%
@@ -56,7 +64,7 @@
% \sn[jdgmt]{sentence} (unnumbered example with judgement)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% For my own lazyness (HANDLE WITH CARE---this works only
+% For my own laziness (HANDLE WITH CARE---this works only
% in boringly normal cases.... ):
%
% \ea works like \begin{exe}\ex or \begin{xlist}\ex,
@@ -65,7 +73,10 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\@ifundefined{new@fontshape}{\def\reset@font{}\let\mathrm\rm\let\mathit\mit}{}
+% For any REALLY old distributions without \rmfamily
+\@ifundefined{rmfamily}{\let\rmfamily=\rm}
+
+\@ifundefined{new@fontshape}{\def\reset@font{}\let\mathrm\rmfamily\let\mathit\mit}{}
\let\prmbrs=0
\def\primebars{\let\prmbrs=1}
@@ -94,12 +105,40 @@
%%% NEWSTUFF:
\newcommand{\indexgroupmark}[1]{\item{\bf #1}} % ?? -CT
-% this allows _ to be used in horizontal mode (from J.Frampton):
\catcode`_=\active
\def_#1{\ifmmode\mathit{\sb{#1}}\else${}\sb{#1}$\fi}
\catcode`^=\active
\def^#1{\ifmmode\mathit{\sp{#1}}\else${}\sp{#1}$\fi}
+%%%%%%%%%%% AUTOMATH
+
+% this allows _ to be used in horizontal mode (from J.Frampton):
+% Reimplemented to allow this feature to be turned on and off.
+% The new version also combines sub- and superscripts properly.
+% -Alexis
+
+% \automath Make _ and ^ work outside math mode
+% \noautomath Restore normal sub/superscript behavior
+
+{ % Temporarily change catcodes
+ \catcode`\_=\active
+ \catcode`\^=\active
+
+ \global\def\automath{%
+ \catcode`\_=\active
+ \catcode`\^=\active
+ \def_##1{\@ifnextchar^{\automath@two_{##1}}{\ensuremath{\sb{##1}}}}%
+ \def^##1{\@ifnextchar_{\automath@two^{##1}}{\ensuremath{\sp{##1}}}}}
+}
+\def\automath@two#1#2#3#4{\ensuremath{#1{#2}\relax #3{#4}}}
+% Restore default catcodes for ^, _
+\def\noautomath{\catcode`\_=8 \catcode`\^=7 }
+
+\automath % On by default, for backward compatibility
+
+%%%%%%%%%
+
+
\def\lb#1{\@ifnextchar [{\@glarph{#1}}{\@bl{#1}}}
\def\@glarph#1[#2]{\ifmmode{[}\sb{{\mathrm{#1}}\sb{#2}}\else%
${[}\sb{{\mathrm{#1}}\sb{#2}}$\fi}