1

I'm having difficulty forcing expex to indent correctly with its containing element. Does anyone know how to force expex to indent? Below is a code snippet:

\begin{enumerate}
    \item First piece of evidence for a phenomenon with examples below.
    \ex \label{anexample}
    \begingl
    \glpreamble \textit{No hablamos}//
    \gla no habl-amos //
    \glb \textsc{neg} speak-\textsc{pres.indic.1pl} //
    \glft `We don't speak.' //
    \endgl
    \xe
    \item 
\end{enumerate}

The problem I am having is that the nested expex code always has the same indent (across the entire document), in this instance it appears to the left of the enumerated item. I want expex to dynamically indent to match its containing element, is this possible?

1
  • 2
    Welcome to TeX.se. Please don't post code fragments, but complete minimal documents that people can compile simply without extra work. This way people can see exactly what you're doing and can help you faster.
    – Alan Munn
    Commented Apr 23, 2017 at 23:36

1 Answer 1

5

You can use the numoffset parameter to indent an example. This is described on page 11 of the documentation. The relevant length inside a list is \leftmargin:

\documentclass{article}
\usepackage{expex}
\begin{document}
\begin{enumerate}
    \item First piece of evidence for a phenomenon with examples below.
    \ex[numoffset=\leftmargin] \label{anexample}
    \begingl
    \glpreamble \textit{No hablamos}//
    \gla no habl-amos //
    \glb \textsc{neg} speak-\textsc{pres.indic.1pl} //
    \glft `We don't speak.' //
    \endgl
    \xe
    \item 
\end{enumerate}
\end{document}

If you have a lot of these enumerations, you can use the enumitem package to set the indents at the list level:

\documentclass{article}
\usepackage{expex}
\usepackage{enumitem}

\setlist[enumerate]{before={\lingset{numoffset=\leftmargin}}}

\begin{document}
\begin{enumerate}
    \item First piece of evidence for a phenomenon with examples below.
    \ex \label{anexample}
    \begingl
    \glpreamble \textit{No hablamos}//
    \gla no habl-amos //
    \glb \textsc{neg} speak-\textsc{pres.indic.1pl} //
    \glft `We don't speak.' //
    \endgl
    \xe

\end{enumerate}
\begin{enumerate}
\item Another list
    \ex \label{anexample}
    \begingl
    \glpreamble \textit{No hablamos}//
    \gla no habl-amos //
    \glb \textsc{neg} speak-\textsc{pres.indic.1pl} //
    \glft `We don't speak.' //
    \endgl
    \xe
\end{enumerate}
\end{document}

output of code

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .