Edit online

Titles

Titles in PDF can be classified into two categories:
  • Table of contents titles, identified by the map/topicref and topic/navtitle class attributes.
  • Content titles, that can be styled by matching the topic/title class attribute.
Edit online

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.
Edit online

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";
}
Edit online

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;
}
Edit online

How to Display Chapters Title on a Separate Page

You may want to display the chapters title on a separate page (for example, with a background). To do this, a new page should be defined in your customization CSS:
@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;
}