PDF output: How to prevent leaving section titles at the bottom of page with nothing following them

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
Olga P
Posts: 2
Joined: Wed Apr 10, 2019 2:32 pm

PDF output: How to prevent leaving section titles at the bottom of page with nothing following them

Post by Olga P » Wed Apr 10, 2019 2:49 pm

Hello,

I use Docbook 5.1, Saxon HE 9.8.0.12, and DockBook PDF scenario to build PDFs. How should I customize XSL to prevent leaving section titles at the bottom of page with nothing following them?

Radu
Posts: 6503
Joined: Fri Jul 09, 2004 5:18 pm

Re: PDF output: How to prevent leaving section titles at the bottom of page with nothing following them

Post by Radu » Thu Apr 11, 2019 1:54 pm

Hi Olga,

We are not very familiar with customizing DocBook but there is a free mailing list (<docbook-apps@lists.oasis-open.org>) on which you may want in the future to ask DocBook-related customization questions:

https://docbook.org/help

Coming back to your question:

The DocBook publishing uses Saxon 6 for publishing as the DocBook XSLT stylesheet have version 1.0.
In the XSLT stylesheet:

OXYGEN_INSTALL_DIR/frameworks/docbook/xsl/fo/param.xsl

there is an attribute set called "section.title.properties" which already has the "keep-with-next.within-column" attribute set to "always" so it should work by default.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Olga P
Posts: 2
Joined: Wed Apr 10, 2019 2:32 pm

Re: PDF output: How to prevent leaving section titles at the bottom of page with nothing following them

Post by Olga P » Tue Apr 16, 2019 3:06 pm

Hi Radu,

Thank you for your response. I found out that the <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute> works in case you don't have indexterms following a section title. If you have the stucture like this:

<section xml:id="CDU_DEFINING_COMMAND_VERBS">
<title>Defining Command Verbs</title>
<indexterm><primary>Command Definition Utility (CDU)</primary><secondary>defining verbs</secondary></indexterm>
<para>The DEFINE VERB statement defines a new command verb and specifies its characteristics. You
can define any number of verbs in a single command definition file.</para>

then in PDF, a section title may appear at the bottom of the page. Is there any way to prevent this?

Radu
Posts: 6503
Joined: Fri Jul 09, 2004 5:18 pm

Re: PDF output: How to prevent leaving section titles at the bottom of page with nothing following them

Post by Radu » Mon Apr 22, 2019 11:00 am

Hi,

I understand, because the indexterm follow the title (although the fo elements corresponding to them are probably hidden in the generated XSL-FO file) there indeed may appear a line break before the paragraph as the paragraph no longer directly follows the title.
I'm not sure how best to approach this, maybe you can define the index terms directly at the end of the title.
Or maybe some sort of XSLT customization which would migrate the index terms inside the title when publishing just to avoid this extra element which appears between the title and the first paragraph.
Maybe the people on the DocBook Apps users list may have better ideas about this.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply