pdf-generationditadita-ot

How can I add auto generated labels for topic titles in PDF output using DITA-OT?


I'm generating a PDF using DITA-OT. I'd like to add labels to topic titles such as "Exercise 1:". I know that we can do this by adding variables to the en.xml file for section titles, chapter titles, etc. How can we extend this functionality to topic titles?

More specifically, I want to add "Exercise: #" and "Task: #" to Heading level 1 and Heading level 2 topic titles.


Solution

  • In the XSLT stylesheet "dita-ot/plugins/org.dita.pdf2/xsl/fo/topic.xsl" there is a template which matches the topic title:

    <xsl:template match="*" mode="processTopicTitle">
    

    Maybe you can create a PDF customization plugin which overwrites this XSLT template and adds your own changes to it.