Page 1 of 1

Customize TOC

Posted: Thu Dec 15, 2022 7:32 pm
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"?

Re: Customize TOC

Posted: Fri Dec 16, 2022 8:35 am
by xephon
I think you need to override one of these attribute sets: https://github.com/dita-ot/dita-ot/blob ... f-attr.xsl

Re: Customize TOC

Posted: Fri Dec 16, 2022 10:35 am
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

Re: Customize TOC

Posted: Tue Dec 20, 2022 11:36 am
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!