# Chapter subtitle

I want a chapter subtitle (half the size of the font of the chapter title) within the rulers of the chapter title. The subtitle must not appear in the Table of Contents. I have this

\makechapterstyle{mychapterstyle}{%
\renewcommand{\chapnamefont}{\LARGE\sffamily\bfseries}%
\renewcommand{\chapnumfont}{\LARGE\sffamily\bfseries}%
\renewcommand{\chaptitlefont}{\Huge\sffamily\bfseries}%
\renewcommand{\printchaptertitle}[1]  {%
\chaptitlefont\hrule height 0.5pt \vspace{1em}%
{##1}\vspace{1em}\hrule height 0.5pt%
}%
\renewcommand{\printchapternum}{%
\chapnumfont\thechapter%
}%
}
\chapterstyle{mychapterstyle}


Can someone help?

-

## migrated from stackoverflow.comOct 16 '12 at 18:19

This question came from our site for professional and enthusiast programmers.

The easiest might be to double the argument to \chapter by using both the (optional) ToC-entry as well as the (mandatory) sectional heading, removing the sub-heading from the former. Here's an example:

\documentclass{memoir}% http://ctan.org/pkg/memoir
\makechapterstyle{mychapterstyle}{%
\renewcommand{\chapnamefont}{\LARGE\sffamily\bfseries}%
\renewcommand{\chapnumfont}{\LARGE\sffamily\bfseries}%
\renewcommand{\chaptitlefont}{\Huge\sffamily\bfseries}%
\renewcommand{\printchaptertitle}[1]  {%
\chaptitlefont\hrule height 0.5pt \vspace{1em}%
{##1}\vspace{1em}\hrule height 0.5pt%
}%
\renewcommand{\printchapternum}{%
\chapnumfont\thechapter%
}%
}
\\{\normalsize #1}%
}
\chapterstyle{mychapterstyle}
\begin{document}

\tableofcontents*
\chapter[This is a chapter]% ToC entry

\end{document}​


The newly defined \chapsubhead inserts a forced line break, and groups the sub heading to localize any font changes (currently set to \normalsize). You could define a new macro like \chapsubheadfont that you can redefine however you want to. But it would seem that one would need a consistent formatting across your document, and therefore a macro containing this as-is should suffice.

The alternative might be to open the bowels of the \chapter setting and insert a subhead. An interface would have to be created or done similar to the \maketitle command of memoir where a definition is removed after it's used. This is what I mean by such a user interface:

\setchaptersubhead{This is a sub-heading for this chapter}
\chapter{This is a chapter}


where \chapter would remove any definition set by \setchaptersubhead once the chapter heading is complete (so it doesn't spill over to subsequent chapters). Although it can be done, this might be sufficient for your usage.

-
If carefull one can also overload \chapter to take an extra optional but braced option using the xparse package. –  daleif Oct 16 '12 at 20:11