Hide Forgot
Description of problem: Would like to be able to specify TOC depth in PDF files. Current behaviour seems to be to display all chapter and section heading levels used in the document. Version-Release number of selected component (if applicable): 4.0 How reproducible: Always Steps to Reproduce: 1. Build any book with extended section depth (3 or 4) 2. Compare PDF and HTML outputs 3. HTML honors toc_section_depth parameter in publican.cfg but PDF does not Actual results: If book contains chapter and section headings down to level 4, 5, or beyond, they all appear in the TOC. Expected results: Would like ability to set TOC_DEPTH=<num> to limit depth to (e.g.) 1.2.3. This improves the usability of the TOC itself and if desired can be set to match that used by html output. Additional info: Comments from IRC exchange: rudi: what problem are you trying to solve? davido: just wondering if we can match up TOC depth between the two outputs davido: 3.1.4.7.1. Using Templates davido: gets a bit scary rudi: I don't think "The ToC depths is different in html and pdf" is something we'd try to solve, given that pdf is not html rudi: But if the ToC depth is unreasonable in PDF per se, then yeah, that's a bug rudi: FWIW, it looks like it's configurable, but maybe not on a book-by-book basis: http://code.google.com/p/wkhtmltopdf/issues/detail?id=772 rudi: I'm pretty sure it's configurable in DocBook, which would mean just exposing that control rudi: Yeah, it is: http://docbook.sourceforge.net/release/xsl/1.77.0/doc/html/toc.section.depth.html
This should be available via the wkhtmltopdf_opts cfg parameter. e.g. add this to publican.cfg wkhtmltopdf_opts: "--outline-depth 3" Can you try this please?
Tried a few variations of wkhtmltopdf_opts: "--outline-depth 3" but it only impacts the outline depth in the nav bar on the side pane (in Evince). It doesn't impact the TOC depth at all.
Pass chunk_section_depth to wkhtmltopdf. To ssh://git.fedorahosted.org/git/publican.git 376ae38..58bf708 devel -> devel
A fix for this shipped in Publican 4.1.0.