Left aligning <glossterm> instead of left justifying

View: New views
3 Messages — Rating Filter:   Alert me  

Left aligning <glossterm> instead of left justifying

by caporale :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I'm using this DocBook customization:

<xsl:template match="glossterm" mode="glossary.as.list"> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <fo:block text-align="left"> <fo:inline id="{$id}"><xsl:apply-templates/></fo:inline>
</fo:block>
</xsl:template>

It left aligns <glossterm>, but it also has the side effect of completely screwing up acronyms.  It makes acronyms appear a line beneath the gloss term and also seems to make acronym spill over to the next page without keeping together with the rest of the glossentry.

On the FOP Users list, I was told that this customization is creating a new fo:block, so that's causing a line break.  Can you help me with a non intrusive way of left aligning glossterm without breaking anything?  

Thank you,
Joseph Caporale

Re: Left aligning <glossterm> instead of left justifying

by caporale :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I put <xsl:param name="alignment">start</xsl:param> in my customization layer, and now I don't have the problem.

Is this a valid fix?

Thank you,
Joseph Caporale

Re: Left aligning <glossterm> instead of left justifying

by Bob Stayton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well, it worked because it is a global parameter that sets the default for
the entire document.  You will notice that all your paragraphs are
left-aligned now.

In my opinion, certain elements should always be left-aligned, and
glossterm is one of them because it fits inside a small area.  If you want
to fix yours, you can customize the template that starts this way instead:

<xsl:template match="glossentry" mode="glossary.as.list">
  <xsl:variable name="id">
    <xsl:call-template name="object.id"/>
  </xsl:variable>

  <fo:list-item xsl:use-attribute-sets="normal.para.spacing">
    <xsl:call-template name="anchor">
      <xsl:with-param name="conditional">
        <xsl:choose>
          <xsl:when test="$glossterm.auto.link != 0
                          or $glossary.collection != ''">0</xsl:when>
          <xsl:otherwise>1</xsl:otherwise>
        </xsl:choose>
      </xsl:with-param>
    </xsl:call-template>

    <fo:list-item-label end-indent="label-end()">
      <fo:block text-align="left">
      ....

I changed the last line shown to add the text-align property.  This is the
block inside the left part of the list-block that contains the term and the
acronym, so now they will stay within the same block and not produce a line
break.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@...


----- Original Message -----
From: "caporale" <tranceradi@...>
To: <docbook-apps@...>
Sent: Wednesday, July 11, 2007 7:53 AM
Subject: Re: [docbook-apps] Left aligning <glossterm> instead of left
justifying


>
> I put <xsl:param name="alignment">start</xsl:param> in my customization
> layer, and now I don't have the problem.
>
> Is this a valid fix?
>
> Thank you,
> Joseph Caporale
> --
> View this message in context:
> http://www.nabble.com/Left-aligning-%3Cglossterm%3E-instead-of-left-justifying-tf4062305.html#a11541971
> Sent from the docbook apps mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@...
> For additional commands, e-mail: docbook-apps-help@...
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...