[Tex/LaTex] Labeling linguistic examples with language information

cgloss4egb4elinguistics

I'm writing a linguistics paper that uses a large amount of linguistic examples from a wide variety of languages, using the gb4e package. I want to be able to label each example with information about the language it comes from, as I've seen in some texts, sort of like this:

Language (family, citation, etc.)  
   (1) example text  
       glosses
       'translation'

gb4e is great at formatting the examples themselves, but I can't seem to get the label placed where I want it, that is, placed immediately before the example and without an indent. Here's some example code:

\documentclass{article}
\usepackage{gb4e}
\usepackage{lipsum}

\begin{document}
\lipsum[2]

Hungarian (Finn-Ugric, \emph{reference})  
\begin{exe}  
\ex \gll    J\'anos h\'aza\\  
            John house.his\\  
    \glt    `John's house'  
\end{exe}

\lipsum[3]
\end{document}

If the label text is outside the exe environment, it's treated like a regular paragraph, but if I try to put it inside, it gives me an error. How can I make it look the way I want? I've looked at other packages that do numbered examples, but they don't seem to have solutions either, and they also don't have the same functionality as gb4e that I need.

Any help would be greatly appreciated.

Best Answer

If you use Alexis Dimitriadis' version of cgloss4e available here as cgloss.sty you can put language information right aligned with the first line of the example. This is IMO a very nice way to format such information, and quite common in the field.

It is not possible with this solution to put right aligned materials on the same line as the gloss itself, but it is possible (if needed) to put material on the \glt line.

\documentclass{article}
\usepackage{gb4e}
\usepackage{cgloss}
\usepackage{lipsum}

\begin{document}
\lipsum[2]

 
\begin{exe}  
\ex \gll    J\'anos h\'aza\\ 
            John house.his\\ \hfill Hungarian (Finno-Ugric, \emph{reference}) 
    \glt    `John's house'  
\end{exe}

\lipsum[3]
\end{document}

Solution also works with linguex

Another popular package for formatting linguistic examples is the linguex package. Since linguex also uses cgloss4e, the solution given above will also work. Here's the same example using the linguex commands. The order of loading the packages matters: cgloss must be loaded after linguex is loaded.

\documentclass{article}
\usepackage{linguex}
\usepackage{cgloss}
\usepackage{lipsum}

\begin{document}
\lipsum[2]

\exg. 
   J\'anos h\'aza\\ 
   John house.his\\ \hfill Hungarian (Finno-Ugric, \emph{reference}) 
   \glt    `John's house'  

\lipsum[3]
\end{document}

output of code

Related Question