# Customize chapterstyle in memoir

I like the ell chapterstyle which is built into memoir, but I want to customize it. I like the chapter number and the lines around it, but I want the chapter title to be written in the same size and font as it would be in the default chapterstyle.

How can I make this change to the built-in ell chapterstyle? (Hopefully this will also be illustrative in learning how to customize any of the built-in memoir chapterstyles.)

\documentclass{memoir}
\chapterstyle{ell}
\begin{document}
\chapter{Introduction}
I want Introduction'' to have the same size and font
as it would in the default'' chapterstyle.
\end{document}
-
just copy the code from memoir.cls and take it from there. – daleif Mar 30 '12 at 19:13

As daleif suggested in his comment, all you have to do is to look at the code in memoir.cls; here's how the ell style is defined:

\makechapterstyle{ell}{%
\chapterstyle{default}
\renewcommand*{\chapnumfont}{\normalfont\HUGE\sffamily}
\renewcommand*{\chaptitlefont}{\normalfont\huge\sffamily}
\settowidth{\chapindent}{\chapnumfont 111}
\vspace*{\beforechapskip}%
\hrulefill
\smash{\rule{0.4pt}{15mm}}
\renewcommand*{\printchaptername}{}
\renewcommand*{\printchapternum}{%
\hfill
\raisebox{10mm}[0pt][0pt]{\chapnumfont \thechapter}%
\hspace*{1em}
\renewcommand*{\printchaptertitle}[1]{%
\vskip\onelineskip
\raggedleft {\chaptitlefont ##1}\par\nobreak}}

In your case, the relevant lines are

\renewcommand*{\chapnumfont}{\normalfont\HUGE\sffamily}
\renewcommand*{\chaptitlefont}{\normalfont\huge\sffamily}

which set the format for the number and title font. In the default style the number font is boldfaced and uses \huge and the title font is set to be boldfaced and \Huge and both use roman family, so you can define your own style making the appropriate changes. In the example below I changed both the number and title format to use roman family but, of course, you can change only the title format (I just thought that it is more coherent to maintain the same family for both the number and the title):

\documentclass{memoir}

\makechapterstyle{myell}{%
\chapterstyle{default}
\renewcommand*{\chapnumfont}{\normalfont\huge\bfseries}
\renewcommand*{\chaptitlefont}{\normalfont\Huge\bfseries}
\settowidth{\chapindent}{\chapnumfont 111}
\vspace*{\beforechapskip}%
\hrulefill
\smash{\rule{0.4pt}{15mm}}
\renewcommand*{\printchaptername}{}
\renewcommand*{\printchapternum}{%
\hfill
\raisebox{10mm}[0pt][0pt]{\chapnumfont \thechapter}%
\hspace*{1em}
\renewcommand*{\printchaptertitle}[1]{%
\vskip\onelineskip
\raggedleft {\chaptitlefont ##1}\par\nobreak}}

\chapterstyle{myell}

\begin{document}
\chapter{Introduction}
I want Introduction'' to have the same size and font
as it would in the default'' chapterstyle.
\end{document}

Of course, for minor changes, you don't have to define your own style; you can simply redefine the appropriate commands after selecting the style. The same result as above can be obtained with:

\documentclass{memoir}

\chapterstyle{ell}
\renewcommand*{\chapnumfont}{\normalfont\huge\bfseries}
\renewcommand*{\chaptitlefont}{\normalfont\Huge\bfseries}

\begin{document}
\chapter{Introduction}
I want Introduction'' to have the same size and font
as it would in the default'' chapterstyle.
\end{document}
-
Ok, I tried Gonzalo's code, but for some reason I cannot use the code and include  \numtoName{\c@chapter} as part of any chapterstyle. Is there a particular reason why this is failing? Specially because I know that that particular code works (Using Dalief's suggestion, copied "brotherton" and tried you code, but it does not work). Any help? – tuxtlequino Apr 26 '12 at 8:14
Do you mind posting a full example? – daleif Apr 26 '12 at 9:59
@daleif I figure out yesterday night a way to make it work, but I my question still stands. I will simplify Gonzalo's code as an example. \documentclass{memoir} \makechapterstyle{mytest}{% \chapterstyle{mytest} \begin{document} \chapter{Introduction} I want Introduction'' to have the same size and font as it would in the default'' chapterstyle. \end{document} – tuxtlequino Apr 27 '12 at 4:22
Adding those two \renewcommand lines in the example, then the sizes are the same, so I don't see the problem – daleif Apr 27 '12 at 12:40