1

Putting an expex example directly after a section command doesn't prevent a pagebreak before. Any idea how to avoid pagebreaks in this scenario?

\documentclass{report} 
\usepackage{expex}
\usepackage{lipsum}
\begin{document}
\lipsum[2-6]
\subsection*{test}
\ex[exno=, exnoformat=X] \begingl 
\glpreamble This is a sentence // 
\gla This is a sentence //  
\glb \textsc{dem} 3.\textsc{be} \textsc{det} sentence //
\glft This is a translation // 
\endgl \xe
\end{document}

Reason why I'm asking this is because I use expex's numbering feature to create line numbers as in this answer, and therefore need a second mechanism to number the texts/examples. I have created an environment that uses a \subsection* command to create a title such as Text 1.1 but despite this it can happen that the title is the last line on a page and the expex glosses start on the next one.

1 Answer 1

2

You can prevent breaking here by setting expex's line penalty (Here I do it globally, although you could also set it locally)

\documentclass{report} 
\usepackage{expex}
\usepackage{lipsum}
\def\lingexbreakpenalty{10000}
\begin{document}
\lipsum[2-6]
\subsection*{test}
\ex[exno=, exnoformat=X] \begingl 
\glpreamble This is a sentence // 
\gla This is a sentence //  
\glb \textsc{dem} 3.\textsc{be} \textsc{det} sentence //
\glft This is a translation // 
\endgl \xe
\end{document}

You must log in to answer this question.

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