[Tex/LaTex] Changing the font of “Appendices” (\appendixpagename) on \appendixpage for appendix package

appendicesfonts

If the option page is provided to the appendix package, it adds a page (the \appendixpage) stating

Appendices

before the actual start of the appendices. The name "Appendices" is given by \appendixpagename. From the package documentation:

\newcommand{\@chap@pppage}{%
\clear@ppage
\thispagestyle{plain}%
\if@twocolumn\onecolumn\@tempswatrue\else\@tempswafalse\fi
\null\vfil
\markboth{}{}%
{\centering
\interlinepenalty \@M
\normalfont
\Huge \bfseries \appendixpagename\par}%
}

It clearly uses \normalfont for the font of the \appendixpagename but I want to use \sffamily instead. How to achieve that?

Best Answer

Changing the \appendixpagename can be done on multiple ways:

Either use a \let\appendixpagenameorig\appendixname and refer to the old definition or use \xpretocmd, see the different versions below:

\documentclass{article}


\usepackage[page]{appendix}

\let\appendixpagenameorig\appendixpagename
\renewcommand{\appendixpagename}{\sffamily\appendixpagenameorig}
\begin{document}

\section{Foo}
\begin{appendices}
  \section{Foo Appendix}
\end{appendices}

\end{document}

or with \xpretocmd

\documentclass{article}


\usepackage[page]{appendix}

\usepackage{xpatch}
\xpretocmd{\appendixpagename}{\sffamily}{}{}
\begin{document}

\section{Foo}
\begin{appendices}
  \section{Foo Appendix}
\end{appendices}

\end{document}

The 2nd way is shorter, but requires an extra package.

enter image description here

Related Question