%%
%% The LaTeX Companion, 3ed
%%
%% Example 9-6-5 on page I-711 in "Setting up additional font families".
%%
%% Copyright (C) 2022 Frank Mittelbach
%%
%% It may be distributed and/or modified under the conditions
%% of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%%
%% See https://www.latex-project.org/lppl.txt for details.
%%

\documentclass{tlc3exa}
\pagestyle{empty}
\setcounter{page}{6}
\setlength\textwidth{231.0pt}

%!TEX program = lualatex

%StartShownPreambleCommands
\usepackage{kantlipsum,fontspec}
\setmainfont{GaramondNo8}
\newfontfamily{\headfamily}{Bitter}

\usepackage[compact]{titlesec}
\titleformat*{\section}{\headfamily}
\titleformat*{\subsection}{\headfamily}

%StopShownPreambleCommands

\begin{document}
\section{On Reason}         \kant[6][1]
\subsection{Considerations} \kant[6][2]
\end{document}