2

I am writing a book and I use \usepackage{charter}, but this changes the font of the main text too. How do I keep the font for Chapter title, Section title, header, footer etc of this package and use other font for the main text (i.e. CM Serif)? This is my code so far

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage{charter}
\usepackage{lipsum}

\begin{document}
\chapter{Chapter 1}
\lipsum
\end{document}
1

The charter package changes two elements:

\renewcommand{\rmdefault}{bch}
\renewcommand{\bfdefault}{b}

You can just avoid this setting of \rmdefault by selecting bch (bitstream charter) as-needed. Tapping into the sectional units with sectsty is straight-forward, although other options also exist. Also, fancyhdr is typically the go-to when it comes to header/footer customization, but again, other options also exist.

enter image description here

\documentclass{book}

\usepackage{sectsty,fancyhdr,lipsum}

\newcommand{\charterfont}{\fontfamily{bch}\selectfont}
\chapterfont{\charterfont}
\sectionfont{\charterfont\bfseries}

\fancyhf{}% Clear header/footer
\fancyfoot[C]{\charterfont\thepage}
\fancyhead[L]{\charterfont\leftmark}
\fancyhead[R]{\charterfont\rightmark}
\pagestyle{fancy}

\fancypagestyle{plain}{%
  \fancyhf{}% Clear header/footer
  \renewcommand{\headrulewidth}{0pt}% No header rule
  %\renewcommand{\footrulewidth}{0pt}% No footer rule (default)
  \fancyfoot[C]{\charterfont\thepage}
}

\begin{document}
\chapter{A chapter}
\section{A section}
\lipsum
\end{document}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.