Forum How do I...?

Chapter numbering in TOC; brain fade

SLA_Scott
I just upgraded from version 7 to version 8 (yeah, a little behind the times).

In the past, I have had my TOC set up to automatically insert a chapter number above the set of sections that make up the chapter, using a simple incremental counter for the number. This worked just dandy, except now it doesn't anymore. Every chapter inserted with the counter shows as "1."

The infuriating thing is that I seem to remember this happening before during a previous version change, and I figured it out, but now I can't remember what I did to fix it. Can anyone nudge me?

This is the markup:

#table_of_contents
{
    page-break-after: always;
    page-break-before: always;
    page: blank;
    counter-reset: page;
}
ul.toc, ul.toc ul { 
  list-style-type: none;
  margin: 0; padding: 0;
}
ul.toc ul {
  margin-left: 1em;
  font-weight: normal;
}
ul.toc > li { 
  
}
ul.toc a::after {
  content: leader('.') target-counter(attr(href), page);
  font-style: normal;
}

ul.toc > li.chapter::before {
  content: "Chapter " counter(toc-chapter, decimal);
  display: block;
  counter-increment: toc-chapter;
  page-break-after: avoid;
}

    <div id='table_of_contents'>
    <ul class='toc'>
    <li class='chapter'><a href='#1'>1 Linking Sound Categories</a></li>
    <li><a href='#1.1'>1.1 Linking Vowels into Vowels</a></li>
    <li><a href='#1.2'>1.2 Linking Same Continuous Consonants</a></li>
    <li><a href='#1.3'>1.3 Linking Fricative Pairs</a></li>
    <li><a href='#1.3.1'>1.3.1 Exercise: Linking Fricative Pairs</a></li>
    <li class='chapter'><a href='#2'>2 Linking Transcription Symbols</a></li>
    <li><a href='#2.1'>2.1 Linking References</a></li>
    </div>
mikeday
How about applying "counter-reset: toc-chapter" on the <ul>?
SLA_Scott
Bingo! Thank you, that did it.