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

Oxygen general issues.
bdew
Posts: 11
Joined: Mon Mar 03, 2014 5:11 pm
Location: Shawnee, KS

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

Post 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
Bryan
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

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

Post 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
bdew
Posts: 11
Joined: Mon Mar 03, 2014 5:11 pm
Location: Shawnee, KS

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

Post by bdew »

Sorin - I apologize. We are using .dita and .ditamap documents.

Thanks,

Bryan
Bryan
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

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

Post 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
bdew
Posts: 11
Joined: Mon Mar 03, 2014 5:11 pm
Location: Shawnee, KS

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

Post by bdew »

Worked!

Thanks so much!

Bryan
Bryan
mmkarimi
Posts: 2
Joined: Thu Jan 13, 2022 10:51 pm

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

Post 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
Last edited by mmkarimi on Mon Jun 12, 2023 5:59 pm, edited 1 time in total.
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

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

Post 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
Post Reply