Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 7 down vote accepted

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}
share|improve this answer

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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.