I want to change the font of all the chapters in a document I have prepared with the class "book". I could do this manually, but it would be tedious, and it would not change the heading of the table of contents. I figure there must be a simple command, maybe via "evil red text" that does this. Note that I don't want to do anything fancy like changing the font. I just want chapter headings to be in the default sans-serif font, while the text is in a serif font.
(I do not want to use any other document class because I prefer the output of "book" over KOMA script and Memoir.)
How do I do this?
Thanks a lot in advance!
LyX ⇒ Changing the font of chapter headings
NEW: TikZ book now 40% off at Amazon.com for a short time.
Re: Changing the font of chapter headings
Take a look at the titlesec package. Even the sectsty package will be useful.
Regards,
sridhar
Regards,
sridhar
OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
Re: Changing the font of chapter headings
Thanks for your reply!
I have added the package "titlesec" to the document preamble, but then I have found that I would have to define all the attributes of the font all over again. (Also, three blank pages were inserted after the TOC, for reasons I cannot fathom.)
Is there no way to keep all the attributes of the document class "book" but just change the font the way I want?
Of course, there is a workaround:
1) creating two copies of the same document, one serif, one sans-serif
2) in the serif-document, change all chapter headings to sans serif, print to pdf
3) print the sans-serif document to pdf
4) open the pdf from the sans-serif document (with serif headings), and replace the TOC with the one from the sans-serif version
Obviously, this would be a bit tedious, but it would have been quicker than fiddling around with the LaTeX preamble for over an hour.
I have added the package "titlesec" to the document preamble, but then I have found that I would have to define all the attributes of the font all over again. (Also, three blank pages were inserted after the TOC, for reasons I cannot fathom.)
Is there no way to keep all the attributes of the document class "book" but just change the font the way I want?
Of course, there is a workaround:
1) creating two copies of the same document, one serif, one sans-serif
2) in the serif-document, change all chapter headings to sans serif, print to pdf
3) print the sans-serif document to pdf
4) open the pdf from the sans-serif document (with serif headings), and replace the TOC with the one from the sans-serif version
Obviously, this would be a bit tedious, but it would have been quicker than fiddling around with the LaTeX preamble for over an hour.

Changing the font of chapter headings
Here is what you can try for some fancy stuff 
You can play around with the fncychap and get very good results.
Regards,
sridhar

Code: Select all
\documentclass[11pt]{report}
%
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{sectsty}
\sectionfont{\sffamily\Large}
\subsectionfont{\sffamily}
\usepackage[Bjornstrup]{fncychap}
\ChTitleVar{\raggedleft\LARGE\sffamily\bfseries}
\begin{document}
\blinddocument
\end{document}
Regards,
sridhar
OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Changing the font of chapter headings
A concrete example based on the suggestions of mas.
Best regards and welcome to the board
Thorsten
Code: Select all
\documentclass[11pt,a4paper,english]{book}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage{sectsty}
\usepackage{blindtext}
% Headings setup (sectsty)
\allsectionsfont{\sffamily}
\begin{document}
\Blinddocument
\end{document}
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Changing the font of chapter headings
Again, thanks for your help. I really appreciate it!