]> matita.cs.unibo.it Git - helm.git/commitdiff
Unary minus now rendered without parentheses.
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 11 Dec 2002 10:37:39 +0000 (10:37 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 11 Dec 2002 10:37:39 +0000 (10:37 +0000)
helm/style/mmlctop.xsl

index 554c3a87be33d72027f1d591ea536d82a7a0e336..b63ebee8aea5867ae3174ada0a284ff1ce390f11 100644 (file)
@@ -1293,18 +1293,38 @@ an mo. Mixed content: mrow which contains mo + presentation elements -->
   <xsl:choose>
     <xsl:when test="$IN_PREC &gt; $MINUS_PREC or $IN_PREC=$MINUS_PREC and
                                                         $PARAM=$PAR_SAME">
-      <m:mfenced separators="">
-        <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
-          <xsl:attribute name="xref">
-            <xsl:value-of select="@id"/>
-          </xsl:attribute>
-        </xsl:if>
-        <xsl:apply-templates select="." mode="minus">
-          <xsl:with-param name="PARAM" select="$PARAM"/>
-          <xsl:with-param name="PAREN" select="$PAR_YES"/>
-          <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
-        </xsl:apply-templates>
-      </m:mfenced>
+      <!-- HELM: m:mrow is now used when the minus operator is unary.
+           Igor used m:mfenced instead. -->
+      <xsl:choose>
+       <xsl:when test="count(*)=2">
+        <m:mrow>
+          <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
+            <xsl:attribute name="xref">
+              <xsl:value-of select="@id"/>
+            </xsl:attribute>
+          </xsl:if>
+          <xsl:apply-templates select="." mode="minus">
+            <xsl:with-param name="PARAM" select="$PARAM"/>
+            <xsl:with-param name="PAREN" select="$PAR_YES"/>
+            <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+          </xsl:apply-templates>
+        </m:mrow>
+       </xsl:when>
+       <xsl:otherwise>
+        <m:mfenced separators="">
+          <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
+            <xsl:attribute name="xref">
+              <xsl:value-of select="@id"/>
+            </xsl:attribute>
+          </xsl:if>
+          <xsl:apply-templates select="." mode="minus">
+            <xsl:with-param name="PARAM" select="$PARAM"/>
+            <xsl:with-param name="PAREN" select="$PAR_YES"/>
+            <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
+          </xsl:apply-templates>
+        </m:mfenced>
+       </xsl:otherwise>
+      </xsl:choose>
     </xsl:when>
     <xsl:when test="$IN_PREC &gt; $NO_PREC and $IN_PREC &lt; $FUNCTION_PREC
                     and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)