1

I am writing my PhD in Linguistics and I have a lot of examples extracted from the data. I'm using gb4e for numbered examples and glossing. A standard example looks like this:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{gb4e}

\begin{document}
\begin{exe} 
\ex
\gll Reece\textsubscript{1}: this is an example \emph{trên} Internet, \\
\hspace{0cm} \hspace{0cm} \hspace{0cm} \hspace{0cm} \hspace{0cm} on \\
\glt \hspace{1cm} ‘This is an example on the internet’ \\
\hspace*{\fill} (SpeakerA.SpeakerB.0906, 0:37.6 - 0:42.8) 
\label{ex:internet}
\end{exe}
\end{document}

However as I have multiple lines from the transcripts and wanted them to line up, I tried to put them in a tabular environment. This seems to work fine for one example, but when I have 2 next to each other, the \hspace line is all messed up and breaks into multiple places. The example number also somehow got moved to the middle, rather than at the beginning of the example as in the standard example above. Could someone familiar with the package help me with:

  1. getting the \hspace line in the right place, and
  2. get the example number back to where it should be (as in the standard example)?
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{gb4e}

\begin{document}
\begin{exe} 
\ex
\begin{tabular}{l l}
   John\textsubscript{2}:  & $\emptyset$ you want to go to the zoo or Questacon? \\
                            & zoo see the animals. \\
\end{tabular}
\hspace*{\fill} (John.Mary.0709, 09:20.1 - 9:30.5) 
\label{ex:aux}
\end{exe}

\begin{exe} 
\ex
\begin{tabular}{l l}
   Mary\textsubscript{2}:  & you $\emptyset$ going there for nothing, \\
                            & because he is a man. \\
    Rosie\textsubscript{1}:   & He $\emptyset$ not giving standard.\\

\end{tabular}

\hspace*{\fill} (Mary.Rosie.0102, 2:12.3 - 3:32.1) 
\label{ex:aux4}
\end{exe}
\end{document}
  • I'm not quite clear what you want the output to look like. I also think that you may be trying to get gb4e to do things it's not quite set up to do, but this may be just because I'm not sure what you're doing. Could you post an image of the suggested format you're looking for (perhaps an example from a journal?). – Alan Munn Aug 14 '19 at 1:37
  • For transcribing dialogue with speaker overlap, you might want to look at Interlinear glosses with overlaps, line numbers, and speaker labels. This uses ExPex for glosses, though, and may be more than you need. – Alan Munn Aug 14 '19 at 1:42
  • Thank you for your comments. I want the output to look like the standard example in my original question (the first block of code that I posted). If you run this on LaTeX it will compile into the output I want to get. Sorry I would screenshot a picture, but the comment function doesn't seem to let me upload an image. – teadrinker64 Aug 14 '19 at 2:05
  • I understand what the first example looks like; I don't understand what you're trying to achieve with the tabular. (You can edit your question to show an image.) If it's just the vertical alignment of the tabular with the example number, just use \begin{tabular}[t]{ll}. But the reason I'm asking the more general question is that there may be better ways to achieve the output you want. – Alan Munn Aug 14 '19 at 2:11
  • I put it in the tabular environment just so the all the texts line up perfectly. Without that there is weird spacing going on. – teadrinker64 Aug 14 '19 at 2:14
1

I'm not sure if this is what you want, but since you're not really glossing examples word by word, you can group sets of words together with {...} and this will line them up without needing to use tabular. The gb4e macros allow up to 3 aligned lines out of the box: \gll gives you two lines; \glll gives you three lines. You should not try to line up the \glt line; that's not what it's for. To get more lines you could use the technique shown here: Align glosses in more than one language with gb4e to add an extra line (or more in principle). But if you have more lines, then ExPex might be better at this.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{gb4e}
\newcommand\sub{\textsubscript}

\begin{document}
\begin{exe} 
\ex
\glll {Reece\sub{1}:} {this is an example} {\emph{trên} Internet,} \\
 {} {} on {}\\
 {} {‘This is an example} {on the internet’}\\

\hfill (SpeakerA.SpeakerB.0906, 0:37.6 - 0:42.8) 
\label{ex:internet}
\end{exe}

\begin{exe} 
\ex
\gll John\sub{2}:  {$\emptyset$ you want to go to the zoo or Questacon?} \\
   {} {zoo see the animals.} \\

\hfill(John.Mary.0709, 09:20.1 - 9:30.5) 
\label{ex:aux}
\end{exe}

\begin{exe} 
\ex
\glll
   {Mary\sub{2}:}  {you $\emptyset$ going there for nothing,} \\
        {}           {because he is a man. }\\
    {Rosie\sub{1}:}   {He $\emptyset$ not giving standard.}\\

\hfill (Mary.Rosie.0102, 2:12.3 - 3:32.1) 
\label{ex:aux4}
\end{exe}
\end{document}

output of code

  • Thank you so much. I will also look at ExPex accordingly! – teadrinker64 Aug 14 '19 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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