I see in memoir that \section is implemented like so:

  \@startsection{section}{1}%  level 1
      {\secindent}%            heading indent
      {\beforesecskip}%        skip before the heading
      {\aftersecskip}%         skip after the heading
      {\normalfont\secheadstyle}} % font
  \setbeforesecskip{-3.5ex \@plus -1ex \@minus -.2ex}
  \setaftersecskip{2.3ex \@plus .2ex}
%%%  \setsecheadstyle{\Large\bfseries\raggedright}

I thought I'd try color'izing my section numbers, and first tried:


This didn't work, since the scope of the blue was everything after and including the section. Next I tried:


This is better, but color'izes the section number and the section title. I can't see in the \section implementation above where the counter is, so I think I'm looking in the wrong place.

Here's a MWE for my busted attempt:




\subsection{more stuff}
\subsubsection{even more stuff}


This produces

attempt at colorizing

I also see that I've lost subsection and subsubsection numbers (which I had with the book class). So two questions:

  • How can I get back my sub and subsub section numbers?
  • How would one color just the section numbers (and subsection numbers once I get them back)?

1 Answer 1


To control the level up to which sectional units will be numbered, you can use \setsecnumdepth{<sectional unit>}; to color the sectional unit numbers, you can use \setsecnumformat:


\setsecnumformat{\color{blue}\csname the#1\endcsname\quad}


\subsection{more stuff}
\subsubsection{even more stuff}


enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .