View Single Post
Old 09-12-2012, 06:01 AM   #2
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 1,854
Karma: 4630359
Join Date: Dec 2010
Device: Kindle PW2
AFAIK, Sigil uses the heading_id tags for the automatic TOC generation. For some odd reason it restarts numbering for each .xhtml source page, however, this doesn't affect TOC generation.

If you want consecutive id tags to simplify the generation of an inline TOC, activate the regular expressions mode, search for id="heading_id_\d+" and replace it with nothing.

Then use a regular expression to add a heading id number based on the chapter number and regenerate the TOC. For example, for a simple h1 chapter heading that contains only the chapter number (e.g. <h1>12</h1>) you'd use:

Find: <h1>(\d+)</h1>
Replace: <h1 id="heading_id_\1">\1</h1>
Doitsu is offline   Reply With Quote