I would like to find a way to prevent a page break between the first line of the example in following code.
\documentclass{article}
\usepackage{lipsum}
\usepackage{gb4e}
\begin{document}
\lipsum[3-7]
Some extra text to get the page break in the right place.
\begin{exe}
\ex\label{Label} Some description of this example
\begin{xlist}
\ex[*] {
First sentence.}
\ex[] {
First sentence.}
\ex[*] {
Third sentence.}
\end{xlist}
\end{exe}
\end{document}
I don't have a problem with a page break after the first actual item (i.e. between items (a) and (b)). I just don't want the title/heading of the example to be separated from the actual items of the example.
It's important that the example be formatted with the gb4e
package (rather than a more generic list environment), as I have many examples with complex linguistic glosses that require a package dedicated to the issue. I would prefer to use this package, as I have a lot of examples already formatted for this package (as opposed to other packages for linguistic examples).
I know that there are many questions on this site dealing with preventing or forcing page breaks at specific points, but I have not found an answer that works with the examples made using the gb4e
package. I have attempted adding things like \nopagebreak
in the example itself or \goodbreak
before the example, but the page break remains in the same place.
Finally, I was able to force the whole example to the next page by putting it in a minipage
environment, but this has two disadvantages. First, it does not allow a break between (a) and (b) in the example when that would be fine. Second, it would require manually checking for these orphans. That is not very practical for long documents (e.g. a dissertation).