Posts tagged ‘gb4e’

October 5th, 2009

Efficiently glossing your examples with LaTeX

I use the gb4e package to gloss my lin­guis­tic examples in LaTeX (actually I use XeLa­TeX). But it can become fas­ti­dious to type e.g. \textsc{pst} each time if you want your glosses to be in small caps, which is the stan­dard way. My first idea to do the job qui­cker was to define glosses as macros:

\newcommand{\pst}{\textsc{pst}}

It works per­fectly well, but then I had a bet­ter idea: to define not gloss labels but actual mor­phemes as macros. In the lan­guage I work on there is a past suf­fix –tar–, so I defi­ned the fol­lo­wing command:

\newcommand{\tar}{\textsc{pst}}

For example the fol­lo­wing code

\newcommand{\tar}{\textsc{pst}}
\newcommand{\ripa}{\textsc{circ}}
...
\begin{exe}
\gll iks-tar-ipa \\
{go-\tar-\-ripa} \\
\glt As he went
\end{exe}

would give some­thing like:

iks-tar-ipa
go-PST-CIRC
As he went

There are seve­ral advan­tages with this technique:

  • you don’t have to remem­ber the label you’ve cho­sen for a par­ti­cu­lar morpheme;
  • you can easily change the label for a mor­pheme, e.g. if you decide that your “past” suf­fix actually marks the per­fec­tive aspect, you just need to modify the macro and all your examples will ins­tan­ta­neously reflect the change;
  • the list of abbre­via­tions is easily done since all your glosses are already lis­ted as macros, you just need to copy-paste the com­mand list; no more for­got­ten abbreviations.

The only flaw in this tech­nique is that you have to enclose words in curly bra­ckets in your exemples (e.g. {eat-\tar}) other­wise the glosses won’t align properly

Tags: , ,