Add subsection to pdf toc
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 22
- Joined: Tue May 17, 2016 4:58 pm
Add subsection to pdf toc
Hello I have created a dita document containing subsextions:
How do I customize the default toc.xsl from the dita2pdf translation to include the section titles in the table of contents. I know that i can create individual nested topics to solve this but i prefer to be able to use sections. My ditamap contains 2 levels, so the sections should be included as a 3rd level toc item
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic_i4f_4hy_sw">
<title>Navigation overview</title>
<prolog>
<metadata>
<keywords>
<indexterm>Navigation</indexterm>
<indexterm>Menu bar</indexterm>
<indexterm>Document view</indexterm>
</keywords>
</metadata>
</prolog>
<body>
<section><title>The menu bar</title><p>bla bla bla</p></section>
<section><title>The document view</title><p>bla bla bla</p></section>
-
- Posts: 404
- Joined: Thu Aug 21, 2003 11:36 am
- Location: Craiova
- Contact:
Re: Add subsection to pdf toc
Post by radu_pisoi »
Hi,
We don't encountered a similar request until now, so I can't give you precise instruction about this request.
As you already found, you need to modify the functionality from 'toc.xsl' stylesheet. This is the stylesheet that contains templates used to produce the PDF TOC. Of course, in order to override the templates from 'toc.xsl' you need a PDF customization plugin that will contribute a customization stylesheet.
Now, about the changes you have to make in your customization stylesheet. I think you can inspire from the next template from toc.xsl:
that is used to produce an entry in TOC for each topic. Did you try to modify this template to handle also the sections?
Also, in order to develop your changes in this stylesheet, my advice is to instruct the DITA-OT processor to not clean the temporary directory produced by the PDF transformation(set the 'clean.temp' parameter to 'no'). After, you run the transformation once, you can open the 'temp/dita_map_MERGED.xml' and investigate it's content.
However, for this kind of request it is better to use the DITA users list http://dita.xml.org/dita-users. This mailing list is monitored by many DITA consultants that can offer you good advice.
We don't encountered a similar request until now, so I can't give you precise instruction about this request.
As you already found, you need to modify the functionality from 'toc.xsl' stylesheet. This is the stylesheet that contains templates used to produce the PDF TOC. Of course, in order to override the templates from 'toc.xsl' you need a PDF customization plugin that will contribute a customization stylesheet.
Now, about the changes you have to make in your customization stylesheet. I think you can inspire from the next template from toc.xsl:
Code: Select all
<xsl:template match="*[contains(@class, ' topic/topic ')]" mode="toc">
Also, in order to develop your changes in this stylesheet, my advice is to instruct the DITA-OT processor to not clean the temporary directory produced by the PDF transformation(set the 'clean.temp' parameter to 'no'). After, you run the transformation once, you can open the 'temp/dita_map_MERGED.xml' and investigate it's content.
However, for this kind of request it is better to use the DITA users list http://dita.xml.org/dita-users. This mailing list is monitored by many DITA consultants that can offer you good advice.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service