[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Customize tip
On Wed, Mar 5, 2008 at 1:52 PM, Mansour <mansour77@yahoo.com> wrote: > I am trying to add an icon before the <tip> or <warning>. I need this > icon to the left of the block. I have added the icon I need using > <fo:instream-foreign-object> but no luck with positioning it before the > <tip>. Any ideas ? Hi Mansour, Here's the quite-ugly overriden template I use to do the same sort of things for my titles, hope it helps: <xsl:template name="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="orm.zero.para.spacing"> <xsl:attribute name="line-stacking-strategy">max-height</xsl:attribute> <xsl:if test="self::note|self::tip"> <xsl:attribute name="margin-left">14pt</xsl:attribute> </xsl:if> <fo:list-block provisional-distance-between-starts="{$graphic.width} + 18pt" provisional-label-separation="18pt"> <fo:list-item> <fo:list-item-label end-indent="label-end()"> <fo:block> <fo:external-graphic height="auto"> <xsl:attribute name="width">auto</xsl:attribute> <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()"> <xsl:if test="$admon.textlabel != 0 or title"> <fo:block xsl:use-attribute-sets="admonition.title.properties"> <xsl:apply-templates select="." mode="object.title.markup"/> </fo:block> </xsl:if> <fo:block xsl:use-attribute-sets="orm.admonition.properties"> <xsl:choose> <!-- Modification to adjust for tip/note paw print --> <xsl:when test="self::tip|self::note"> <xsl:attribute name="padding-top">7.5pt</xsl:attribute> <xsl:attribute name="margin-left">-12pt</xsl:attribute> <xsl:attribute name="margin-top">7.5pt</xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="margin-left">2pt</xsl:attribute> </xsl:otherwise> </xsl:choose> <xsl:apply-templates/> </fo:block> </fo:list-item-body> </fo:list-item> </fo:list-block> </fo:block> </xsl:template> The reference attribute sets: <xsl:attribute-set name="orm.zero.para.spacing"> <xsl:attribute name="space-before.optimum">0pc</xsl:attribute> <xsl:attribute name="space-before.minimum">0pt</xsl:attribute> <xsl:attribute name="space-before.maximum">0pt</xsl:attribute> <xsl:attribute name="space-after.optimum">0pt</xsl:attribute> <xsl:attribute name="space-after.minimum">0pt</xsl:attribute> <xsl:attribute name="space-after.maximum">0pt</xsl:attribute> </xsl:attribute-set> <xsl:attribute-set name="orm.admonition.properties"> <xsl:attribute name="space-after">6pt</xsl:attribute> <xsl:attribute name="start-indent">42pt</xsl:attribute> <xsl:attribute name="end-indent">42pt</xsl:attribute> <xsl:attribute name="font-size">9pt</xsl:attribute> <xsl:attribute name="padding-bottom">0pt</xsl:attribute> <xsl:attribute name="padding-left">0pt</xsl:attribute> <xsl:attribute name="padding-right">0pt</xsl:attribute> <xsl:attribute name="padding-top">0pt</xsl:attribute> <xsl:attribute name="space-before.optimum">0pc</xsl:attribute> <xsl:attribute name="space-before.minimum">0pt</xsl:attribute> <xsl:attribute name="space-before.maximum">0pt</xsl:attribute> <xsl:attribute name="space-after.optimum">0pt</xsl:attribute> <xsl:attribute name="space-after.minimum">0pt</xsl:attribute> <xsl:attribute name="space-after.maximum">0pt</xsl:attribute> </xsl:attribute-set> Keith
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]