Page 1 of 1

Section Numbers for PDF

Posted: Thu Sep 12, 2013 6:05 pm
by cbgarcia
Hi,

How can I add a leading section number in a PDF output of a bookmap? For example:
1 Heading 1
1.1 Heading 2
1.2 Heading 2
2 Heading 1
and so on.

Thank you.

Re: Section Numbers for PDF

Posted: Fri Sep 13, 2013 11:55 am
by Radu
Hi,

Oxygen uses the DITA Open Toolkit to publish DITA content to various output formats like PDF.
By default when a bookmap is published to PDF, if you refer top-level topics using the <chapter> or <part> elements instead of <topicref>, the chapters will appear numbered both in the TOC and in the content.
If you want to do this for other topic references as well you will need to write a DITA OT PDF customization:

http://www.oxygenxml.com/doc/ug-oxygen/ ... ation.html

In the XSLT stylesheet:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\plugins\org.dita.pdf2\xsl\fo\toc.xsl

there are templates like:

Code: Select all

<xsl:template match="*[contains(@class, ' bookmap/chapter ')] |
*[contains(@class, ' boookmap/bookmap ')]/opentopic:map/*[contains(@class, ' map/topicref ')]" mode="tocPrefix" priority="-1">
which are used to compute the TOC prefix number so you would probably need to provide additional templates matching your type of references.

Regards,
Radu

Re: Section Numbers for PDF

Posted: Fri Jan 04, 2019 9:01 am
by Rushina
Hi,

In spite of turning on autolabel parameters for sections, the sections do not appear numbered either in ToC nor in bookmarks. Please help.

Re: Section Numbers for PDF

Posted: Tue Jan 08, 2019 10:38 am
by Radu
Hi,

This particular forum thread is for generating PDF from DITA.
Those parameters "section.label.includes.component.label" that you are trying to set seem to be for DocBook. Are you generating PDF from DocBook content? If so, there is a "docbook-apps" users list on which you could register and ask:

https://docbook.org/help

Regards,
Radu

Re: Section Numbers for PDF

Posted: Tue Jan 08, 2019 12:47 pm
by Rushina
Thank you, Radu. I found the answer where I had to change values in two files and just one which was causing the issue. Thank you, nevertheless.