## Section Numbers for PDF

Here should go questions about transforming XML with XSLT and FOP.
cbgarcia
Posts: 10
Joined: Tue Apr 23, 2013 11:48 pm

### Section Numbers for PDF

Hi,

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

Thank you.

Posts: 6566
Joined: Fri Jul 09, 2004 5:18 pm

### Re: Section Numbers for PDF

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,
<oXygen/> XML Editor
http://www.oxygenxml.com

Rushina
Posts: 5
Joined: Wed Nov 08, 2017 5:11 pm

### Re: Section Numbers for PDF

Hi,

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

Posts: 6566
Joined: Fri Jul 09, 2004 5:18 pm

### Re: Section Numbers for PDF

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,