How can I start the TOC numbering with 0?

Comments

2 comments

  • Avatar
    Jens Rutschmann

    Hi George,

    you can do that by setting the initial value of the respective counter to -1:

    body {
    counter-reset: h1 -1;
    }

     

    If you also have a numbered TOC you'll want to add the following as well:

    ul.toc {
    counter-reset: li1 -1;
    }

    Normally each counter is initialized with 0 and when the first section heading (or TOC entry) appears the counter is increased and printed. By setting them to -1 you'll end up with the first chapter having a zero.

     

    Cheers,
    Jens

    0
    Comment actions Permalink
  • Avatar
    George

    Thanks. Works great.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk