Customize TOC

Post here questions and problems related to editing and publishing DITA content.
[Stupid]_[User]
Posts: 21
Joined: Mon Dec 05, 2022 9:35 am

Customize TOC

Post by [Stupid]_[User] »

Hello everyone!

I use "toc", "tablelist" and "figurelist" in my "ditamap". I can easily customize "toc" with font I need, but I can't do the same with my "tablelist" and "figurelist". Is it any way to change font style, size and etc in these "booklists"?
xephon
Posts: 160
Joined: Mon Nov 24, 2014 1:49 pm
Location: Greven/Germany

Re: Customize TOC

Post by xephon »

I think you need to override one of these attribute sets: https://github.com/dita-ot/dita-ot/blob ... f-attr.xsl
stefan-jung.org – Your DITA/DITA-OT XML consultant
julien_lacour
Posts: 667
Joined: Wed Oct 16, 2019 3:47 pm

Re: Customize TOC

Post by julien_lacour »

Hello,

Which transformation scenario are you using? The attribute-sets solution is valid for the DITA Map PDF - based on XSL-FO scenario:

Code: Select all

<xsl:attribute-set name ="__lotf__heading" use-attribute-sets="__toc__header">
    <xsl:attribute name="font-size">40pt</xsl:attribute>
  </xsl:attribute-set>
  
  <xsl:attribute-set name ="__lotf__content" use-attribute-sets="base-font __toc__topic__content__booklist">
    ...
    <xsl:attribute name="font-size">36pt</xsl:attribute>
  </xsl:attribute-set>
For the DITA Map PDF - based on HTML5 & CSS scenario you can use rules similar to these ones:

Code: Select all

*[class ~= "placeholder/figurelist"] > *[class ~= "topic/title"] {
  font-size: 40pt;
}
*[class ~= "placeholder/figurelist"] > *[class ~= "listentry/entry"] {
  font-size: 36pt;
}

*[class ~= "placeholder/tablelist"] > *[class ~= "topic/title"] {
  font-size: 40pt;
}
*[class ~= "placeholder/tablelist"] > *[class ~= "listentry/entry"] {
  font-size: 36pt;
}
FYI you can debug the CSS using your favorite browser, this will help you identify, modify and create CSS rules.

Regards,
Julien
[Stupid]_[User]
Posts: 21
Joined: Mon Dec 05, 2022 9:35 am

Re: Customize TOC

Post by [Stupid]_[User] »

julien_lacour wrote: Fri Dec 16, 2022 10:35 am Hello,

Which transformation scenario are you using? The attribute-sets solution is valid for the DITA Map PDF - based on XSL-FO scenario:

Code: Select all

<xsl:attribute-set name ="__lotf__heading" use-attribute-sets="__toc__header">
    <xsl:attribute name="font-size">40pt</xsl:attribute>
  </xsl:attribute-set>
  
  <xsl:attribute-set name ="__lotf__content" use-attribute-sets="base-font __toc__topic__content__booklist">
    ...
    <xsl:attribute name="font-size">36pt</xsl:attribute>
  </xsl:attribute-set>
For the DITA Map PDF - based on HTML5 & CSS scenario you can use rules similar to these ones:

Code: Select all

*[class ~= "placeholder/figurelist"] > *[class ~= "topic/title"] {
  font-size: 40pt;
}
*[class ~= "placeholder/figurelist"] > *[class ~= "listentry/entry"] {
  font-size: 36pt;
}

*[class ~= "placeholder/tablelist"] > *[class ~= "topic/title"] {
  font-size: 40pt;
}
*[class ~= "placeholder/tablelist"] > *[class ~= "listentry/entry"] {
  font-size: 36pt;
}
FYI you can debug the CSS using your favorite browser, this will help you identify, modify and create CSS rules.

Regards,
Julien
Hello, Julien!

I use DITA Map PDF - based on HTML5 & CSS scenario. Your solution resolved my problem.

Thanks a lot!
Post Reply