With the memoir
class, there are often easier solutions than rewriting entire macros. How to modify the format of parts is explained at section 6.4 of the manual.
In the example below, I have simply redefined the macros that set the appearance of parts to mimic the ones used by the thatcher chapter style.
\documentclass{memoir}
\usepackage[frenchb]{babel}
% Pour "première partie"
\usepackage{fmtcount}
\chapterstyle{thatcher}
\renewcommand*{\thepart}{\arabic{part}}
\renewcommand*{\parttitlefont}{\normalfont\large\MakeUppercase}
\renewcommand*{\partnamefont}{\normalfont\scshape\MakeLowercase}
\renewcommand*{\partnumfont}{\normalfont\scshape\MakeLowercase}
% Pour "première partie"
\renewcommand*{\printpartname}{\partnamefont{\ordinalstring{part}[f] partie}}
\renewcommand*{\printpartnum}{}
% Pour "partie 1"
%\renewcommand*{\printpartname}{\partnamefont Partie}
%\renewcommand*{\printpartnum}{\partnumfont\thepart}
\renewcommand{\midpartskip}{\par\parbox{0.5in}{\hrulefill}\par}
\renewcommand{\beforepartskip}{\vspace*{\fill}}
\renewcommand{\afterpartskip}{\vspace*{\fill}}
% Pour la table des matières
\renewcommand*{\cftpartname}{Partie}
\renewcommand*{\cftpartpresnum}{\space}
\renewcommand*{\cftpartaftersnum}{.}
\renewcommand*{\cftpartaftersnumb}{\space}
\begin{document}
\tableofcontents
\part{Une partie}
\part*{Une partie sans numéro}
\part[Une autre partie (nom pour la table des matières)]{Une autre partie}
\chapter{Un chapitre}
\end{document}
The names of the macros are quite self-explanatory, but here are some additional comments about what they do: \thepart
is used to redefine the format of the part
counter; \parttitlefont
, \partnamefont
and \partnumfont
respectively set the font used by for the title, for the "part" word and for the number. In order to insert a line between the "Part N" line and the title line, I modified \midpartskip
. Then, I also redefined \beforepartskip
and \afterpartskip
, which (here) define the white space to add above and below the text.
Since this technique does not rewrite the entire code, you can still use the \part
command normally without any restrictions. The only problem encountered is that with \part*
, the title of the part will not be exactly in the same place (whereas the thatcher
chapter style adds the necessary white space in that case). But there is no easy way to do it because the memoir
class does not have a special macro for starred parts (which I have never encountered anywhere, in any event).
And a picture of the result (I only put in one page):
Edit: I have updated my answer so the part name works properly with French babel
. Two options there: if you want to write "première partie", leave everything as it is; if you want "partie 1" instead, uncomment the lines I have marked for this (2 lines), and comment the ones marked for the other style (that's 3 lines).
Oh, and as an added bonus, the last lines of the code rewrite the "Part" in the table of contents. You can remove it if you prefer to have just the number, but I thought you might want something of that sort too.
The code below shows one possibility:
\documentclass{memoir}
\newlength\chaptitlelength
\newlength\chaptitlerlength
\makeatletter
\newcommand\thickhrulefill[1]{%
\leavevmode \leaders \hrule height #1 \hfill \kern \z@}
\setlength\midchapskip{10pt}
\makechapterstyle{mystyle}{
\setlength\beforechapskip{0pt}
\renewcommand\chapternamenum{}
\renewcommand\printchaptername{}
\renewcommand\printchapternum{}
\renewcommand\chaptitlefont{\small\scshape\centering}
\renewcommand*{\printchaptertitle}[1]{%
\settowidth\chaptitlelength{\hspace*{1em}\chaptitlefont##1\hspace*{1em}}%
\ifnum\chaptitlelength>\dimexpr0.7\textwidth\relax%
\setlength\chaptitlelength{0.7\textwidth}%
\fi%
\setlength\chaptitlerlength{\textwidth}%
\addtolength\chaptitlerlength{-\chaptitlelength}%
\addtolength\chaptitlerlength{-2em}%
\noindent\parbox[c]{.5\chaptitlerlength}{\normalsize\thickhrulefill{0.3ex}\par\vskip-1.5ex\thickhrulefill{0.2ex}}\hspace*{1em}%
\parbox[c]{\chaptitlelength}{\chaptitlefont##1}\hspace*{1em}%
\parbox[c]{.5\chaptitlerlength}{\normalsize\thickhrulefill{0.3ex}\par\vskip-1.5ex\thickhrulefill{0.2ex}}%
}%
}
\makeatother
\chapterstyle{mystyle}
\begin{document}
\chapter{Test Chapter One}
\chapter{Test Chapter Two With a Long Title Spanning Two Lines And Some More Text}
\end{document}
The idea is to use three vertically centered \parbox
es; the first and third ones contain the rules and the middle one contains the title; some provision was made in case the title is too long: the middle box width won't exceed 0.7\textwidth
to guarantee that both lines will always show:
An image of a short title:
An image of a long title:
Of course, feel free to adjust the settings according to your needs.
Best Answer
In your preamble:
(for example).
The macro
\afterchapternum
is called bymemoir
after setting 'Chapter n' and before setting 'This is my Chapter'.The default value is this:
The
memoir
manual describes this in §6.5, around pp 80-82.Note: Added font harmonisation. My thanks to @lockstep.