Home › Forums › DITA and XMetaL Discussion › How to add leading numbers in headings for PDF output? › Reply To: How to add leading numbers in headings for PDF output?
Reply to: How to add leading numbers in headings for PDF output?March 16, 2009 at 11:24 pm
To add numbering to topic titles, you will have to override two XSL templates from [xmfo]/xsl/fo/commons.xsl:
“processTopicTitle” from ~line 580, and “getTitle” from ~1220.
The “getTitle” override controls display in the body text and TOC, and “processTopicTitle” renders the link text for inline xrefs.
Copy both of these templates into your customization file: [xmfo]/Customization/fo/xsl/custom.xsl
1. For “getTitle”, add a variable called “level”:
Now you can use the value of “level” in the choose statement – add this just before the
2. For “processTopicTitle”, add a variable called “level” after the “element” variable:
Further down in the template, just before the
This should get you started – you may have to tweak some of the xsl:number attributes (@from, @level, etc.) to get the exact numbering you're after.