I'm using titlesec to customize the look on sections. I have adjusted these different headings in a nesting manner with lower levels being increasingly indented.

The paragraphs below the headings will not align and I figured I could use \parshape to sort this trouble out, but I can only manage to align the first paragraph after a section - and only if I put the code just before a paragraph (and not in the titlesec definitions).

This is what I have now:

\usepackage{lipsum, xcolor, titlesec}



\parshape 1 5pt \dimexpr\linewidth-1cm\relax



This will produce the following output (with my red lines):

incorrect indentation

How can I adjust an arbitrary amount of paragraphs that align with the preceeding section header? I assume I need to add something to the after-code of either titleformat or titlespacing from the titlesec package. But I am unsure how.

Note: While this answer (multiple paragraphs with parshape) touches on the subject, I cannot seem to find out how I can use it in my case.

  • 1
    Just to be sure: you want a variable margin? Normal for chapters, somewhat larger for sections, even larger for subsections, and so on?
    – campa
    Feb 16, 2021 at 8:32
  • Yes, that is correct. I will also use titleformat and titlespacing from titlesec for all levels. A switch to reset would also be welcome.
    – Ole Aldric
    Feb 16, 2021 at 8:49


You must log in to answer this question.

Browse other questions tagged .