]> granicus.if.org Git - docbook-dsssl/commitdiff
Format equation without title using table layout with equation number
authorBob Stayton <bobs@sagehill.net>
Wed, 2 Dec 2009 06:06:53 +0000 (06:06 +0000)
committerBob Stayton <bobs@sagehill.net>
Wed, 2 Dec 2009 06:06:53 +0000 (06:06 +0000)
next to the equation.

xsl/fo/formal.xsl

index 5935ae07512f830b70b0862ad27c2692a085c33e..99b3c7fb54dea6a5e7018fe705bec3fcbfb47f0a 100644 (file)
               <xsl:attribute name="keep-together.within-column"><xsl:value-of
                               select="$keep.together"/></xsl:attribute>
             </xsl:if>
-            <xsl:apply-templates/>
+            <xsl:call-template name="equation.without.title"/>
           </fo:block>
         </xsl:when>
         <xsl:otherwise>
               <xsl:attribute name="keep-together.within-column"><xsl:value-of
                               select="$keep.together"/></xsl:attribute>
             </xsl:if>
-            <xsl:apply-templates/>
+            <xsl:call-template name="equation.without.title"/>
           </fo:block>
         </xsl:otherwise>
       </xsl:choose>
   </xsl:choose>
 </xsl:template>
 
+<xsl:template name="equation.without.title">
+  <!-- Lay out equation and number next to equation using a table -->
+  <fo:table table-layout="fixed" width="100%">
+    <fo:table-column column-width="proportional-column-width(15)"/>
+    <fo:table-column column-width="proportional-column-width(1)"/>
+    <fo:table-body start-indent="0pt" end-indent="0pt">
+      <fo:table-row>
+        <fo:table-cell padding-end="6pt">
+          <fo:block>
+            <xsl:apply-templates/>
+          </fo:block>
+        </fo:table-cell>
+        <fo:table-cell xsl:use-attribute-sets="equation.number.properties">
+          <fo:block>
+            <xsl:text>(</xsl:text>
+            <xsl:apply-templates select="." mode="label.markup"/>
+            <xsl:text>)</xsl:text>
+          </fo:block>
+        </fo:table-cell>
+      </fo:table-row>
+    </fo:table-body>
+  </fo:table>
+</xsl:template>
+
 <xsl:template name="semiformal.object">
   <xsl:param name="placement" select="'before'"/>
   <xsl:choose>
-    <xsl:when test="./title">
+    <xsl:when test="title or info/title">
       <xsl:call-template name="formal.object">
         <xsl:with-param name="placement" select="$placement"/>
       </xsl:call-template>