From b4c1a1eed2c9c758ec934a2085344fa9e5bcc9d3 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 3 Jul 2010 23:28:13 +0000 Subject: gb4e update (3jul10) git-svn-id: svn://tug.org/texlive/trunk@19216 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/gb4e/gb4e.sty | 46 +++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 14 deletions(-) (limited to 'Master/texmf-dist/tex/latex/gb4e') diff --git a/Master/texmf-dist/tex/latex/gb4e/gb4e.sty b/Master/texmf-dist/tex/latex/gb4e/gb4e.sty index e56f727252d..211d5de59fa 100644 --- a/Master/texmf-dist/tex/latex/gb4e/gb4e.sty +++ b/Master/texmf-dist/tex/latex/gb4e/gb4e.sty @@ -4,7 +4,7 @@ % 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. van der Goot en M. -% Covington. Full documentation soon to come in gb4e-doc.tex. Bug-reports +% Covington. Full documentation 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 @@ -18,14 +18,22 @@ % % 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 +% cgloss(n).sty is loaded early in this file. This feature is known to +% cause some problems with other packages, 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] % CHANGE LOG % +% 2010/7/2 +% - Fixed bug (introduced in previous changes) that discarded spaces +% after sub/superscripts outside math mode. +% +% 2010/01/03 [unreleased] +% - Removed stray \bf +% - Removed leftover old definition of ^, _ +% % 2009/12/28 % - Added README.txt with LPPL license statement. % - Updated sub- and superscripts outside of math mode. They now @@ -87,7 +95,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % For any REALLY old distributions without \rmfamily -\@ifundefined{rmfamily}{\let\rmfamily=\rm} +\@ifundefined{rmfamily}{\let\rmfamily=\rm \let\bfseries=\bf} \@ifundefined{new@fontshape}{\def\reset@font{}\let\mathrm\rmfamily\let\mathit\mit}{} @@ -110,18 +118,13 @@ \def\spec#1{[Spec,#1]} %Def. of "Specifier of #1" \def\ct#1{{\em #1\/}} %Citation of linguistic material with alternative style: %\def\ct#1{`#1'} -\def\tx{\bf} %Introduction of technical terms with alternative style: +\def\tx{\bfseries} %Introduction of technical terms with alternative style: %\def\tx{\em} \input{cgloss\gbVersion.sty} -%%% NEWSTUFF: -\newcommand{\indexgroupmark}[1]{\item{\bf #1}} % ?? -CT +\newcommand{\indexgroupmark}[1]{\item{\bfseries #1}} % ?? -CT -\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 @@ -140,13 +143,28 @@ \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_##1{\gb@ifnextchar^{\automath@two_{##1}}{\ensuremath{\sb{##1}}}}% + \def^##1{\gb@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 } +% The original \@ifnextchar discards spaces when looking for the next +% ``character''. This variant accepts any token. +\long\def\gb@ifnextchar#1#2#3{% + \let\reserved@d=#1% + \def\reserved@a{#2}% + \def\reserved@b{#3}% + \futurelet\@let@token\@gbifnch} +\def\@gbifnch{% + \ifx\@let@token\reserved@d + \let\reserved@c\reserved@a + \else + \let\reserved@c\reserved@b + \fi + \reserved@c} + \automath % On by default, for backward compatibility %%%%%%%%% @@ -181,7 +199,7 @@ \@definecounter{fnx} %%%%% Get examples in footnotes right -% Replaces code in original gb4e.sty: changed 2008/12/28 by Alexis +% Replaces code in original gb4e.sty: changed 2009/12/28 by Alexis % Same function as before, but the old version interacted poorly with % other packages that redefine \@footnotetext. -- cgit v1.2.3