5

I'd like to change the styling of \subsection in the memoir class.

The example is:

\documentclass[oneside, 12pt]{memoir}

\begin{document}
\subsection{A subsection - center me!}
\end{document}

This is easy enough with sections, eg

\setsecnumformat{Section \arabic{section}. \space}
\setsecheadstyle{\bfseries\large\centering}

However I wasn't able to find an equivalent for subsections. Is there one, or some alternative?

lockstep
  • 250,273
Brian M. Hunt
  • 14,277

2 Answers2

7

Using \setsubsecheadstyle{\bfseries\large\centering} seems to do the job:

enter image description here

The geometry package was included only to show the frame of the page for the image capture.

\documentclass[oneside, 12pt]{memoir}
\usepackage[showframe]{geometry}

\begin{document}
\subsection{A subsection - center me!}

\setsubsecheadstyle{\bfseries\large\centering}
\subsection{B subsection - center me!}
\end{document}
Peter Grill
  • 223,288
2

For the centering part see Peters solution

The \setsecnumformat is not a good name in this context, because in this case the sec part is not changeable (it is a name that has been used in LaTeX). Here is one way to extend it

\setsecnumformat{\csname my#1secformat\endcsname}
\newcommand\mysectionsecformat{Section \thesection. \space}
\newcommand\mysubsectionsecformat{Subsection \thesubsection. \space}
\newcommand\mysubsubsectionsecformat{Subsubsection \thesubsubsection. \space}
daleif
  • 54,450