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'm using the tocloft package to alter the looks of my table of contents, but there's one thing I can't find in the documentation: splitting the number by level, to insert other delimiters than ".".

I'd like to have my ToC formatted in the following way:

1 § The First Section
     1 § 1. The First Subsection of the First Section
     1 § 1. The Second Subsection of the First Section
2 § The Second Section
etc...

To set the section level numbering, I use \renewcommand\cftsecaftersnum{ \S\ } which works like a charm. But I can't figure out how to get between the section and subsection counter on the subsection numbers.

For the record, numbers on the actual subsection headers are already using the desired format. It unfortunately does not carry over to the ToC...

share|improve this question

1 Answer 1

up vote 7 down vote accepted

If you redefine \thesubsection it would carry over to the TOC:

\renewcommand*{\thesubsection}{\thesection~\S~\arabic{subsection}}

Or start by adding it to \thesection:

\renewcommand*{\thesection}{\arabic{section}~\S}
\renewcommand*{\thesubsection}{\thesection~\arabic{subsection}}

Note, I used ~ instead of \ because a line break between number and § is not very desirable.

share|improve this answer
    
It took a while to figure out exactly which changes were needed (the number formats also carry over to enumerate environments...) but when I did, it works like a charm! =) –  Tomas Lycken Nov 21 '10 at 12:48

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.