<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>
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>
</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>