I am trying to come up with a way to represent linguistic examples of naturally occurring dialog. I have not used LaTeX for linguistic glossing yet so I could need some help what package(s) would be most appropriate to start with.
I have looked at linguex, expex, and gb4e, and expex seems to be the most appropriate for my needs. However, there are a few things that I couldn't figure out even with expex. I'm providing a picture of how it should look in the end.
In my subfield (linguistic anthropology) we use Conversation Analysis conventions to represent naturally occurring dialogue but for non-English languages we also use interlinear glosses. Since I am looking at code-switching I have an extra line where each morpheme is identified by it's language, hence I need more than just two lines for the gloss (which is why my first choice would be expex).
Now, the main questions are: How can I achieve with expex (or some other package or combination of packages) to get (a) line numbers (12, 13, in the picture), (b) labels for each speaker, and then ideally (c) also a way to indent a line in order to represent overlapping speech?
If I could have someone help me achieve (a) and (b) I'd already be happy for a start, as I realize that (c) seems to be fairly complex. I know with just one line I can do it with the Tabbing package but with all the complexity of the interlinear glosses also aligned I have no idea how to start.
I know there is also conan a package specifically designed for Conversation Analysis but I couldn't get it to work for what I'm doing, and I couldn't find any documentation how to modify it (see my comment below).
EDIT: I came across this question, which is essentially the same problem that I have. That person had resolved it by manually inserting hspace for all indented lines, which could work for a few short examples, but (a) it's not precise and (b) it is quite cumbersome when formatting many pages of dialogue.
Anyone with some expertise on expex? ;) Or maybe someone knows a way to modify conan for my needs? Any other suggestions?
EDIT2:
To give an illustration of what I'd like to achieve, here's how far I got (I know this doesn't work, probably because I can't use tabbing and expex together, but it illustrates how I would want it to work, aligning the second utterance with the second half of the word "sentence")
\documentclass{article}
\usepackage{expex}
\begin{document}
\begin{tabbing}
\ex[exno=Speaker A, exnoformat=X]
\begingl
\glpreamble An example test sen\=tence//
\gla An example test sentence//
\glb gl gl gl gl gl//
\glc A B C D E//
\glft Free translation//
\endgl
\xe
\ex[exno=Speaker B, exnoformat=X]
\begingl
\glpreamble \>A second example test sentence//
\gla A second example test sentence//
\glb gl gl gl gl gl//
\glc A B C D E//
\glft Free translation//
\endgl
\xe
\end{tabbing}
\end{document}
I'm not married to expex, it's just the one that I could figure out on my own with the manual how to at least get the basic structure.
Any help very much appreciated!
EDIT3: Per the suggestion below, this might be a way to achieve this with the conan package, but now I'm stuck with where to insert the \glll command?
\documentclass{article}
\usepackage[linenumbers,spacing=1,tt,singlebracket]{conan}
\usepackage{gb4e}
\usepackage{cgloss}
\begin{document}
\begin{exe}
\exi{A}{
\begin{conan*}
\simul{A}{A test sen[tence] with overlap.}
{B}{[Overlap]}
\end{conan*}}
\end{exe}
\end{document}


conanstyle otherwise meets your needs, you should be able to combine it with just the\glllcommand fromgb4e, or even better with the version incgloss.sty, which further unwraps the interlinear glossing macros. They only support two lines of glosses, but the macro is quite easy to extend (and I saw recently that someone had done it and posted the code on the web). Google forclgoss.sty-- it's not on CTAN. – alexis Mar 16 '16 at 15:30conanbut I couldn't get it to work. That is, it seems (I couldn't find good documentation anywhere) that in order to get the overlaps they need to be on the same line called \simul and that won't work for the data I'm trying to process (which is automatically generated by my transcription program, ELAN, and which has each speaker on a new line).I've also tried to use
– jan Mar 17 '16 at 06:00gb4eandexpexwithin atabbingsection but that does not seem to work.gb4eand notexpex? Would you mind sharing why? From other posts on this forum people tend to recommend the latter for more complex glossing with three and more lines of glosses, so since I'm completely new to the whole enterprise, any time saving hints what rather not to try are greatly appreciated. – jan Mar 17 '16 at 06:00gb4e, I recommended its glossing macros because they can be used independently of the example environment. If you can't useconan, it's a moot point; choose whatever macros you can bend to your wishes first. Expex is more recent, powerful and flexible, but it's not modular in the same way, and its interface is a bit odd (the author doesn't use LaTeX, so the interface doesn't follow latex norms). I've never usedexpex, so I can't say more. – alexis Mar 17 '16 at 11:47expexorconanexpertise will chime in. – jan Mar 17 '16 at 12:47clgoss.sty-- it's not on CTAN." Oops!. That would becgloss.sty, then? ;) – Dɑvïd Mar 19 '16 at 08:57cgloss.sty. Ouch. Here's a direct link: cgloss.sty. Thanks @David. – alexis Mar 19 '16 at 10:24conanandgb4ewith the hackedcgloss— now I need help with where to put the\gllor\glllso that it correctly parses the lines. I've tried at the beginning of the\simulline or before the actual text, but nothing seems to work. :( – jan Mar 20 '16 at 11:37