Page 1 of 1

Remove parent in toc from pdf but not children

Posted: Fri Oct 31, 2025 3:47 pm
by Leighb
I am using Oxygen and Chemistry 27.1 I know that it is common to have multiple ditamaps for different output but for a variety of reasons, we have just one. In the print, we have some Title Pages that only appear in the print. They have the same title as the next Intro Page of dita content (a sibling to the Title Page). That Intro Page has nested content. I would like the toc to point to the Title Page of the book but I don't want to see the duplicate titles in the toc. Obviously, if I add toc="no" to the Intro Page, all the nested content is removed as well. I want to see the nested content in the toc just not the Intro Page title. In my research, I found that adding toc="yes" to the nested content might work. It did not. Is there away around this that I am not seeing?

Thanks,
Leigh

Re: Remove parent in toc from pdf but not children

Posted: Mon Nov 03, 2025 10:41 am
by julien_lacour
Hello Leigh,

If I understand correctly, your current ditamap structure leads to duplicate entries in the PDF TOC.
If you are using a DITA Map PDF - based on HTML5 & CSS based scenario you should be able to filter the extra title by debugging the CSS in your favorite browser, simply match one of the titles, and remove it with display: none.

Regards,
Julien

Re: Remove parent in toc from pdf but not children

Posted: Mon Nov 03, 2025 8:52 pm
by Leighb
Thanks Julien. I am using DITA Map PDF - based on HTML5 & CSS. You are correct that I have a duplicate title. I don't want to remove the 2nd title from anything except in the TOC for the PDF/print. The Title page only appears in the print (audience="print" in the ditamap). I still need the Intro file (and the nested content) to be present in the pdf (and elsewhere) which is why I was hoping that toc="yes" on the nested content would work since that is exactly what I need. Won't display:none remove the title from all output? Maybe I misunderstood your comment?

Thanks,
Leigh

Re: Remove parent in toc from pdf but not children

Posted: Tue Nov 04, 2025 11:19 am
by julien_lacour
Hello Leigh,

If you open the merged.html file generated during the transformation in your browser and inspect its structure, you will see that each title is contained in its own element, so you should be able to filter it using display: none in a custom CSS stylesheet. In a similar way the titles in the rest of the PDF content are different elements, so discarding the elements in the TOC will not affect the other titles.

Regards,
Julien

Re: Remove parent in toc from pdf but not children

Posted: Wed Nov 05, 2025 8:18 pm
by Leighb
Julien, thanks for the clarifications. I will give that a try!

Leigh