OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Additional space after remark in varlistentry/listitem?


You are running into one of the hard issues that the stylesheet has to
solve: how to determine when a para should add space above and when not to.
The extra spacing is coming from the <para> element after the <remark> in
the listitem.  That's the normal.para.spacing attribute-set.  The reason you
don't see it in the entry without the <remark> is because of this template
in fo:lists.xsl:

<xsl:template match="listitem/*[1][local-name()='para' or
                                   local-name()='simpara' or
                                   local-name()='formalpara']
                     |glossdef/*[1][local-name()='para' or
                                   local-name()='simpara' or
                                   local-name()='formalpara']
                     |step/*[1][local-name()='para' or
                                   local-name()='simpara' or
                                   local-name()='formalpara']
                     |callout/*[1][local-name()='para' or
                                   local-name()='simpara' or
                                   local-name()='formalpara']"
              priority="2">
  <fo:block>
    <xsl:call-template name="anchor"/>
    <xsl:apply-templates/>
  </fo:block>
</xsl:template>

This template attempts to turn off the space for a para that is the first
element in a listitem, so that it doesn't add its normal space.  This
template does not add the normal.para.spacing attributes to its block the
way the regular para template does.  It just starts an fo:block and applies
templates to its children.  But it is a compromise because the first element
may not be a para.

In this case, the remark element pushes the first para into the second
position inside the listitem, so the first child of listitem is not a para,
and this template doesn't match, so the regular para template is applied
instead.  So although the remark element produces no output, its location in
the source influences which template is applied to the para.

You can't just turn off space for all paras inside a listitem, because a
second para should have its space above to separate it from the first para.
And you can't turn it off for the first para element inside a listitem,
because it could follow another first element, in which case it would
probably need its space above.

Suggestions welcome as to how to best solve this little problem in the
general case.  In this particular case, moving the remark inside the para
will fix the formatting.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- 
From: "Thomas Schraitle" <tom_schr@web.de>
To: <docbook-apps@lists.oasis-open.org>
Sent: Tuesday, June 21, 2005 4:30 AM
Subject: [docbook-apps] Additional space after remark in
varlistentry/listitem?


>
> Hi,
>
> if I insert a remark after a listitem, I get an additional space in
FO/PDF. See the following example:
>
> ----------------- 
> <?xml version="1.0"?>
> <chapter>
>   <title>Just a test</title>
>   <variablelist>
>    <varlistentry>
>     <term>The first term</term>
>     <listitem>
>      <para>This is the description of the first term</para>
>     </listitem>
>    </varlistentry>
>    <varlistentry>
>     <term>The second term</term>
>     <listitem>
>      <remark>This is a remark</remark>
>      <para>This is the description of the second term</para>
>     </listitem>
>    </varlistentry>
>   </variablelist>
> </chapter>
> -----------------
>
> If I transform this with variablelist.as.blocks=1 and show.comments=0 I
get an empty line between "The second term":
>
> -----------------
> The first term
>   This is the description of the first term
>
> The second term
>
>   This is the description of the second term
> -----------------
>
> That's weird and I suppose this should not be there. After looking at the
FO file, the second term looks like this:
>
> <fo:block id="id2248578"
>   space-before.optimum="1em"
>   space-before.minimum="0.8em"
>   space-before.maximum="1.2em"
>   font-weight="bold"
>   keep-together.within-column="always"
>   keep-with-next.within-column="always">
>   <fo:inline>The second term</fo:inline>
>   </fo:block>
>    <fo:block margin-left="15pt">
>      <fo:block space-before.optimum="1em"
>                    space-before.minimum="0.8em"
>                    space-before.maximum="1.2em"><!-- (1) -->This is the
description of the first term</fo:block>
>      </fo:block>
>    </fo:block>
>
> It seems, that the space-before.* attributes in fo:block (1) coming from
the attribute set "normal.para.spacing". It is inserted only, if a remark
occurs after the listitem.
>
> Any ideas how to solve it?
>
> Thanks,
> Tom
>
> -------
> DocBook XSL Stylesheets 2005-06-21 (snapshot)
> XEP 4.4 build 20050610
> xsltproc --version
>  Using libxml 20617, libxslt 10112 and libexslt 810
>  xsltproc was compiled against libxml 20617, libxslt 10112 and libexslt
810
>  libxslt 10112 was compiled against libxml 20617
>  libexslt 810 was compiled against libxml 20617
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>
>
>




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]