I have the following piece of code in the preamble, that should prevent chapter from beginning on different pages, but, by the same time, when I get to chapter 3 it has enough text to break a page and does not, how can I fix it?


Unfortunately, I can't build a MWE with the same specs as the original, so I'm letting a only view link to the overleaf project.


As pointed in the coments bellow, LaTeX does not handle well with a whole bunch of text inside sections, so I changed from sections to enumerate environment, and then changed how the item appeared using the enumitem package.

  • In your code you have \subsection{A whole bunch of text}. LaTeX doesn't allow page breaks in section titles. You should make your document into something like \subsection{Title} A whole bunch of text. Oct 12, 2019 at 15:32
  • and how can I mantain the format of a Law text, with Art and § symbols?
    – liuzp
    Oct 12, 2019 at 16:47
  • where exactly @JohnKormylo?
    – liuzp
    Oct 12, 2019 at 21:34
  • Oops, you DON"T want it to break a page normally. This looks like a job for needspace. Oct 13, 2019 at 15:47

1 Answer 1


I put some of the instructions into the MWE itself.

BTW, etoolkit is just an code editor. \patchcmd replaces some of the existing code with something else.


\def\chapterspace{184.87657pt}% reserving a length register seemed a bit wasteful


\usepackage{lipsum}% MWE only


First you must find out how much space you need.  
Unless you use long chapter titles, the following should do.

Then copy \chapterspace{} into the definition of \verb|\chapterspace| and remove this code.

\noindent\rule{\textwidth}{15\baselineskip}% worst case




You must log in to answer this question.

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