Question
Is there a way to set a custom anchor that gets used by the TOC?
The problem I am having when there are multiple heading with the same text. Each will have the same anchor and clicking on any of them in the TOC will always goto the first occurance.
Example. Both Heading A and B have Sub A and B. There ends up being duped archors for each Sub.
Heading A
Sub A
Sub B
Heading B
Sub A
Sub B
Environment
--
TWikiGuest - 29 Nov 2006
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
Yeah - that's a known shortcoming.
What is usually done is to disambiguate the subheadings with a comment (see
VarTOC2). I usually write the comment in the beginning of the heading, quoting the top level head. You'll see the effect in the toc which you included:
Heading C
Sub A
Sub B
Heading D
Sub A
Sub B
In a long topic this has the the additional benefit that when editing you know exactly where you are
--
HaraldJoerg - 29 Nov 2006
Haralds workaround is correct, but I think TOC should handle this automagically, shouldn't it?
--
FranzJosefSilli - 29 Nov 2006
Yes, that has been stated in
TocBreaksOnIdenticallyNamedSections.
--
PeterThoeny - 29 Nov 2006