How to style TOC elements - both in the TOC and within the document?

Having trouble installing Oxygen? Got a bug to report? Post it all here.
DAN SEA
Posts: 59
Joined: Tue Sep 13, 2022 4:13 pm

How to style TOC elements - both in the TOC and within the document?

Post by DAN SEA »

Hello everybody!
I would appreciate any help with the following:
My TOC contains 4 levels. Some chapters contain directly in the title of the chapter - sections highlighted by msgph.
1. It is necessary to make sure that this selection is not reset in TOC (now it is reset by default);
2. It is necessary at the 3rd level - in the TOC and inside the document - to change the font size and make it italic. I have tried changing

Code: Select all

*[class ~= "map/topicref"]
for this, as well as

Code: Select all

*[class ~= topic/topic] > *[class ~= 'topic/title' ]
. (Addition question: how to do this for any level?).

But so far nothing has worked.
I would be glad for any advice!
julien_lacour
Posts: 498
Joined: Wed Oct 16, 2019 3:47 pm

Re: How to style TOC elements - both in the TOC and within the document?

Post by julien_lacour »

Hello,

I added an issue related to reset inline elements in TOC, I will notify this thread once resolved.

Until then you can repair it by using an XSLT extension, don't worry I already created it and the publishing template declaring it.
I also created a custom.css stylesheet that change the TOC depth to 4 and change the style on the 3rd level on both TOC and Content.
custom.zip
(6.34 KiB) Downloaded 83 times
In order to use the sample you just need to download and unzip it.
To refer the publishing template, in Oxygen, simply edit the DITA Map PDF - based on HTML5 & CSS scenario, choose the custom.opt file in the Templates tab and run the transformation.

Regards,
Julien
DAN SEA
Posts: 59
Joined: Tue Sep 13, 2022 4:13 pm

Re: How to style TOC elements - both in the TOC and within the document?

Post by DAN SEA »

Thank you very much, Julien, for your attention to my question,
I'll wait for the solution to the software flaw that you noted ...

Now I tried to apply the settings and there were a problem:

As for the publication template: unfortunately, I saw a strange problem - I suspect that this happened after yesterday, following the advice here , I tried to change the distance from the pictures to their titles (this attempt automatically reset all my settings and export scenarios - I had to manually restore everything): in my scenario settings - the "Templates" tab disappeared! Here is such a strange thing. Previously was...
Therefore, I could not apply your template. Maybe, of course, I'm doing something wrong ... But my tabs there look like this: Parameters - Filters - Advanced - Output (Templates disappeared somewhere).
How can I restore it, maybe you know?
julien_lacour
Posts: 498
Joined: Wed Oct 16, 2019 3:47 pm

Re: How to style TOC elements - both in the TOC and within the document?

Post by julien_lacour »

Hello,

The new Oxygen 25.1 is out, in this version we correct the inline elements behavior in TOC.

Regards,
Julien
Post Reply