0

This question already has an answer here:

I tried the following layout

\documentclass{article}
\usepackage[explicit]{titlesec}

\titleformat{\section}
  {\vspace{1cm}\titlerule\vspace{.8ex}%
   \bfseries\large}
  {\Roman{section}\,|}
  {.5em}
  {#1}

\titlespacing{\section}{0.5ex}{*1}{*0}

\begin{document}

\section{Test}

\section{Test}

\section{Test}

\section{Test}

\section{Test}

\section{Test}

\section{Test}

\section{Test}

\section{Test}

\section{Test}

\section{Test}

\section{Test}

\section{Test}

\section{Test}

\end{document}

But all the titles are put on the page 2, with a strong vertical overfull box: see the image below.

enter image description here

What is the issue and how to fix it?

marked as duplicate by Phelype Oleinik, Stefan Pinnow, TeXnician, user36296, Sebastiano Aug 14 '18 at 19:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Put some text in between (not just a blank line). – TeXnician Aug 14 '18 at 13:52
  • I would like (if possible) to possibly not put any text after a \section{}. But, indeed, it works with \mbox{} although it adds some vertical space. – Colas Aug 14 '18 at 13:54
  • 1
    Well, it is intended behavior that two sections following each other do not break (if I recall correctly). – TeXnician Aug 14 '18 at 13:57
  • 1
    This answer is probably what @TeXnician is referring to. If you want more details, have a look at this more recent answer. – Ruixi Zhang Aug 14 '18 at 14:10

Browse other questions tagged or ask your own question.