asciidoctor / asciidoctor-fopub

A portable DocBook-to-PDF build command that wraps DocBook XSL and Apache FOP
MIT License
113 stars 37 forks source link

Cannot figure out correct way to number chapters using Asciidoctor and asciidoctor-fopdf #3

Open paulrayner opened 10 years ago

paulrayner commented 10 years ago

Hopefully this is a simple misunderstanding/ignorance on my part. See https://gist.github.com/paulrayner/6386391 for details and example.

Thanks for the help!

I was just looking through the issues tagged as 1.4 and noticed https://github.com/asciidoctor/asciidoctor/issues/393, but can't see what I'm doing wrong. Maybe this should be an Asciidoctor issue rather than asciidoctor-fopdf, or a post to the Asciidoctor forum?

mojavelinux commented 10 years ago

The issue here is that the numbered attribute entries interspersed in the AsciiDoc document do not affect the DocBook output (and, subsequently, the DocBook toolchain). Those flags are used exclusively in the HTML backend. The numbered attribute is a global setting in the DocBook output.

In order to control numbering in the DocBook toolchain, you have to modify the DocBook XSL templates (oh, the horror!). You would need to figure out where the template you need to override is buried in the DocBook XSL distribution and copy it into src/dist/docbook-xsl/fo-pdf.xsl. Then you would need to tweak it.

I'm glad you brought this up because it's an important FAQ for Asciidoctor that I had never thought about.

DavidGamba commented 10 years ago

You might want to check this: http://www.sagehill.net/docbookxsl/FOSectionNumbering.html If you want to dive into the templates.