Page 1 of 1

PDF Output - Having TOC show 4 levels, instead of 3

Posted: Mon Mar 03, 2014 5:26 pm
by bdew
With PDF output customization, is there a way to have the Table of Contents go 4 levels deep, instead of 3?

4 Level Example:

Code: Select all


Account Reconciliation
* Reconciliation EOD
- Standard Procedures
+ Step 1
+ Step 2
+ Step 3
- Holiday Procedures
RCMENU
* Menu Layout
- Header Modifications
- Footer Modifications
RCTRAN
* Menu Layout

As it is now:

Code: Select all


Account Reconciliation
* Reconciliation EOD
- Standard Procedures
- Holiday Procedures
RCMENU
* Menu Layout
- Header Modifications
- Footer Modifications
RCTRAN
* Menu Layout
Thank you,

Bryan

Re: PDF Output - Having TOC show 4 levels, instead of 3

Posted: Mon Mar 03, 2014 5:31 pm
by sorin_ristache
What type of XML document is the input of the PDF transformation: DocBook, DITA, etc. ? Is it one of the Oxygen predefined document types, which you can see from menu Options -> Preferences -- Document Type Association?


Regards,
Sorin

Re: PDF Output - Having TOC show 4 levels, instead of 3

Posted: Mon Mar 03, 2014 6:11 pm
by bdew
Sorin - I apologize. We are using .dita and .ditamap documents.

Thanks,

Bryan

Re: PDF Output - Having TOC show 4 levels, instead of 3

Posted: Mon Mar 03, 2014 6:53 pm
by sorin_ristache
Adding a parameter for the depth of the Table of Contents was discussed but it was rejected. So there is no parameter for that in the current version but you can increase the TOC depth by increasing the value of the parameter called tocMaximumLevel in the file:

Code: Select all

[Oxygen-install-dir]\frameworks\dita\DITA-OT\plugins\org.dita.pdf2\xsl\fo\topic2fo.xsl
which is set to 4 by default:

Code: Select all

<xsl:param name="tocMaximumLevel" select="4"/>

Regards,
Sorin

Re: PDF Output - Having TOC show 4 levels, instead of 3

Posted: Mon Mar 03, 2014 7:14 pm
by bdew
Worked!

Thanks so much!

Bryan

Re: PDF Output - Having TOC show 4 levels, instead of 3

Posted: Thu Jan 13, 2022 11:12 pm
by mmkarimi
I actually was able to find the solution myself. You should add the following script to the CSS to set the TOC dept higher than 3:

*[class ~= "map/topicref"][is-chapter] >
*[class ~= "map/topicref"]:not([is-chapter]) >
*[class ~= "map/topicref"] >
*[class ~= "map/topicref"]{
display:block;
}

I found this in this reference:

http://docplayer.net/190943699-Oxygen-d ... guide.html

Re: PDF Output - Having TOC show 4 levels, instead of 3

Posted: Fri Jan 14, 2022 11:41 am
by julien_lacour
Hello,

I did a test in <oXygen/> XML Editor 24.0, build 2021121518, using args.css.param.numbering=deep, your CSS should look like this:

Code: Select all

*[class ~= "map/topicref"][is-chapter] > 
*[class ~= "map/topicref"]:not([is-chapter]) > 
*[class ~= "map/topicref"] > 
*[class ~= "map/topicref"] {
  display: block;
}

*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicref"] > *[class ~= "map/topicref"] *[class ~= "map/topicref"] {
  counter-increment: toc-chapter-and-sections;
}

*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicref"] > *[class ~= "map/topicref"] *[class ~= "map/topicref"] > *[class ~= "map/topicmeta"] + *[class ~= "map/topicref"] {
  counter-reset: toc-chapter-and-sections;
}

*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicref"] > *[class ~= "map/topicref"] > *[class ~= "map/topicref"] *[class ~= "map/topicref"] > *[class ~= "map/topicmeta"]:before {
  content: counters(toc-chapter-and-sections, ".") ". ";
}
You should modify your counter declaration to use the above one instead, if you have issues identifying the applied rules, you can debug your CSS.

Regards,
Julien