5

I'm using the expex packages for my glossing exemples and it's working great but:

I want my \gla exemple to be in typewriter format (\tt). And then I want to gloss only some parts of my exemple (the rest is irrelevant) but when I put \nogloss command the text inside goes back to roman format. And what I want is to have all the \gla line to be in typewriter font.

So this is my exemple :

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage{expex}
\newcommand{\pt}{\textsc{2sg.fam}~}
\begin{document}
\pex[labeltype=numeric,everygla=\tt]
\a
\begingl
\gla \nogloss{HEN :} \underline{t'as} encore besoin d'argent/ //
\glb \pt'avoir-\pt~ //
\endgl
\a
\begingl
\gla \nogloss{ANT : non j'ai rencontré quelqu'un que j'aime alors je voulais} \underline{te} la présenter //
\glb \pt~ //
\endgl
\a
\begingl
\gla \nogloss{HEN : ouais je vois oui encore une de} \underline{tes} mannequins sans cervelle//
\glb \pt~ //
\endgl
\xe
\end{document}

How can I make LaTeX obey my orders? haha :) Pretty please

4

Explanation

Your orders are being obeyed; it's just that \nogloss{} doesn't work the way you think it does. The formatting you specify in everygla doesn't apply to material within \nogloss{} (although this isn't explicitly mentioned in the documentation). This is because expex is designed primarily to be used for interlinear glossing where every word is glossed, so the material in \nogloss{} is typically punctuation (e.g., brackets, ellipses, etc.) or silent elements (e.g., traces, gaps, operators, etc.). These punctuation marks and silent elements are usually formatted differently from the normal text: even if you keep the default italics formatting of the gla line, you wouldn't want a labeled bracket like [NP to be in italics, so \nogloss{} doesn't pay attention to everygla.

Solutions

Here are three solutions for your case.

Note that I removed the ~ that you had both within and after your \pt command because it added unnecessary spacing. Feel free to add that back in if you actually wanted that space. I also changed the deprecated \tt to \ttfamily (expex often uses the obsolete font commands in its defaults and documentation, but you shouldn't).

Solution 1

Put \ttfamily within \nogloss. You might imagine that you could define a new command like \newcommand{\nogl}[1]{\nogloss{\ttfamily #1}}, but unfortunately it doesn't work to put \nogloss inside a new command.

enter image description here

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage{expex}
\newcommand{\pt}{\textsc{2sg.fam}}
\begin{document}

\pex[labeltype=numeric,everygla=\ttfamily]
\a
\begingl
\gla \nogloss{\ttfamily HEN : } \underline{t'as} encore besoin d'argent/ //
\glb \pt'avoir-\pt //
\endgl
\a
\begingl
\gla \nogloss{\ttfamily ANT : non j'ai rencontré quelqu'un que j'aime alors je voulais} \underline{te} la présenter //
\glb \pt //
\endgl
\a
\begingl
\gla \nogloss{\ttfamily HEN : ouais je vois oui encore une de} \underline{tes} mannequins sans cervelle//
\glb \pt //
\endgl
\xe

\end{document}

Solution 2

Surround your non-glossed material in {} and add a corresponding {} to the glb line. This is how we had to do this before \nogloss{} became available in expex version 5.0. See the discussion in section 9.2.3 of the documentation.

enter image description here

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage{expex}
\newcommand{\pt}{\textsc{2sg.fam}}
\begin{document}
\pex[labeltype=numeric,everygla=\ttfamily] % I changed the deprecated \tt to \ttfamily
\a
\begingl
\gla {HEN : } \underline{t'as} encore besoin d'argent/ //
\glb {} \pt'avoir-\pt //
\endgl
\a
\begingl
\gla {ANT : non j'ai rencontré quelqu'un que j'aime alors je voulais} \underline{te} la présenter //
\glb {} \pt //
\endgl
\a
\begingl
\gla {HEN : ouais je vois oui encore une de} \underline{tes} mannequins sans cervelle//
\glb {} \pt //
\endgl
\xe

\end{document}

Solution 3

Use the new nlevel glossing style (see section 10 of the documentation). The [] that correspond to the glb line are required (p. 44), but you don't have to put one on every word, only on every glword. So you can just break your lines up into three glwords: the first being all the words before your glossed word, the second being the glossed word, and the third being all the words after your glossed word.

enter image description here

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage{expex}
\newcommand{\pt}{\textsc{2sg.fam}}

\begin{document}

\pex[labeltype=numeric,glstyle=nlevel,glneveryline={\ttfamily}]
\a \begingl HEN :[] \underline{t'as}[\pt'avoir-\pt] encore besoin d'argent/[] \endgl % There are three sets of [], dividing the line into three glwords, only one of which is actually glossed.
\a \begingl ANT : non j'ai rencontré quelqu'un que j'aime alors je voulais[] \underline{te}[\pt] la présenter[] \endgl
\a \begingl HEN : ouais je vois oui encore une de[] \underline{tes}[\pt] mannequins sans cervelle[] \endgl
\xe
\end{document}
  • Perfect!!! thank you VERY much Jason!:) I knew there was a simple solution to that! :) – Justyna Bernat Jul 30 '15 at 15:36

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.