[Tex/LaTex] Changing the font style for chapters, sections and subsections

miktextitlesec

Can anyone please help me change the font style (say the LaTeX font: accanthis) only for the chapter name while the text in the article still has a palatino font (I am using \usepackage{palantino}).

I went through the titlesec package info but couldn't figure out how this could be done.

Best Answer

Use \titleformat from package titlesec to change the chapter font. For the lower levels you can use the stared version of this command.

\documentclass{book}
\usepackage{accanthis}
\usepackage{palatino}

\usepackage{titlesec}
\titleformat{\chapter}
  [display]
  {\Huge\bfseries\accanthis}
  {\huge\chaptertitlename\space\thechapter}
  {20pt}
  {}

\titleformat*{\section}{\normalfont\Large\bfseries\accanthis}
\titleformat*{\subsection}{\normalfont\large\bfseries\accanthis}

\usepackage{blindtext}% dummy text
\begin{document}
\tableofcontents
\blinddocument
\end{document}

Note that you have to load accanthis before palatino.

enter image description here


If you only want to change the font settings for the section headings you could also use package sectsty instead titlesec.

\documentclass{book}
\usepackage{accanthis}
\usepackage{palatino}

\usepackage{sectsty}
\chaptertitlefont{\Huge\bfseries\accanthis}
\chapternumberfont{\huge\bfseries\accanthis}
\sectionfont{\normalfont\Large\bfseries\accanthis}
\subsectionfont{\normalfont\large\bfseries\accanthis}

\usepackage{blindtext}% dummy text
\begin{document}
\tableofcontents
\blinddocument
\end{document}

But if you can use a KOMA-Script class it would be really easy:

\documentclass[emulatestandardclasses]{scrbook}
\usepackage{accanthis}
\usepackage{palatino}

\addtokomafont{chapter}{\accanthis}
\addtokomafont{section}{\accanthis}
\addtokomafont{subsection}{\accanthis}

\usepackage{blindtext}% dummy text
\begin{document}
\blinddocument
\end{document}
Related Question