Different font for all headers in LaTeX

I would like to specify section / section / subsection headers to use the sans-serif font, but keep the serif font for the main text. How can I do that?

+6
latex
source share
4 answers

You can use the sectsty LaTeX package .

Put this in the preamble:

 \usepackage{sectsty} \allsectionsfont{\sffamily} 
+15
source share

You can also use the titlesec package, which provides more configuration flexibility than sectsty.

  \ usepackage [sf] {titlesec}
+6
source share

For people who want to know why this should be done differently than, for example, a normal text. This is due to the difference between reliable teams and fragile teams. Headers do not allow fragile commands, so you need to specifically say that latex is reliable, for example.

This link explains this further, and this shows another alternative.

+2
source share

The first opportunity that comes to my mind is to use the document class from the KOMA-script package, they have it set to the default value.

+1
source share

All Articles