|
There are several packages that allow numbered examples something like the following to be produced:
They typically also provide for `glosses' like the following:
We describe two such packages here:
Both packages are available from "the usual places".But we really should also mention Wolfgang Sternefeld's linguex.sty package, which many people like. It is also available from "the usual places".
There is not much to choose between them as regards example numbering:
^
and_
, but the redefinition gives the wrong
spacing if you use both at once. This becomes really visible if the
first one is long, as in $e^{\mathrm{ref}}_2$
.
^
and_
so that they work outside maths
mode. This sounds like a neat idea, because it means you can put sub- and
super-scripts anywhere you like without needing to shift into maths mode. But
it is a terrible idea. This is because it involves changing the catcode
of these characters (it makes them "active"). But lots of other packages
depend on these characters having their normal catcodes. The effect is that
gb4e has to be loaded last - after every other package.
There are several solutions. The simplest is just to comment out the two lines that look like this in gb4e.sty (around line 98)
\catcode`_=\active \catcode`^=\activeyou won't have superscripts and subscripts in normal text, but you also won't have to worry about loading gb4e last. If you really want sub- and super-scripts in normal text without the hassle of going into maths mode, do something like this (you can't use
\sup
, because TeX already uses that
for something else):
\newcommand{\sub}[1] {\ensuremath{_{\mathit{#1}}}}% e.g. NP\sub{i} \newcommand{\super}[1]{\ensuremath{^{\mathit{#1}}}}% e.g. N\super{2}