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 previously been renewing my section command in Memoir in order to style the section numbers by prefacing them with a symbol (§) and following them with a period:

\renewcommand{\thesection}{§ \arabic{section}.}

Werner has helpfully indicated in another post a way of putting the section numbers in the margin, getting rid of headings, and having the text body begin from the section numbers without any skip:

\hangsecnum
\counterwithout{section}{chapter}
\makeatletter
\newcommand{\hangsection}{%
  \savebox{\@tempboxa}{\normalfont\ }%
  \section{}\hspace*{-\wd\@tempboxa}%
}
\makeatother
\setaftersecskip{0pt}%

Could anyone indicate how to format the section numbers (e.g., with a symbol and a period) with such a new command? Many thanks.

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

You can modify the section number formatting function \setsecnumformat:

\setsecnumformat{\llap{\S\@nameuse{the#1}.\ }}

Here's a minimal example:

enter image description here

\documentclass{memoir}% http://ctan.org/pkg/memoir
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\hangsecnum
\counterwithout{section}{chapter}
\makeatletter
\setsecnumformat{\llap{\S\@nameuse{the#1}.\ }}
\newcommand{\hangsection}{%
  \savebox{\@tempboxa}{\normalfont\ }%
  \section{}\hspace*{-\wd\@tempboxa}%
}
\makeatother
\setaftersecskip{0pt}%
\begin{document}
\chapter{A chapter}
\hangsection\lipsum[1]
\hangsection\lipsum[2]
\end{document}

With XeLaTeX, you can use § instead of \S.

share|improve this answer
    
Many thanks, so helpful –  camatkara Jun 26 '12 at 3:57
add comment

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.