Changing number format in ToC

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...

-

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.

-
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