1

As you can see in the MWE, I customize the chapter titles to be displayed in the center of the page with:

\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries\centering}{\centering\thechapter}{20pt}{\Huge}

So, when I have a little bit long title, the break line come in each line at soon as possible. Then the paragraph title appear as a “big endian” pyramid (triangle in fact…).

For example, with the following MWE:

\documentclass{book}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries\centering}{\centering\thechapter}{20pt}{\Huge}


\begin{document}

\chapter{Justification de l’étendue terminologique}

\end{document}

I get this rendering:

Default behaviour

When the expected result is:

I know I can use the optional argument of \chapter command like \chapter[Justification de l’étendue terminologique]{Justification de\\ l’étendue terminologique}.

But my goal is to make LaTeX do it himself, without force me to do it manually. So, is their some package or something to get this behavior for titles?

  • 1
    Add the [newlinetospace] option on loading titlesec: it removes any \\` or \\*` from toc and headers. – Bernard Mar 22 at 21:30
  • tex doesn't make the linebreak "as soon as possible" in fact in the case that you show you want the line break to be earlier not later. As always tex does not consider linebreaks one at a time, but as a least cost minimisation over the whole paragraph. If you want a strong triangular shape you could try shapepar, if you just want normal breaking but each line shorter than the previous, it's a bit hard to do automatocally – David Carlisle Mar 23 at 9:40
  • So, @DavidCarlisle you correctly understand my need. Then your advices are helpful. I’ll try to remember it when I’ll had to make it. And yes, my goal is not to get a hard triangle (it could be ugly) but just a triangle-like text. – fauve Mar 23 at 12:13
  • 1
    are the titles likely to be more than two lines? it's easier to arrange a single linebreak in a two line case than try to control the shape of a whole pargraph – David Carlisle Mar 23 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.