# Wrong layout with titlesec: it won't change page after new section [duplicate]

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.

What is the issue and how to fix it?

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

• 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