Efficiently glossing your examples with LaTeX

I use the gb4e package to gloss my linguistic examples in LaTeX (actually I use XeLaTeX). But it can become fastidious to type e.g. textsc{pst} each time if you want your glosses to be in small caps, which is the standard way. My first idea to do the job quicker was to define glosses as macros:

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

It works perfectly well, but then I had a better idea: to define not gloss labels but actual morphemes as macros. In the language I work on there is a past suffix –tar–, so I defined the following command:

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

For example the following 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 something like:

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

There are several advantages with this technique:

  • you don’t have to remember the label you’ve chosen for a particular morpheme;
  • you can easily change the label for a morpheme, e.g. if you decide that your “past” suffix actually marks the perfective aspect, you just need to modify the macro and all your examples will instantaneously reflect the change;
  • the list of abbreviations is easily done since all your glosses are already listed as macros, you just need to copy-paste the command list; no more forgotten abbreviations.

The only flaw in this technique is that you have to enclose words in curly brackets in your exemples (e.g. {eat-\tar}) otherwise the glosses won’t align properly

This entry was posted in LaTeX and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>