]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/mmlextension.xsl
Version 1.2.1beta => 1.2.1
[helm.git] / helm / style / mmlextension.xsl
index 71a424d8bb52585e46c4b9aa829eee25a43e3021..eb928b41f183b9f8685525b2898a883ed642a766 100644 (file)
@@ -411,9 +411,10 @@ which generates the toplevel element (see for instance xlink) -->
     <xsl:variable name="name"><xsl:value-of select="m:csymbol"/></xsl:variable>
     <xsl:variable name="charlength"><xsl:apply-templates select="m:csymbol" mode="charcount"/></xsl:variable>
     <m:mrow>
-     <xsl:if test="@helm:xref">
+     <xsl:if test="@id">
       <xsl:attribute name="m:xref"><xsl:value-of select="@id"/></xsl:attribute>
      </xsl:if>
+     <xsl:variable name="id" select="m:csymbol/@id"/>
      <xsl:choose>
       <!-- FORALL -->
       <xsl:when test="$name='forall'">
@@ -988,8 +989,12 @@ which generates the toplevel element (see for instance xlink) -->
       <!-- PROOF -->
       <xsl:when test="$name='proof'">
        <m:maction actiontype="toggle">
-        <!-- CSC: next if until the annotationHelper can handle mactions -->
-        <xsl:if test="not($explodeall)">
+        <!-- CSC: $explodeall until the annotationHelper can handle mactions -->
+        <xsl:variable name="test" select="(not($explodeall)) and
+          (not(preceding-sibling::*[1]/text()='letin1')) and
+          (not(preceding-sibling::*[1]/text()='rw_step')) and
+          (not(name(..)='m:lambda'))"/>
+        <xsl:if test="$test">
          <!-- Details hided (default) -->
          <m:mtable align="baseline 1" equalrows="false" columnalign="left">
           <m:mtr>
@@ -1026,7 +1031,9 @@ which generates the toplevel element (see for instance xlink) -->
              <m:mphantom>
               <m:mtext>_</m:mtext>
              </m:mphantom>
-             <m:mtext mathcolor="Green">(hide&#x00a0;details)</m:mtext>
+             <xsl:if test="$test">
+              <m:mtext mathcolor="Green">(hide&#x00a0;details)</m:mtext>
+             </xsl:if>
             </m:mrow>
            </m:mrow>
           </m:mtd>
@@ -1526,19 +1533,15 @@ which generates the toplevel element (see for instance xlink) -->
       <!-- subst -->
       <xsl:when test="$name='subst'">
         <xsl:apply-templates select="*[3]"/>
-        <m:mo>&#xe8a0;</m:mo>
-        <m:mrow>
-         <m:mo stretchy="false">[</m:mo>
-         <m:mrow>
-          <xsl:apply-templates select="*[4]"/>
-          <m:mo mathcolor="green">
-           <xsl:if test="$id != ''">
-            <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
-           </xsl:if>&#8592;</m:mo>
-          <xsl:apply-templates select="*[2]"/>
-         </m:mrow>
-         <m:mo stretchy="false">]</m:mo>
-        </m:mrow>
+<!-- no font for ApplyFunction: <m:mo>&#xe8a0;</m:mo> -->
+        <m:mo stretchy="false">[</m:mo>
+        <xsl:apply-templates select="*[4]"/>
+        <m:mo mathcolor="green">
+         <xsl:if test="$id != ''">
+          <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
+         </xsl:if>&#8592;</m:mo>
+        <xsl:apply-templates select="*[2]"/>
+        <m:mo stretchy="false">]</m:mo>
       </xsl:when>
       <!-- lift -->
       <xsl:when test="$name='lift'">
@@ -1716,7 +1719,12 @@ which generates the toplevel element (see for instance xlink) -->
 
 <xsl:template match="m:lambda">
     <xsl:variable name="charlength"><xsl:apply-templates select="*[position()=1]" mode="charcount"/></xsl:variable>
-    <m:mrow m:xref="{@id}">
+    <m:mrow>
+     <xsl:if test="@id">
+      <xsl:attribute name="m:xref">
+       <xsl:value-of select="@id"/>
+      </xsl:attribute>
+     </xsl:if>
      <xsl:choose>
      <xsl:when test="$charlength >= $framewidth">
       <m:mtable align="baseline 1" equalrows="false" columnalign="left">
@@ -1763,7 +1771,7 @@ which generates the toplevel element (see for instance xlink) -->
  <xsl:choose>
   <xsl:when test="$charlength >= $framewidth">
    <m:mtable align="baseline 1" equalrows="false" columnalign="left">
-    <xsl:if test="@helm:xref">
+    <xsl:if test="@id">
      <xsl:attribute name="m:xref">
       <xsl:value-of select="@id"/>
      </xsl:attribute>
@@ -1781,7 +1789,12 @@ which generates the toplevel element (see for instance xlink) -->
       <m:mtd>
        <m:mrow>
         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
-        <m:mo m:xref="{m:in/@id}">=</m:mo>
+        <m:mo>
+         <xsl:if test="m:in/@id">
+          <xsl:attribute name="m:xref">
+           <xsl:value-of select="m:in/@id"/>
+          </xsl:attribute>
+         </xsl:if>=</m:mo>
         <xsl:apply-templates select="."/>
        </m:mrow>
       </m:mtd>
@@ -1856,7 +1869,7 @@ which generates the toplevel element (see for instance xlink) -->
  <xsl:choose>
   <xsl:when test="$charlength >= $framewidth">
    <m:mtable align="baseline 1" equalrows="false" columnalign="left">
-    <xsl:if test="@helm:xref">
+    <xsl:if test="@id">
      <xsl:attribute name="m:xref">
       <xsl:value-of select="@id"/>
      </xsl:attribute>
@@ -1874,7 +1887,12 @@ which generates the toplevel element (see for instance xlink) -->
       <m:mtd>
        <m:mrow>
         <m:mphantom><m:mtext>__</m:mtext></m:mphantom>
-        <m:mo m:xref="{*[1]/@id}"><xsl:value-of select="$symbol"/></m:mo>
+        <m:mo>
+         <xsl:if test="*[1]/@id">
+          <xsl:attribute name="m:xref">
+           <xsl:value-of select="*[1]/@id"/>
+          </xsl:attribute>
+         </xsl:if><xsl:value-of select="$symbol"/></m:mo>
         <xsl:apply-templates select="."/>
        </m:mrow>
       </m:mtd>
@@ -1898,7 +1916,12 @@ which generates the toplevel element (see for instance xlink) -->
 <xsl:template match = "m:set">
  <xsl:choose>
   <xsl:when test="count(child::*) = 0">
-   <m:mi>&#x02205;</m:mi>
+   <m:mi>
+    <xsl:if test="@id">
+     <xsl:attribute name="m:xref">
+      <xsl:value-of select="@id"/>
+     </xsl:attribute>
+    </xsl:if>&#x02205;</m:mi>
   </xsl:when>
   <xsl:otherwise>
    <xsl:variable name="charlength">
@@ -1912,7 +1935,12 @@ which generates the toplevel element (see for instance xlink) -->
         <m:mtr>
          <m:mtd>
           <m:mrow>
-           <m:mo stretchy="false">{</m:mo>
+           <m:mo stretchy="false">
+            <xsl:if test="@id">
+             <xsl:attribute name="m:xref">
+              <xsl:value-of select="@id"/>
+             </xsl:attribute>
+            </xsl:if>{</m:mo>
            <xsl:apply-templates select="*[position()=1]"/>
           </m:mrow>
          </m:mtd>
@@ -1929,7 +1957,12 @@ which generates the toplevel element (see for instance xlink) -->
         <m:mtr>
          <m:mtd>
           <m:mrow>
-           <m:mo stretchy="false">}</m:mo>
+           <m:mo stretchy="false">
+            <xsl:if test="@id">
+             <xsl:attribute name="m:xref">
+              <xsl:value-of select="@id"/>
+             </xsl:attribute>
+            </xsl:if>}</m:mo>
           </m:mrow>
          </m:mtd>
         </m:mtr>
@@ -1940,7 +1973,12 @@ which generates the toplevel element (see for instance xlink) -->
         <m:mtr>
          <m:mtd>
           <m:mrow>
-           <m:mo stretchy="false">{</m:mo>
+           <m:mo stretchy="false">
+            <xsl:if test="@id">
+             <xsl:attribute name="m:xref">
+              <xsl:value-of select="@id"/>
+             </xsl:attribute>
+            </xsl:if>{</m:mo>
            <xsl:apply-templates select="*[position()=1]"/>
            <xsl:if test="position() != last()">
             <mo>,</mo>
@@ -1964,7 +2002,12 @@ which generates the toplevel element (see for instance xlink) -->
         <m:mtr>
          <m:mtd>
           <m:mrow>
-           <m:mo stretchy="false">}</m:mo>
+           <m:mo stretchy="false">
+            <xsl:if test="@id">
+             <xsl:attribute name="m:xref">
+              <xsl:value-of select="@id"/>
+             </xsl:attribute>
+            </xsl:if>}</m:mo>
           </m:mrow>
          </m:mtd>
         </m:mtr>
@@ -1991,11 +2034,6 @@ which generates the toplevel element (see for instance xlink) -->
   </m:mfenced>
 </xsl:template>
 
-<!-- *********************************** -->
-<!--          PROOF ELEMENTS             -->
-<!-- *********************************** -->
-
-
 
 <!--**********************-->
 <!--       COUNTING       -->