docbook-apps message
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]
Subject: Re: [docbook-apps] Issue with unwanted line breaks with the termC++
- From: Ron Catterall <ron@catterall.net>
- To: hmlists@focus-sw.com
- Date: Wed, 23 Jul 2008 07:36:55 -0500
Title: Re: [docbook-apps] Issue with unwanted line breaks
with t
Why not use the role attribute on
<phrase> to do something like
<para>Some content <phrase
role="keeptogether">qwerty asdf
zxcvbn</phrase> some more content</para>
to avoid any line-breaks being generated
in the <phrase> content when
you produce a PDF file.
Based on a suggestion from Keith Fahlgren" (
abdelazer@gmail.com ) my customization layer contains
<!--
====================================================================
-->
<!--
Allow use of
<phrase
role="keep-together">qwerty</phrase>
to prevent hyphenation and a line break within the phrase
-->
<xsl:template match="d:phrase[@role[contains(.,
'keep-together')]]">
<xsl:param
name="no-hyphenate" select="false()"/>
<xsl:param
name="content">
<xsl:apply-templates/>
</xsl:param>
<fo:inline
xsl:use-attribute-sets="monospace.properties" font-family="{$body.font.family}">
<xsl:if test="@role[contains(.,
'keep-together')]">
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
<xsl:attribute name="hyphenate">false</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="$no-hyphenate">
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
<xsl:attribute name="hyphenate">false</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<!-- this is a
zero-width space to intentionally provoke an AntennaHouse bug.
The FO spec says that
hyphenation-character can only be on fo:block and
fo:character, but having
anything here provides the correct result. -->
<xsl:attribute name="hyphenation-character">
<xsl:value-of select="'​'"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="ancestor::d:footnote">
<xsl:attribute name="font-size">85%</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:if test="@dir">
<xsl:attribute name="direction">
<xsl:choose>
<xsl:when
test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
<xsl:otherwise>rtl</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="$content"/>
</fo:inline>
</xsl:template> <!-- END
match="d:phrase[@role[contains(., 'keep-together')]]"
-->
<!--
====================================================================
-->
Bob Stayton made the following comment: "FOP has limited
support for keep-together. Version 0.93 now supports it for
fo:block elements, but not for fo:inline." I use XEP.
This was developed for the 4.5 stylesheets, but seems to work OK for
5.0. I should update it sometime.
--
Ron Catterall, Phd, DSc
email: ron@catterall.net
Prolongacion de Hidalgo 140
http://catterall.net/
San Felipe del Agua
tel:
+52 951 520 1821
Oaxaca 68020
Mexico
fax:
+1 530 348 8309
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]