]> granicus.if.org Git - docbook-dsssl/commitdiff
Fixed several errors related to TeX math processing
authorJirka Kosek <jirka@kosek.cz>
Sun, 2 Mar 2003 14:22:56 +0000 (14:22 +0000)
committerJirka Kosek <jirka@kosek.cz>
Sun, 2 Mar 2003 14:22:56 +0000 (14:22 +0000)
xsl/common/common.xsl
xsl/fo/math.xsl

index 548348d7c5616cd2c6f43360b4996b78c9de1f61..35dbfa0a3e2f3c76a475d9f4c4561a35329da7ec 100644 (file)
@@ -907,7 +907,13 @@ recursive process.</para>
     
         <xsl:variable name="useobject">
           <xsl:choose>
-          <!-- The phrase is never used -->
+            <!-- The phrase is used only when contains TeX Math and output is FO -->
+            <xsl:when test="name($object)='textobject' and $object/phrase
+                            and $object/@role='tex' and $stylesheet.result.type = 'fo'
+                            and $tex.math.in.alt != ''">
+              <xsl:text>1</xsl:text> 
+            </xsl:when>
+            <!-- The phrase is never used -->
             <xsl:when test="name($object)='textobject' and $object/phrase">
               <xsl:text>0</xsl:text>
             </xsl:when>
@@ -922,6 +928,14 @@ recursive process.</para>
                            and $object[not(@role) or @role!='tex']">
               <xsl:text>1</xsl:text>
             </xsl:when>
+            <!-- don't use graphic when output is FO, TeX Math is used 
+                 and there is math in alt element -->
+            <xsl:when test="$object/ancestor::equation and 
+                            $object/ancestor::equation/alt[@role='tex']
+                            and $stylesheet.result.type = 'fo'
+                            and $tex.math.in.alt != ''">
+              <xsl:text>0</xsl:text>
+            </xsl:when>
             <!-- If there's only one object, use it -->
             <xsl:when test="$count = 1 and count($olist) = 1">
                <xsl:text>1</xsl:text>
index f71c979fd44c010622a585c24714d20870af4a03..ca7f393a6de43a20a27942856d0c8fb0fa82e88f 100644 (file)
   </xsl:copy>
 </xsl:template>
 
-<xsl:template match="equation/mediaobject | informalequation/mediaobject">
-  <xsl:if test="$passivetex.extensions = 0 or $tex.math.in.alt = ''">
-    <xsl:variable name="olist" select="imageobject|imageobjectco
-                       |videoobject|audioobject
-                    |textobject"/>
-  
-    <xsl:variable name="object.index">
-      <xsl:call-template name="select.mediaobject.index">
-        <xsl:with-param name="olist" select="$olist"/>
-        <xsl:with-param name="count" select="1"/>
-      </xsl:call-template>
-    </xsl:variable>
-  
-    <xsl:variable name="object" select="$olist[position() = $object.index]"/>
-  
-    <xsl:variable name="align">
-      <xsl:value-of select="$object/imagedata[@align][1]/@align"/>
-    </xsl:variable>
-  
-    <fo:block>
-      <xsl:if test="$align != '' ">
-        <xsl:attribute name="text-align">
-          <xsl:value-of select="$align"/>
-        </xsl:attribute>
-      </xsl:if>
-  
-      <xsl:apply-templates select="$object"/>
-      <xsl:apply-templates select="caption"/>
-    </fo:block>
-  </xsl:if>
-</xsl:template>
-
 <xsl:template match="equation/graphic | informalequation/graphic">
   <xsl:if test="$passivetex.extensions = 0 or $tex.math.in.alt = ''">
     <fo:block>