nearly_lunchtime
nearly_lunchtime

Reputation: 12943

Different font for all headings in LaTeX

I would like to set my chapter/section/subsection headings to use a sans-serif font, but keep the serif font for the body text. How can this be done?

Upvotes: 12

Views: 26689

Answers (4)

Will Robertson
Will Robertson

Reputation: 64670

You can also use the titlesec package, which allows greater flexibility of customisation than sectsty.

\usepackage[sf]{titlesec}

Upvotes: 10

bastijn
bastijn

Reputation: 5953

For the people who want to know why this has to be done differently from e.g. normal text. It is because of the distinction between robust commands and fragile commands. Headings do not allow fragile commands, so you have to specifically tell latex it is robust for example.

This link explains this further, and this link shows another alternative to do it.

Upvotes: 3

Ville Laurikari
Ville Laurikari

Reputation: 29288

You can use the sectsty LaTeX package.

Put this in the preamble:

\usepackage{sectsty}
\allsectionsfont{\sffamily}

Upvotes: 23

Tobias
Tobias

Reputation: 6507

The first possibility that comes to my mind is to use a document class from the KOMA-script package, they have this set up as a default.

Upvotes: 1

Related Questions