我希望使用“Avant Garde”之类的 Sanserif 字体来格式化章节标题。
\documentclass[12pt, twoside]{book}
\usepackage{lipsum}
\usepackage{titlesec}
\usepackage{calc}
\usepackage{xcolor}
\usepackage{lmodern}
\usepackage{fancyhdr}
% Preparation for unnumbered chapters
\newcommand{\unnumberedchapter}[1]{
\cleardoublepage % To make sure the previous headers are passed
\addcontentsline{toc}{chapter}{#1} % Also adds the chapter name to the Contents
\fancyhead[RE]{{\bfseries #1}} % Headers for left pages
\fancyhead[LO]{}}%Headers for right pages
% Formatting chapter heading
\titleformat{\chapter}[display]{\fontsize{18}{16}\usefont{OT1}{phv}{m}{n}\bfseries}{}{0pt}{
\raisebox{-5mm}[0pt][0pt]{%<<
\begin{minipage}{20mm}
\centering{\mdseries\footnotesize\normalsize\textsc{}}\\[5pt]%
\rule{10mm}{30mm}\hspace{-10mm}%
\raisebox{23mm}{\parbox{10mm}{\centering\LARGE\textcolor{black}{\thechapter}}}%
\end{minipage}
}%
\rule{\textwidth-22mm}{.4pt}\\%
\hspace*{22mm}\begin{minipage}{\textwidth-22mm}
}[\end{minipage}\vspace*{10mm}]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
\begin{document}
\unnumberedchapter{Abstract}
\chapter*{Abstract}
\end{document}
答案1
使用pag
as family 代替phv
,或者加载 avant 包然后使用 \sffamily。