[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Admon graphics: customizing spaces
Unfortunately there is no way in XSLT to count the number of lines in tip.
The lines are formed by the XSL-FO processor after the stylesheet is done,
so the stylesheet has no information about how many lines a given tip
element will be.
You might want to study the rules of how spaces are combined in XSL-FO and
use combinations of space-after and space-before, and possibly
space-before.precedence and space-after.precedence.
Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net
----- Original Message -----
From: "Michèle Garoche" <michele.garoche@easyconnect.fr>
To: "Bob Stayton" <bobs@sagehill.net>
Cc: "docbook-apps" <docbook-apps@lists.oasis-open.org>
Sent: Sunday, December 11, 2005 10:00 AM
Subject: Re: [docbook-apps] Admon graphics: customizing spaces
Le 11 déc. 2005 à 11:57, Bob Stayton a écrit :
> 1. It requires customizing the template named
> 'graphical.admonition' to
> reset
> those indents. They should probably be in attribute sets, if you
> want to
> file a feature request. 8^)
Done.
>
> 2. I'm not sure how you defined the attribute. But an xsl:attribute
> element can contain an xsl:choose statement that can output
> different values
> based on the test clause. An example of such syntax can be found
> here:
>
> http://www.sagehill.net/docbookxsl/
> PrintTableStyles.html#table.properties
>
> You can use self::tip to test if the current context is a tip element.
Actually, after looking at the pdf production more in depth, I found
that this occurs only when the tip, note, etc. contains one and
unique line and not only inside a procedure.
I've styled the admonition outer-block as follows:
<!-- Style of admonitions -->
<xsl:attribute-set name="graphical.admonition.properties">
<xsl:attribute name="space-before.minimum">0.3em</xsl:attribute>
<xsl:attribute name="space-before.optimum">0.3em</xsl:attribute>
<xsl:attribute name="space-before.maximum">0.3em</xsl:attribute>
<xsl:attribute name="space-after.minimum">0.3em</xsl:attribute>
<xsl:attribute name="space-after.optimum">0.3em</xsl:attribute>
<xsl:attribute name="space-after.maximum">0.3em</xsl:attribute>
</xsl:attribute-set>
and normal para spacing as follows:
<!-- Normal paragraph spacing -->
<xsl:attribute-set name="normal.para.spacing">
<xsl:attribute name="space-before.optimum">0.5em</xsl:attribute>
<xsl:attribute name="space-before.minimum">0.5em</xsl:attribute>
<xsl:attribute name="space-before.maximum">0.5em</xsl:attribute>
<xsl:attribute name="text-indent">0em</xsl:attribute>
</xsl:attribute-set>
Other paragraph space-before and space-after spacings vary from 0.8em
to 0.6em for sections.
List block space-before and space-after spacing are 0.4em, list item
space-before spacing 0.3em and compact list item space-before spacing
is 0em.
On the other way, I've defined the properties related to tip, notes,
etc as follows:
<!-- For figures, procedure, example, table -->
<xsl:attribute-set name="formal.object.properties">
<xsl:attribute name="space-before.minimum">0.4em</xsl:attribute>
<xsl:attribute name="space-before.optimum">0.4em</xsl:attribute>
<xsl:attribute name="space-before.maximum">0.4em</xsl:attribute>
<xsl:attribute name="space-after.minimum">0.3em</xsl:attribute>
<xsl:attribute name="space-after.optimum">0.3em</xsl:attribute>
<xsl:attribute name="space-after.maximum">0.3em</xsl:attribute>
<xsl:attribute name="keep-together.within-column">always</
xsl:attribute>
</xsl:attribute-set>
<!-- Style of title for procedure, example, table, figures
And space after procedure title -->
<xsl:attribute-set name="formal.title.properties">
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="font-size">10pt</xsl:attribute>
<xsl:attribute name="hyphenate">false</xsl:attribute>
<xsl:attribute name="space-after.minimum">
<xsl:choose>
<xsl:when test="self::procedure">0em</xsl:when>
<xsl:otherwise>inherit</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="space-after.optimum">
<xsl:choose>
<xsl:when test="self::procedure">0em</xsl:when>
<xsl:otherwise>inherit</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="space-after.maximum">
<xsl:choose>
<xsl:when test="self::procedure">0em</xsl:when>
<xsl:otherwise>inherit</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:attribute-set>
It seems that I need to count the number of lines of the tip text,
then if there is only one line, make the space after the tip graphics
a little more than 0em.
A little too complicated for me at the moment, i.e. I have no idea
how I can count the number of lines.
Cheers,
Michèle
<http://micmacfr.homeunix.org>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]