Contents | Start | End | Previous: KB0223: Why does Kindlegen complain about PostScript in my embedded OTF fonts? | Next: KB0225: How can I switch off Kindle page flip so my Kindle Unlimited income is not reduced?


KB0224: How can I stop sections starting on a new page?

Most ereaders will start a new page for each separate file in the book. Each Jutoh document corresponds to a file in the Epub or Kindle book, and for ODT files, a page break will be inserted to be consistent with the other formats.

However, you might wish to create a lot of separate documents in Jutoh, for subsections that should not always start on a new page. In other words, you would like these smaller sections merged into their parent chapters.

To do this in Jutoh, you can use the configuration option Suppress section breaks and specify how you would like Jutoh to suppress the breaks (and merge a document into the previous document). These are the methods you can use, alone or in combination.

1. Using specific styles

You can use styles: <spec> in this option, where <spec> lists styles to match, separated by the pipe character. For example:

styles: Heading 2*|Heading 3*|Heading 4*

matches against headings at levels 2 to 4, and styles based on them (by virtue of the asterisk wildcards). When Jutoh finds a matching style as the first paragraph in a document, it will suppress the implied section break and append this document's content to the previous document.

2. Using existing page-break suppression

If you specify:

avoid-page-break: true

then Jutoh will look at the style of the first paragraph of each document. If the style contains the attribute "Avoid page break before paragraph", or is mentioned in the configuration option Styles suppressing page break before, this document's content will be merged into the previous document.

The disadvantage of this method is that you may not want to actually suppress all page breaks before this document; it may be quite legitimate to do so if the previous page has filled up the screen. Whether there is a problem depends on how the ereader interprets the attribute; it may ignore it if there is no choice but break to the page.

3. Using document depth

If you specify:

document-depth: 2

then Jutoh will merge any document that has been created as the child of another document and whose depth in the project hierarchy is the same or exceeds the number specified in document-depth.

Note that you can combine any of these methods by separating them with semicolons, and Jutoh will use any successful test to suppress the section break.

Don't forget to specify this option for all relevant configurations, including OpenDocument (ODT) configurations.

Disadvantages

If you use this facility, be aware of the following:

  1. Any properties you give the document that is merged into a previous document will be ignored, including guide types, JavaScript, custom CSS, and so on. The properties of the document that actually contains the section will apply instead. Similarly, when generating ODT, any page style specified for a merged document will be ignored.

  2. In this mode, Jutoh has to append identifiers to all bookmarks in order to ensure that they are unique. This may (or may not) be an inconvenience if you're importing the compiled file into another application such as an Epub editor or rely on the bookmarks being identical to the ones in the project.

  3. SMIL generation and narration will not currently work.


Contents | Start | End | Previous: KB0223: Why does Kindlegen complain about PostScript in my embedded OTF fonts? | Next: KB0225: How can I switch off Kindle page flip so my Kindle Unlimited income is not reduced?