Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In accordance with the documentation, I've been happily plodding along making interlinear glosses. So far so good! But things get ugly when I make a longer gloss.

Looking at example (5) on page (6) in the documentation here: http://ftp.snt.utwente.nl/pub/software/tex/macros/latex/contrib/gb4e/gb4e-doc.pdf

\begin{exe}
\ex
\gll Wenn jemand in die W\"uste zieht ... \\
If someone in the desert draws and lives ... \\
\trans `if one retreats to the desert and ... '
\end{exe}

I wonder if there's a way to insert a line or indent between the long run-on lines to help make them easier to read and less like a block of text.

Any ideas would be appreciated!

share|improve this question
    
Welcome to TeX.SX! You can mark a code sample by indenting by four spaces. –  mafp May 22 '13 at 15:56
add comment

1 Answer

up vote 3 down vote accepted

A manual solution

The cgloss4e package (which is loaded by both gb4e and linguex to format glossed examples) provides very little customization options for the gloss spacing. If you only have a relatively small set of examples which will need extra formatting, it's possible to do it by splitting up the examples manually. It's not an ideal solution, but it is usable on an occasional basis. Here's an example:

\documentclass{article}
\usepackage{gb4e}
\usepackage{setspace}
\begin{document}
\begin{exe}
\ex[*]{ \gll {a delak }  {a uleker} er ngak el kmo ng-ngerai {a sensei}   {a milskak}\\
mother-my   asked P  me L Comp   CL-what teacher     gave \\}

\sn[]{\gll  {a buk} me   {a Toki} {a ulterur} \emph{e}_{i} er  ngak \\
   book and  Toki  sold {} P me\\
\trans `My mother asked me what the teacher gave me a book and Toki sold me`}
\end{exe}
\end{document}

output of gb4e code Here I've split the example into two parts and used the \sn macro (which is a numberless version of \ex to introduce the second line.

An automatic solution

If you routinely work with complex glossed examples, then you may want to consider switching to the very powerful ExPex package. It provides extensive methods for formatting glossed examples (and examples generally) and is highly customizable. Here is the same example glossed using this package.

\documentclass{article}
\usepackage{expex}
\begin{document}
\lingset{glhangindent=2em} % adjust as necessary

An example with a hanging indent for subsequent gloss lines (default).
\ex
\begingl
\gla{a delak }  {a uleker} er ngak el kmo ng-ngerai {a sensei}   {a milskak}  {a buk} me   {a Toki} {a ulterur} \emph{e}$_{i}$ er  ngak //
\glb mother-my   asked P  me L Comp   CL-what teacher     gave    book and  Toki  sold {} P me //
\glft `My mother asked me what the teacher gave me a book and Toki sold me`//
\endgl
\xe

An example with an explicit break (signified in the first line by ``+'')
\ex
\begingl
\gla{a delak }  {a uleker} er ngak el kmo ng-ngerai {a sensei} +   {a milskak}  {a buk} me   {a Toki} {a ulterur} \emph{e}$_{i}$ er  ngak //
\glb mother-my   asked P  me L Comp   CL-what teacher      gave    book and  Toki  sold {} P me //
\glft `My mother asked me what the teacher gave me a book and Toki sold me`//
\endgl
\xe


\end{document}

In the first example I've used the regular hanging indent to separate subsequent lines of the glosses. In the second example, I've marked an explicit break in the example itself (the gloss then lines up automatically based on that break.)

output of ExPex code

share|improve this answer
    
Thanks this is great! But when I do it the continuation (i.e. the second line) is indented for some reason. Any idea why that is? Thanks again. –  mateuz May 24 '13 at 9:02
    
Here's my example (excuses for ignorance in formatting!!) begin{exe} \ex {\glll Karinani, wali khusa, wali awarintinakani, \\{karina-ni wali khusa wali awarinti-naka-ni \chain-\textsc{att} much good much grain.alcohol-\textsc{pl-att} \\} \sn[]{\glll khusa rispacht`anijwapharakit. \ khusa rispach(a)-t`a-ni-jwa-pha-rak(i)-it(u)\}\ good see.off-\textsc{m-h-bfr-pl-ad-3$>1$sim}\\glt With chains, very good, and plenty of alcohol they saw us off.} \end{exe} –  mateuz May 24 '13 at 9:05
    
The indentation in your second line is because you put [] (which reserves space for the grammaticality judgement; since you don't have the [] in the first line, the second line appears indented. Also, if you use \usepackage[T1]{fontenc} you should be able to use > without using $...$ which will improve the spacing. See Why do the less than symbol (<) and the greater than symbol (>) appear wrong as upside down exclamation (¡) or question mark (¿)? –  Alan Munn May 24 '13 at 10:49
    
You're the best. –  mateuz May 24 '13 at 16:29
    
@mateuz Just a note about how the site works: accepting an answer (which is good thing to do if the answer helped you) is independent from up-voting it, so you might consider doing that too. :) –  Alan Munn May 24 '13 at 16:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.