# Square brackets and subscript in expex glossing

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

• Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Feb 25, 2015 at 3:29

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}


• +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: tex.stackexchange.com/a/229544/42880. Feb 25, 2015 at 14:04
• @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. Feb 27, 2015 at 2:28

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}

• This isn't really an answer, since your code doesn't actually use the expex` package. Feb 25, 2015 at 3:30