3

I'm new to Latex and trying to figure out how to do the following thing with expex: I would like to use square bracket as well as a subscripted word such as 'NP' in the transcription line, where everything else is italic and glossed. Something like this (with the NP subscripted):

[my dog]NP ate me.

1SG.POSS dog eat.PST 1SG.ACC

balivon
  • 75

2 Answers2

6

The expex package provides a \nogloss macro to exempt certain elements from being counted as in the gloss. I've made two bracketing macros to create upright brackets: \lb creates an upright left bracket, and \rb{XP} creates an upright right bracket with a label "XP".

Unfortunately, due to the way expex is written, you can't include the \nogloss command inside the \lb and \rb macros, so they need to be used explicitly.

\documentclass[12pt]{article}
\usepackage{fixltx2e} % This package not needed for > 2015 distributions 
\usepackage{expex}

\newcommand{\lb}{\upshape[}
\newcommand{\rb}[1]{\upshape]\textsubscript{#1}}

\begin{document}
\ex
\begingl
  \gla \nogloss{\lb}  Mon ami \nogloss{\rb{NP}}     est  \nogloss{\lb} grand \nogloss{\rb{AP}}//
  \glb my friend is tall//
  \glft `My friend is tall'//
\endgl
\xe
\end{document}

output of code

Alan Munn
  • 218,180
  • 1
    +1. This answer is great. @user73020, if you want to know to fine-tune the horizontal spacing of the brackets, take a look at this answer: http://tex.stackexchange.com/a/229544/42880. – Jason Zentz Feb 25 '15 at 14:04
  • 2
    @balivon, one thing to be aware of is that \nogloss doesn't work right if it's the first thing on the \gla line and there's an \ljudge for the grammaticality judgment marker (regardless of whether there's a space between \ljudge{*} and \nogloss or not). In that case, I surround the initial bracket(s) with {} instead of \nogloss{} and put an empty {} at the beginning of the \glb line to compensate. – Jason Zentz Feb 27 '15 at 02:28
0

I like to use philex with fixltx2e, but I think, that you can combine it with your expex code.

\documentclass{article}
\usepackage{philex}
\usepackage{fixltx2e}
\begin{document}
\lb{ex2}{\gll [my dog]\textsubscript{NP} ate me.\\
1\textsc{sg}.\textsc{poss} dog eat.\textsc{pst} 1\textsc{sg}.\textsc{acc}\\}
\end{document}