[Tex/LaTex] memoir class \part style

chaptersmemoirpartssectioning

I am preparing a book in memoir class. I use \chapterstyle{madsen}, which uses a sans serif font (I don't know which one). I also have parts and I would like to have the parts to be typeset in the madsen style as well (if I can get the font to be the same, I would be satisfied).

Second, if I can get the section titles to be in the same font, it would be great. Any suggestions would be very much appreciated.

Best Answer

Here's the definition of the madsen chapter style:

\makechapterstyle{madsen}{% requires graphicx package
  \chapterstyle{default}
  \renewcommand*{\chapnamefont}{%
    \normalfont\Large\scshape\raggedleft}
  \renewcommand*{\chaptitlefont}{%
    \normalfont\Huge\bfseries\sffamily\raggedleft}
  \renewcommand*{\chapternamenum}{}
  \renewcommand*{\printchapternum}{%
    \makebox[0pt][l]{\hspace{0.4em}%
      \resizebox{!}{4ex}{%
        \chapnamefont\bfseries\sffamily\thechapter}%
    }%
  }%
  \renewcommand*{\printchapternonum}{%
    \chapnamefont \phantom{\printchaptername \chapternamenum%
      \makebox[0pt][l]{\hspace{0.4em}%
        \resizebox{!}{4ex}{%
          \chapnamefont\bfseries\sffamily 1}%
      }%
    }%
    \afterchapternum %
  }%
  \renewcommand*{\afterchapternum}{%
    \par\hspace{1.5cm}\hrule\vskip\midchapskip}}

The relevant parts are: \normalfont\Large\scshape for the font of the chapter name (i.e., the string "Chapter") and \normalfont\Huge\bfseries\sffamily for the chapter titles (the chapter numbers require other specifications that won't be used).

To obtain the same settings for part headings, you can redefine \partnamefont, \partnumfont, and \parttitle font to use similar settings; for section headings, you can use \setsecheadstyle. Here are the changes required:

\documentclass{memoir}
\usepackage{graphicx}
\chapterstyle{madsen}

\renewcommand\partnamefont{\normalfont\Large\scshape}
\renewcommand\partnumfont{\normalfont\Large\scshape}
\renewcommand\parttitlefont{\normalfont\Huge\bfseries\sffamily}
\setsecheadstyle{\normalfont\Large\bfseries\sffamily}

\begin{document}

\part{Test Part}
\chapter{Test Chapter One}
\section{Test Section}

\end{document}