Forum How do I...?

Combined chapter count

yop
Hello,

I want to combine html files this way:
prince toc1.html chapter1.html chapter2.html document1.pdf

or
prince toc2.html chapter1.html chapter3.html document2.pdf


I need a chapter counter, so I declared:
div.chapter { counter-increment: chapter; }


And my chapterxxx.html content starts with:
<div class="chapter" ...>


But when I display count(chapter) (in the footer for instance) it is reseted to 1 at each chapter html input. How could I get a "global" chapter counter ?

Thanks
mikeday
At the moment multiple documents are each processed individually before being concatenated to make the final PDF, so it is not possible to have counters that are scoped across multiple documents.

One alternative solution would be use XInclude or external entities to combine multiple chapter documents into a single document that can then be styled as one single document. Note that this will only work if you're using well-formed XHTML, not "tag-soup" HTML.