Titles
- Table of contents titles, identified by the
map/topicref
andtopic/navtitle
class attributes. - Content titles, that can be styled by matching the
topic/title
class attribute.
How to Control Titles Layout
By default, titles are rendered on a single line (with both the chapter/section number and title text). If the title is too long, the text wraps to the next line without any indentation.
4.5.5 This is a long title
text that wraps.
If you want each line of the title to start at the same location (and
indented), you need to set the value of the args.css.param.title.layout
transformation parameter to table. This means that the chapter/section number is placed
in one cell and title text is placed in another cell (resulting and indented text):
4.5.5 This is a long title
text that wraps.
How to Change Chapters Title Prefix
Changing Prefixes in Shallow Numbering
In shallow numbering (default), to replace the "Chapter N." prefix, use the following rules in your customization CSS:
*[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicmeta"] > *[class ~= "topic/navtitle"]:before{
content: "Module " counter(toc-chapter, decimal-leading-zero) " - ";
}
*[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/title"]:before {
content: "Module " counter(chapter, decimal-leading-zero) "\A";
}
Changing Prefixes in Deep Numbering
In deep numbering, to replace the "N." prefix, use the following rules in your customization CSS:
*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/title"]:before,
*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "topic/topic"][is-chapter]:not([is-part]) *[class ~= "topic/topic"] > *[class ~= "topic/title"]:before {
content: counters(chapter-and-sections, ".") "\A";
}
How to Remove Parts and Chapter Title Prefixes
Removing Prefixes in Shallow Numbering
In shallow numbering (default), to hide the "Part N" and "Chapter NN" prefixes, use the following rules in your customization CSS:
*[class ~= "map/topicref"] > *[class ~= "map/topicmeta"] > *[class ~= "topic/navtitle"]:before {
display: none !important;
}
*[class ~= "topic/topic"] > *[class ~= "topic/title"]:before {
display: none !important;
}
You can also choose to remove only the "Part N" prefix:
*[class ~= "map/topicref"][is-part] > *[class ~= "map/topicmeta"] > *[class ~= "topic/navtitle"]:before {
display: none !important;
}
*[class ~= "topic/topic"][is-part] > *[class ~= "topic/title"]:before {
display: none !important;
}
Or to remove only the "Chapter NN" prefix:
*[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicmeta"] > *[class ~= "topic/navtitle"]:before {
display: none !important;
}
*[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/title"]:before {
display: none !important;
}
Removing Prefixes in Deep Numbering
In deep numbering, to hide the "Part N" and "Chapter NN" prefixes, use the following rules in your customization CSS:
*[class ~= "map/map"][numbering ^= 'deep'] *[class ~= "map/topicref"] > *[class ~= "map/topicmeta"]:before {
display: none !important;
}
*[class ~= "topic/topic"] > *[class ~= "topic/title"]:before {
display: none !important;
}
How to Display Chapters Title on a Separate Page
@page chapter-title-page {
background-image: url("resources/title-bg.png");
background-repeat: no-repeat;
background-size: 100% 100%;
background-position: center;
}
After that, you need to replace the default "chapter" page definition with the
one created
before:*[class ~= "topic/topic"][is-chapter] {
page: chapter-title-page;
}
Then, you need to set it back on the content following the
title:*[class ~= "topic/topic"][is-chapter] > *[class ~= "topic/title"] ~ *:not([class ~= "topic/title"]) {
page: chapter;
}
Finally, you can customize the title color, size, and
more:*[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/title"] {
color: white;
font-size: 32pt;
}