5

I would change the font of section and subsection of my document. I have created it using book class. I would use this font:

enter image description here

According to Adobe pdf propriety, this font is AvantGarde-Demi. How can I use it in Latex. what command I should use to recreate this in latex. I think I should use titlesec package right?

Mazzy
  • 7,642

1 Answers1

7

You can also use sectsty

\documentclass{book}
%\usepackage{avant}
%\renewcommand*\familydefault{\sfdefault} %% Only if the base font of the document is to be sans serif
\usepackage[T1]{fontenc}
%\renewcommand{\sfdefault}{pag} %% To make only sf fonts to be avant garde.
\usepackage{sectsty}
%\chapterfont{\fontfamily{pag}\selectfont} %% for chapter if you want
\sectionfont{\fontfamily{pag}\selectfont}
\subsectionfont{\fontfamily{pag}\selectfont} %% Similarly for others. see the manual of sectsty, section 5.
\begin{document}
\setcounter{secnumdepth}{3}
\chapter{Some chapter}
\section{Event Monitor Pattern}
\subsection{Some sub-section}
\subsubsection{Some sub sub section}

\end{document}

enter image description here

With titlesec

\documentclass{book}
%\usepackage{avant}
%\renewcommand*\familydefault{\sfdefault} %% Only if the base font of the document is to be sans serif
\usepackage[T1]{fontenc}
%\renewcommand{\sfdefault}{pag} %% To make only sf fonts to be avant garde.
\usepackage{titlesec}
\titleformat{\chapter}[display]
  {\fontfamily{pag}\selectfont\huge\bfseries}
  {\chaptertitlename\ \thechapter}
  {20pt}
  {\Huge}
\titleformat{\section}
  {\fontfamily{pag}\selectfont\bfseries\Large}
  {\thesection}
  {1em}
  {}
\titleformat{\subsection}
  {\fontfamily{pag}\selectfont\bfseries\Large}
  {\thesection}
  {1em}
  {}
\begin{document}
\setcounter{secnumdepth}{3}
\chapter{Some chapter}
\section{Event Monitor Pattern}
\subsection{Some sub-section}
\subsubsection{Some sub sub section}

\end{document}