# Hang section number, but not subsection number in Memoir

I use the memoir class to control my document. I have placed the section numbering in the margin with \hangsecnum, but I don't want the subsection and subsubsection numbering in the margin.

How do I prevent this?

-

## 1 Answer

Using the sectioning hooks would be an easy way:

\setsechook{\hangsecnum}
\setsubsechook{\defaultsecnum}
\setsubsubsechook{\defaultsecnum}


Edit: here's a minimal working example, according to the comments:

\documentclass{memoir}
\addtocounter{secnumdepth}{2}
\setsechook{\hangsecnum}
\setsubsechook{\defaultsecnum}
\setsubsubsechook{\defaultsecnum}
\begin{document}
\chapter{One}
\section{Section heading}
\subsection{Subsection heading}
\subsubsection{Subsubsection heading}
\end{document}


-
Sorry, I thought it worked but \setsechook{\hangsecnum} do not work – aagaard Jan 22 '11 at 13:21
@aagaard: "do not work" isn't a sufficient problem description. Better post error message, description of behavior, a minimal example. I added one showing how it works. – Stefan Kottwitz Jan 22 '11 at 13:34
I found out, that there is some compatibility issues with this package: titlesec. When it is included, it meshed up the indent. – aagaard Jan 22 '11 at 13:45
Why do you use titlesec in this context? – Thorsten Donig Jan 22 '11 at 14:01
To control the vertical space between the section title and the text. – aagaard Jan 22 '11 at 14:05