I'm writing my PhD thesis on linguistics using gb4e
. In a number of cases I want to add a preamble line to an interlinear example and in some other cases I need a tabbing
environment embedded within the examples (primarily for the counter). In principle this works fine, but gb4e
introduces an unnecessary space before the \gll
line. I've searched all over the internet and found no solution to this. My examples are too numerous to switch to another package such as expex
. I've also tried using cgloss.sty
, but this messes up some of my longer interlinear examples.
Here's a MWE:
\documentclass{scrbook}
\usepackage{gb4e}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{exe}
\ex \gll bloss ein Beispiel\\
just a example\\
\glt \lq Just an example'
\ex Swahili:
\gll m-toto a-na-cheza\\
1-child 1-\textsc{prog}-play\\
\glt \lq A/the child is playing'
\ex Some Swahili verb stems:
\begin{tabbing}
xxxxx\=\kill
\textit{cheza}\>\lq play; dance'\\
\textit{jua}\>\lq know'\\
\textit{fika}\>\lq arrive'
\end{tabbing}
\end{exe}
\lipsum[2]
\end{document}
So what I want is to have a line break without any extra space between "Swahili" and the interlinear example in (2) and between "Some Swahili verb stems" and the following list in (3) respectively. I'll be really thankfull for any help!
Best Answer
1. With
gb4e
,cgloss
, andtabular
I think the simplest way to fix the vertical spacing issue is to load the
cgloss
package and switch to atabular
environment instead oftabbing
.The
cgloss
package is not available on CTAN or in standard distributions; see Alan Munn's answer to Why is the gap between the translation and the last line of the gloss so wide in my interlinear gloss? for information about how to download and install it. You mention that you have tried this but it caused problems for longer examples; perhaps you should ask a separate question about that, or modify your MWE so that we have some of those longer examples to work with.Unless you have a good reason to use
tabbing
, it's much more common to usetabular
.Code
Output
2. With
gb4e
andtabbing
but notcgloss
If you really can't make
cgloss
work and you really want to usetabbing
, here are some hacks to make that work:pream
command gives you your colon and removes some vertical space.cgloss
isn't loaded,gb4e
adds extra space before the\glt
line, so the new\pglt
command removes some vertical space before calling the\glt
command.Code
Output
3. With
expex
User hftf asked in the comments about how to achieve this using other packages. The
expex
package provides an optional\glpreamble
line within gloss environments, as well as a parameterbelowglpreambleskip
for how much vertical space separates this line from the gloss lines (see aboveglftskip in expex linguistic glosses for more about this). The package is very flexible; virtually anything you might want to tweak about example/gloss formatting is easy to do with the key-value options provided.Code
Output
4. With
linguex
Because
linguex
usescgloss4e
underlyingly just asgb4e
does, the fix is very similar togb4e
's. Switching tocgloss
will mean that you can't use the shorthand\exg.
environment provided bylinguex
without using\glt
to introduce the free translation line. As far as I know, there's no way to use\exg.
with a preamble anyway, so it may be simplest to just use\ex.
for every example and bring in\gll
and\glt
when you need glossing.Code
Output