docbook-apps

  • 1.  word breaking

    Posted 11-01-2006 02:53
    Is there a way to tell docbook to recommend to the fo processor that
    the contents of varname not be broken (or hyphenated) for linebreaks?

    --
    http://chris.chiasson.name/



  • 2.  Re: [docbook-apps] word breaking

    Posted 11-01-2006 14:50
    On 10/31/06, Chris Chiasson <chris@chiasson.name> wrote:
    > Is there a way to tell docbook to recommend to the fo processor that
    > the contents of varname not be broken (or hyphenated) for linebreaks?

    I've been experimenting with some general purpose methods to let
    @role='keep-together' on inlines recommend non-breaking to the FO
    processor:

    [extending inline.xsl]

    I've modified all the inline.*seq templates, here one:

    <xsl:template name="inline.charseq">
    <xsl:param name="content">
    <xsl:apply-templates/>
    </xsl:param>

    <xsl:choose>
    <xsl:when test="@dir">
    <fo:inline>
    <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:copy-of select="$content"/>
    </fo:inline>
    </xsl:when>
    <xsl:otherwise>
    <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:copy-of select="$content"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>


    The above seems to do the right thing using AntennaHouse.

    HTH,
    Keith