Thank you Bob. That did the trick. Basically my problem was because I was not calling the formal.object.heading template. I thought I don't need to do so, as it should be called by the equation template. Anyhow, I added a background color for the equations and the text of the labels and between the equations is colored with the same color of the background !

For example, if I have equation1 and equation2, then the label for equation 1 and the text between the two equations take the same color of the background !

here's the code for my customization layer:

       <xsl:template match="equation">
               <xsl:variable name="placement">after</xsl:variable>
               <xsl:if test="$placement = 'before'">
                       <xsl:call-template name="formal.object.heading">
<xsl:with-param name="placement" select="$placement" />
                       </xsl:call-template>
               </xsl:if>
               <fo:block padding="5pt">
<xsl:attribute name="border-color">black</xsl:attribute> <xsl:attribute name="border-style">solid</xsl:attribute> <xsl:attribute name="border-width">1px</xsl:attribute>
                       <xsl:attribute name="padding">5pt</xsl:attribute>
<xsl:attribute name="background-color">#F0F0FF</xsl:attribute>
                       <xsl:apply-templates />
               </fo:block>
               <xsl:if test="$placement != 'before'">
                       <xsl:call-template name="formal.object.heading">
<xsl:with-param name="placement" select="$placement" /> </xsl:call-template>
               </xsl:if>
       </xsl:template>

Bob Stayton wrote:
Hi Mansour,
Your last try was close, and the missing title can be restored with a call to the template named formal.object.heading (which is in fo/formal.xsl).

<xsl:template match="equation">
   <xsl:variable name="placement">before</xsl:variable>
   <xsl:if test="$placement = 'before'">
     <xsl:call-template name="formal.object.heading">
       <xsl:with-param name="placement" select="$placement"/>
     </xsl:call-template>
   </xsl:if>
  <fo:block padding="5pt">
    <xsl:attribute name="border">0.5pt solid blue</xsl:attribute>
      <xsl:apply-templates />
   </fo:block>
   <xsl:if test="$placement != 'before'">
     <xsl:call-template name="formal.object.heading">
       <xsl:with-param name="placement" select="$placement"/>
     </xsl:call-template>
   </xsl:if>
</xsl:template>

If you want your title to appear after the equation, then change the 'placement' variable to 'after'.

Bob Stayton
Sagehill Enterprises
[EMAIL PROTECTED]


----- Original Message ----- From: "Mansour" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, January 09, 2008 11:53 AM
Subject: Re: [docbook] equation border and background color


Is there answer to this question ??


Mansour wrote:
I am trying to put a border around the equations with background color. I need to align the equation in the center. I don't want the title inside the borders. I have tried this :
http://sources.redhat.com/ml/docbook/2003-07/msg00198.html

<xsl:attribute-set name="equation.properties" use-attribute-sets="formal.object.properties">
        <xsl:attribute name="border-color">#000000</xsl:attribute>
        <xsl:attribute name="border-style">solid</xsl:attribute>
        <xsl:attribute name="border-width">1px</xsl:attribute>
        <xsl:attribute name="padding">1em</xsl:attribute>
        <xsl:attribute name="background-color">#dddddd</xsl:attribute>
</xsl:attribute-set>

This surrounded the whole thing, the equation and the title.
Then from this page http://www.dpawson.co.uk/docbook/styling/params.html I tried to use :

<xsl:attribute-set name="shade.verbatim.properties">
  *border*-color="thin black ridge"
  background-color="silver"
</xsl:attribute-set>

But nothing happened.
From this page http://www.sagehill.net/docbookxsl/AddNewTemplate.html I used :
       <xsl:template match="equation">
               <fo:block padding="5pt">
<xsl:attribute name="border">0.5pt solid blue</xsl:attribute>
                       <xsl:apply-templates />
               </fo:block>
       </xsl:template>

The title disappeared!
I used <xsl:apply-imports />. again the whole thing is wrapped inside the border. Is there a way to get this done and align the block in the middle of the page?

Thank you.






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to