The cgloss4e
package, which is loaded by gb4e
is able to account for an example with two lines of glosses automatically, using the \glll
(note the extra l
) macro:
\documentclass{article}
\usepackage{gb4e}
\begin{document}
\begin{exe}
\ex
\glll gef hundinum matinn\\
give {the dog} {the food}\\
gib {dem Hunde} {das Essen}\\
\end{exe}
\end{document}
However, for your example, you require yet one more line of gloss, for which the package is not actually designed. But it's not to hard to add the relevant code. Here I've created a \gliv
command to introduce an example with 3 extra gloss lines.
\documentclass{article}
\usepackage{gb4e}
\makeatletter
\newbox\linefour
\newbox\wordfour
\def\gliv% % Introduces 4-line text-and-gloss.
{\begin{flushleft}
\ifx\@gsingle1%
\vskip\baselineskip\def\baselinestretch{1}%
\@selfnt\vskip-\baselineskip\fi%
\bgroup
\foursent
}
\@ifundefined{eachwordfour}{\let\eachwordfour=\rmfamily}{\relax}
\gdef\foursent#1\\ #2\\ #3\\ #4\\{% #1 = first line, #2 = second line, #3 = third, #4 = fourth
\getwords(\lineone,\eachwordone)#1 \\%
\getwords(\linetwo,\eachwordtwo)#2 \\%
\getwords(\linethree,\eachwordthree)#3 \\%
\getwords(\linefour,\eachwordfour)#4 \\%
\loop\lastword{\eachwordone}{\lineone}{\wordone}%
\lastword{\eachwordtwo}{\linetwo}{\wordtwo}%
\lastword{\eachwordthree}{\linethree}{\wordthree}%
\lastword{\eachwordfour}{\linefour}{\wordfour}%
\global\setbox\gline=\hbox{\unhbox\gline
\hskip\glossglue
\vtop{\box\wordone % vtop was vbox
\nointerlineskip
\box\wordtwo
\nointerlineskip
\box\wordthree
\nointerlineskip
\box\wordfour
}%
}%
\testdone
\ifnotdone
\repeat
\egroup % matches \bgroup in \gloss
\gl@stop}
\makeatother
\begin{document}
\begin{exe}
\ex
\gliv gef hundinum matinn\\
gje hunden maten\\
give {the dog} {the food}\\
gib {dem Hunde} {das Essen}\\
\end{exe}
\end{document}
Alternatively, you can embed ExPex glossed sentences into gb4e
examples by using the expex-glossonly
package loaded with the [gb4e]
option. See this answer for example ExPex glosses.

:)