How can I change the alignment of a chapter/section/subsection heading? Preferably, I want this to be something I specify in the header, as this will be necessary for all headers in the document.

3 Answers 3


This can be done using the titlesec package.

Here's a compilable demonstration example:

  {\normalfont\huge\bfseries\justifyheading}{\chaptertitlename\ \thechapter}

Now the headings are right aligned. I defined a macro \justifyheading. If you later wish to left-justify or to center, simply define \justifyheading to be \raggedleft respctively \centering.

alt text

  • 12
    Just for posterity, this can be done even simpler, just using the "easy setup" technique described on 2 of the titlesec manual: just add \usepackage[raggedleft]{titlesec} to the header.
    – eykanal
    Dec 6, 2010 at 19:22
  • @eykanal: Great, that option really works!
    – Stefan Kottwitz
    Dec 6, 2010 at 19:32
  • The option when the package is imported did not work for me but I have also a few definitions using \titleformat. I just had to add \raggedleft to section and subsection definition.
    – Celdor
    Oct 19, 2017 at 8:56

Just for completeness -- This can also be accomplished with the sectsty package:


You could use a KOMA-Script-class and redefine \raggedsection.


You must log in to answer this question.

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