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: AW: Graphical admonition in FO: Alignment?


Dear all,

 

I made some further tests on the admonition alignment and incidentally discovered a strange behavior.

 

If I made the <fo:block> inside  the item body visible with a red dotted line, the inner block (built through <apply-templates>) is rendered on the bottom of its outer block. Here is an example code:
<fo:list-item-body start-indent="body-start()">

<fo:block xsl:use-attribute-sets="admonition.properties" border="thin dotted red">

                               <xsl:apply-templates/>

                </fo:block>

</fo:list-item-body>

 

As soon as the <fo:block> is empty and without any graphical content it seems to be not considered as rendered block. That’s ok, but then the inner content (apply-templates) ist rendered differently:

<fo:list-item-body start-indent="body-start()">

<fo:block xsl:use-attribute-sets="admonition.properties">

                               <xsl:apply-templates/>

                </fo:block>

</fo:list-item-body>

 

Any suggestions, how I can control the behavior? Maybe leave out the <fo:block> element, because a block will already be rendered due to apply-templates?

 

best regards, Ben

 

 

Von: Kallauch, Benjamin (EEIN)
Gesendet: Donnerstag, 16. April 2015 11
:25
An: docbook-apps@lists.oasis-open.org
Betreff: [docbook-apps] Graphical admonition in FO: Alignment?

 

Dear all,

 

I have some difficulties to understand how to align the List Item Graphic with the first text line in the list body. In my example (attachment) the list body seems to be aligned with the top of the graphic (the graphic has actually no surrounding white space around). The background colors and line are set manually to see better what’s going on. What I need is to align the list body text with the middle of the graphic, not the top.

 

Several tests with the fo-attribute “alignment-baseline” did not bring any solution. Here is my current stylesheet code for generating this type of admonition:

 

<xsl:template match="tip" name="volkswagen.tip.graphical.admonition">

        <xsl:variable name="id">

                <xsl:call-template name="object.id"/>

        </xsl:variable>

        <xsl:variable name="graphic.width">

                <xsl:apply-templates select="." mode="admon.graphic.width"/>

        </xsl:variable>

 

        <fo:block id="{$id}" xsl:use-attribute-sets="graphical.admonition.properties" border="thin dotted black">

                <fo:list-block provisional-distance-between-starts="{$graphic.width} + 6pt" provisional-label-separation="6pt">

                        <fo:list-item>

                                <fo:list-item-label end-indent="label-end()">

                                        <fo:block background-color="#EEFFEE">

                                                <fo:external-graphic width="auto" height="auto" content-width="{$graphic.width}">

                                                        <xsl:attribute name="src">

                                                                <xsl:call-template name="admon.graphic"/>

                                                        </xsl:attribute>

                                                </fo:external-graphic>

                                        </fo:block>

                                </fo:list-item-label>

                                <fo:list-item-body start-indent="body-start()">

                                        <fo:block xsl:use-attribute-sets="admonition.properties" background-color="#FFEEEE">

                                                <xsl:apply-templates/>

                                        </fo:block>

                                </fo:list-item-body>

                        </fo:list-item>

                </fo:list-block>

        </fo:block>

</xsl:template>

 

Does anyone has a good idea how to control alignment between list item labels and their body text?

 

Thanks, Ben.

 

 

 

Attachment: block_with_border.png
Description: block_with_border.png

Attachment: block_without_border.png
Description: block_without_border.png



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