This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
[docbook-apps] widow/orphan & subsection font size
- From: Tristan Fiedler <fiedler at cshl dot edu>
- To: Docbook-Apps <docbook-apps at lists dot oasis-open dot org>
- Cc: Lisa Girard <lgirard at its dot caltech dot edu>
- Date: Fri, 27 May 2005 20:20:04 -0400
- Subject: [docbook-apps] widow/orphan & subsection font size
Software : DocBook 4.4CR2, XSL 1.67.2, FOP 0.20.5, and Saxon 6.5.3
I have looked through the online DocBook guide, as well as the DocBook
XSL book and find essentially nothing on widow / orphan control.
How can I prevent "title" widows / orphans from occurring? I am
referring here to <sect2> titles being at the bottom of a page, and the
first paragraph of text for that section beginning on the next page.
(I did not see any problems with the <sect1> titles, but this may be
coinincidence). I have tried the following with no success :
<xsl:attribute-set name="root.properties">
<xsl:attribute name="widows">4</xsl:attribute>
<xsl:attribute name="orphans">4</xsl:attribute>
Perhaps a keep-together with directive? Could someone please give an
example? A have seen many report that FOP 0.20.5 only supports keep-*
within table? Could someone give an example of using a "blind" table
to keep the following title together the first paragraph:
<sect2>
<title>My title</title>
<para>Sentence 1....Sentence 2.....Sentence 3</para>
Cheers, Tristan
---
Tristan J. Fiedler
Cold Spring Harbor Laboratory
[My XSL-FO stylesheet customization layer is pasted at the end of this
email, in case I have inserted something which is preventing section
title from keeping with the first paragraph of text]
<?xml version='1.0'?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version="1.0">
<!-- Above fo namespace declaration needed for caption alignment -->
<xsl:import
href="/Users/fiedler/Celegans_DocBook/software/docbook-xsl-1.67.2/fo/
docbook.xsl"/>
<xsl:param name="fop.extensions" select="1"></xsl:param>
<xsl:param name="draft.mode" select="'yes'"></xsl:param>
<xsl:param name="draft.watermark.image"
select="'http://docbook.sourceforge.net/release/images/draft.png'"></
xsl:param>
<xsl:param name="insert.xref.page.number">no</xsl:param>
<!-- Section Number turned on, per Lincoln's request 16 Feb 2005 -->
<xsl:param name="section.autolabel" select="1"></xsl:param>
<!-- In order to show the URL in the footnote, ulink.show must be
nonzero -->
<xsl:param name="ulink.show" select="0"></xsl:param>
<xsl:param name="ulink.footnotes" select="0"></xsl:param>
<!-- Remove little square bracket label from the beginning of the
biblioentry, see http://www.sagehill.net/docbookxsl/CustomBiblio.html
-->
<xsl:template name="biblioentry.label"></xsl:template>
<xsl:attribute-set name="xref.properties"> <!-- Colors PDF hyperlinks
-->
<xsl:attribute name="color">blue</xsl:attribute>
</xsl:attribute-set>
<!-- Put Title (ie Caption) after formal table : Begin -->
<xsl:param name="formal.title.placement">
figure before
example before
equation before
table after
procedure before
task before
</xsl:param>
<!-- Put Title (ie Caption) after formal table : End -->
<!-- Put Only Table Title, Not Autonumbering (see XSL common/en.xml:
Begin -->
<xsl:param name="local.l10n.xml" select="document('')"/>
<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
<l:l10n language="en">
<l:context name="title">
<l:template name="table" text="%t"/>
</l:context>
<!-- other customizations -->
</l:l10n>
</l:i18n>
<!-- Put Only Table Title, Not Autonumbering : End -->
<!-- Include Editor Address & Email in PDF output: Begin
<xsl:template match="editor[1]" priority="2" mode="titlepage.mode">
This is just inserted text for my template
<xsl:call-template name="gentext.edited.by"/>
<xsl:call-template name="gentext.space"/>
<xsl:call-template name="person.name.list">
<xsl:with-param name="person.list" select="../editor"/>
</xsl:call-template>
<xsl:if test="affiliation/orgname">
<xsl:text>, </xsl:text>
<xsl:apply-templates select="affiliation/orgname"
mode="titlepage.mode"/>
</xsl:if>
<xsl:if test="affiliation/address">
<xsl:text>, </xsl:text>
<xsl:apply-templates select="affiliation/address"
mode="titlepage.mode"/>
</xsl:if>
<xsl:if test="email|affiliation/address/email">
<xsl:text> </xsl:text>
<xsl:apply-templates
select="(email|affiliation/address/email)[1]"/>
</xsl:if>
</xsl:template>
Include Editor Address & Email in PDF output: End -->
<!-- Turn OFF bolding table titles in PDF output. Modified from
params/formal.title.properties.xsl Begin -->
<xsl:attribute-set name="formal.title.properties"
use-attribute-sets="normal.para.spacing">
<xsl:attribute name="font-weight">normal</xsl:attribute>
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.master * 1.0"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
<xsl:attribute name="hyphenate">false</xsl:attribute>
<xsl:attribute name="space-after.minimum">0.4em</xsl:attribute>
<xsl:attribute name="space-after.optimum">0.6em</xsl:attribute>
<xsl:attribute name="space-after.maximum">0.8em</xsl:attribute>
</xsl:attribute-set>
<!-- Turn OFF bold table titles in PDF output. Modified from
params/formal.title.properties.xsl End -->
<!--Patch to allow imagedata element to be centered, but caption to be
left justified, since align attribute does not appear to work on the
caption element - BEGIN -->
<!-- Should not be needed in the future; bug report filed at
sourceforge, per Bob Stayton's request -->
<xsl:template match="caption">
<fo:block>
<xsl:attribute name="text-align">
<xsl:choose>
<xsl:when test="@align != ''">
<xsl:value-of select="@align"/>
</xsl:when>
<xsl:otherwise>left</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<!--Patch to allow imagedata element to be centered, but caption to be
left justified, since align attribute does not appear to work on the
caption element - END -->
<!-- Removes the left margin "out-dent" for titles. Default is that
titles are shifted to the left of the main text. - BEGIN -->
<xsl:param name="title.margin.left">
<xsl:choose>
<xsl:when test="$passivetex.extensions != 0">0pt</xsl:when>
<xsl:otherwise>0pt</xsl:otherwise>
</xsl:choose>
</xsl:param>
<!-- Removes the left margin "out-dent" for titles. Default is that
titles are shifted to the left of the main text. - END -->
<!-- Reduces section title size from default value of 1.8 - BEGIN -->
<xsl:attribute-set name="section.title.level1.properties">
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.master * 1.2"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="section.title.level2.properties">
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.master * 1.0"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
</xsl:attribute-set>
<!-- Reduces section title size from default value of 1.8 - END -->
<!-- Remove default bibliography title, and just use section title -
BEGIN -->
<xsl:template name="bibliography.titlepage">
</xsl:template>
<!-- Remove default bibliography title, and just use section title -
END -->
<xsl:param name="symbol.font.family" select="'Symbol,
ZapfDingbats'"></xsl:param>
<!-- Force Special Characters to change to Symbol font
(http://www.sagehill.net/docbookxsl/SpecialChars.html) - BEGIN -->
<!-- Due to an FOP glitch, the font-family line below will only use the
first font. See threads on DocBook-apps Feb16 2005
Jirka wrote : Unfotunately you are no luck with FOP because it doesn't
support font-selection-strategy="character-by-character". XEP and XSL
Formatter do.
Bob Stayton wrote : a list of fonts (e.g. Symbol,ZapfDingbats) in the
font-family property don't work in FOP yet. You are going to have to
specify a single font-family..
usage : <symbol role="symbolfont">↔</symbol> where x2194
is the "arrowboth" in Symbol font. -->
<!-- Also note that font-style & font-weight set to normal since the
PDF output was not properly displacing italics for symbols. -->
<xsl:template match="symbol[@role = 'symbolfont']">
<fo:inline font-family="Symbol,ZapfDingbats" font-style="normal"
font-weight="normal">
<xsl:apply-templates/>
<!-- <xsl:call-template name="inline.charseq"/> -->
</fo:inline>
</xsl:template>
<!-- Force Special Characters to change to Symbol font
(http://www.sagehill.net/docbookxsl/SpecialChars.html) - END -->
<!-- One or Two Columns - BEGIN -->
<xsl:param name="column.count.body" select="1"></xsl:param>
<!-- One or Two Columns - END -->
<!-- Change footnote format to these symbols, see
http://docbook.sourceforge.net/release/xsl/current/doc/html/
footnote.number.symbols.html -->
<xsl:param name="footnote.number.symbols"
select="'*§†‡*'"></xsl:param>
<!-- To remove the second line indentation from the PDF bibliographic
entries. One line modified from fo/biblio.xsl - BEGIN -->
<xsl:template match="bibliomixed">
<xsl:param name="label">
<xsl:call-template name="biblioentry.label"/>
</xsl:param>
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="string(.) = ''">
<xsl:variable name="bib"
select="document($bibliography.collection,.)"/>
<xsl:variable name="entry"
select="$bib/bibliography/*[@id=$id][1]"/>
<xsl:choose>
<xsl:when test="$entry">
<xsl:choose>
<xsl:when test="$bibliography.numbered != 0">
<xsl:apply-templates select="$entry">
<xsl:with-param name="label" select="$label"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$entry"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>No bibliography entry: </xsl:text>
<xsl:value-of select="$id"/>
<xsl:text> found in </xsl:text>
<xsl:value-of select="$bibliography.collection"/>
</xsl:message>
<fo:block id="{$id}"
xsl:use-attribute-sets="normal.para.spacing">
<xsl:text>Error: no bibliography entry: </xsl:text>
<xsl:value-of select="$id"/>
<xsl:text> found in </xsl:text>
<xsl:value-of select="$bibliography.collection"/>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<fo:block id="{$id}" xsl:use-attribute-sets="normal.para.spacing"
start-indent="0.0in" text-indent="0.0in">
<xsl:copy-of select="$label"/>
<xsl:apply-templates mode="bibliomixed.mode"/>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- To remove the second line indentation from the PDF bibliographic
entries. One line modified from fo/biblio.xsl - END -->
<!-- Testing widow / orphan control -->
<xsl:attribute-set name="root.properties">
<xsl:attribute name="widows">4</xsl:attribute>
<xsl:attribute name="orphans">4</xsl:attribute>
</xsl:attribute-set>
</xsl:stylesheet>
---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org