0

I am trying to suppress page-breaking when a sentence in a single columned text is followed by a multi-column text.

\documentclass{article} \usepackage{multicol} \usepackage{enumitem} \usepackage{lipsum} \begin{document} \lipsum[1-5] We have the following cases: \begin{multicols}{2} \begin{enumerate} \item First case \item Second case \item Third case \item Fourth case \item Fifth case \item Sixth case \end{enumerate} \end{multicols} \end{document} 

Is it possible to avoid "We have the following cases:" being the last line of a page while the enumeration starting on the next page? In other words, is it possible that either "We have the following cases:" moves in the next page or some items stay in the same page with "We have the following cases:"?

Replacing

\begin{enumerate} 

by

\begin{enumerate}[beginpenalty=10000] 

did not solve the problem.

enter image description here

5
  • 1
    Your example would be a lot more useful if it showed the problem you are trying to solve so it could be used to test answers Commented Feb 7, 2024 at 9:45
  • Please clarify how this query isn't a duplicate of the query you posted 2 days ago? Commented Feb 7, 2024 at 9:52
  • Off-topic: Don't load both enumerate and enumitem; choose one or the other package, but not both. (Speaking for myself, I'd use the enumitem package.) Commented Feb 7, 2024 at 9:54
  • @Mico Actually the query I posted a few days, referred to something more general, and the answer to it solved successfully most cases. However, it did not solve the case where one-column text is followed by two-column text. Commented Feb 7, 2024 at 10:20
  • @DavidCarlisle I have modified my question accordingly. Commented Feb 7, 2024 at 10:32

1 Answer 1

2

You can use the optional argument of multicols for such leading text

\documentclass{article} \usepackage{multicol} \usepackage{enumerate,enumitem} \begin{document} \rule{1cm}{18cm} \begin{multicols}{2}[ We have the following cases: ] \begin{enumerate} \item First case \item Second case \item Third case \item Fourth case \item Fifth case \item Sixth case \end{enumerate} \end{multicols} \end{document} 

enter image description here

1
  • Actually this works. Thanks. Commented Feb 7, 2024 at 14:10

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.