[Tex/LaTex] How to get all CAPS chapter titles

capitalizationchaptersmemoir

Trying to get all CAPS chapter titles. Using the following, only the ToC chapter title is all CAPS:

\documentclass{memoir}
\renewcommand{\chaptitlefont}{\MakeUppercase}
\begin{document}

\tableofcontents*

\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}  

\chapter{Sample Title}

\end{document}

What does one do to get Preface, and Sample Title to be in all CAPS as well?

Best Answer

According to the memoir user manual, a chapter title is set via \printchaptertitle. An example of its usage and redefinition for the bringhurst chapter style (section 20.4.1 The chapter style, p 354) is:

%% Bringhurst chapter style
\makechapterstyle{bringhurst}{%
  \renewcommand{\chapterheadstart}{}
  \renewcommand{\printchaptername}{}
  \renewcommand{\chapternamenum}{}
  \renewcommand{\printchapternum}{}
  \renewcommand{\afterchapternum}{}
  \renewcommand{\printchaptertitle}[1]{%
    \raggedright\Large\scshape\MakeLowercase{##1}}
  \renewcommand{\afterchaptertitle}{%
    \vskip\onelineskip \hrule\vskip\onelineskip}
}

It's obvious how \printchapterstyle has been redefined to set the contents in lowercase. In a similar vein, you're most like after

\renewcommand{\printchaptertitle}[1]{\chaptitlefont\MakeUppercase{#1}}

Here is a complete MWE:

enter image description here

\documentclass{memoir}% http://ctan.org/pkg/memoir
\renewcommand{\printchaptertitle}[1]{\chaptitlefont\MakeUppercase{#1}}
\begin{document}

\chapter{Sample Title}

\end{document}