]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/mmlextension.xsl
Added "-destdir" argument to "ocamlfind install" in "install:"
[helm.git] / helm / style / mmlextension.xsl
index 8566c972630e3435160cb4cc772c425169edb34b..6dce30b65a73b02bf009013469380fd523eb18a0 100644 (file)
@@ -44,6 +44,8 @@ which generates the toplevel element (see for instance xlink) -->
 
 <xsl:import href="mmltheoryextension.xsl"/>
 
+<xsl:param name="explodeall" select="false()"/>
+
 <!--***********************************************************************-->
 <!-- Parameter affecting line-breaking                                     -->
 <!--***********************************************************************-->
@@ -371,21 +373,27 @@ which generates the toplevel element (see for instance xlink) -->
      <m:mtable align="baseline 1" equalrows="false" columnalign="left">
       <m:mtr>
        <m:mtd>
-        <xsl:apply-templates select="m:ci"/>
-        <m:mo>:</m:mo>
+        <m:mrow>
+         <xsl:apply-templates select="m:ci"/>
+         <m:mo>:</m:mo>
+        </m:mrow>
        </m:mtd>
       </m:mtr>
       <m:mtr>
        <m:mtd>
+        <m:mrow>
          <xsl:apply-templates select="m:type"/>
+        </m:mrow>
        </m:mtd>
       </m:mtr>
      </m:mtable>
     </xsl:when>
     <xsl:otherwise>
-     <xsl:apply-templates select="m:ci"/>
-     <m:mo>:</m:mo>
-     <xsl:apply-templates select="m:type"/>
+     <m:mrow>
+      <xsl:apply-templates select="m:ci"/>
+      <m:mo>:</m:mo>
+      <xsl:apply-templates select="m:type"/>
+     </m:mrow>
     </xsl:otherwise>
    </xsl:choose>
   </xsl:when>
@@ -403,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'">
@@ -415,7 +424,7 @@ which generates the toplevel element (see for instance xlink) -->
          <m:mtr>
           <m:mtd>
            <m:mrow>
-            <m:mo mathcolor="Blue"><m:mchar name="ForAll"/></m:mo>
+            <m:mo mathcolor="Blue">&#8704;</m:mo>
             <xsl:apply-templates select="m:bvar"/>
            </m:mrow>
           </m:mtd>
@@ -431,7 +440,7 @@ which generates the toplevel element (see for instance xlink) -->
         </m:mtable>
        </xsl:when>
        <xsl:otherwise>
-        <m:mo mathcolor="Blue"><m:mchar name="ForAll"/></m:mo>
+        <m:mo mathcolor="Blue">&#8704;</m:mo>
         <xsl:apply-templates select="m:bvar/m:ci"/>
         <m:mo>:</m:mo>
         <xsl:apply-templates select="m:bvar/m:type"/>
@@ -729,8 +738,8 @@ which generates the toplevel element (see for instance xlink) -->
            </m:mrow>
           </m:mtd>
          </m:mtr>
-         <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
-         <xsl:variable name="charlength"><xsl:apply-templates select="." mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
+         <xsl:for-each select="piecewise/piece">
+         <xsl:variable name="charlength"><xsl:apply-templates select="./*[2]" mode="charcount"><xsl:with-param name="nosibling" select="1"/></xsl:apply-templates></xsl:variable>
          <m:mtr>
           <m:mtd>
            <m:mrow>
@@ -743,10 +752,10 @@ which generates the toplevel element (see for instance xlink) -->
             </xsl:otherwise>
             </xsl:choose>
             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
-            <xsl:apply-templates select="."/>
+            <xsl:apply-templates select="./*[2]"/>
             <xsl:if test="$framewidth > $charlength">
              <m:mo mathcolor="Green">&#x21d2;</m:mo>
-             <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
+             <xsl:apply-templates select="./*[1]"/>
             </xsl:if>
            </m:mrow>
           </m:mtd>
@@ -757,7 +766,7 @@ which generates the toplevel element (see for instance xlink) -->
            <m:mrow>
             <m:mphantom><m:mtext>|_</m:mtext></m:mphantom>  
             <m:mo mathcolor="Green">&#x21d2;</m:mo>
-            <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
+            <xsl:apply-templates select="./*[1]"/>
            </m:mrow>
           </m:mtd>
          </m:mtr>
@@ -779,15 +788,15 @@ which generates the toplevel element (see for instance xlink) -->
         <xsl:apply-templates select="*[position()=3]"/>
         <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
         <m:mo>OF</m:mo>
-        <xsl:for-each select="*[position() mod 2 = 0 and position()>3]">
+        <xsl:for-each select="piecewise/piece">
          <xsl:choose>
          <xsl:when test="position() != 1">
           <m:mo stretchy="false">|</m:mo>
          </xsl:when> 
          </xsl:choose>
-         <xsl:apply-templates select="."/>
+         <xsl:apply-templates select="./*[2]"/>
          <m:mo mathcolor="Green">&#x21d2;</m:mo>
-         <xsl:apply-templates select="following-sibling::*[position()= 1]"/>
+         <xsl:apply-templates select="./*[1]"/>
         </xsl:for-each>
         <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
         <m:mo>END</m:mo>
@@ -979,24 +988,71 @@ which generates the toplevel element (see for instance xlink) -->
       <!-- ***************************************** -->
       <!-- PROOF -->
       <xsl:when test="$name='proof'">
-        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
-         <m:mtr>
-          <m:mtd>
-           <m:mrow>
-            <xsl:apply-templates select="*[position()=2]"/>
-           </m:mrow>
-          </m:mtd>
-         </m:mtr>
-         <m:mtr>
-          <m:mtd>
-           <m:mrow>
-            <m:mtext mathcolor="Maroon">we proved </m:mtext>
-            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
-            <xsl:apply-templates select="*[position()=3]"/>
-           </m:mrow>
-          </m:mtd>
-         </m:mtr>
-        </m:mtable>
+        <!-- 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:variable name="hidden_details">
+         <xsl:if test="$test">
+          <!-- Details hided (default) -->
+          <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+           <m:mtr>
+            <m:mtd>
+             <m:mrow>
+              <m:mtext mathcolor="Maroon">We&#x00a0;can&#x00a0;prove</m:mtext>
+              <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+              <xsl:apply-templates select="*[position()=3]"/>
+              <m:mrow>
+               <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+               <m:mtext mathcolor="Green">(explain)</m:mtext>
+              </m:mrow>
+             </m:mrow>
+            </m:mtd>
+           </m:mtr>
+          </m:mtable>
+         </xsl:if>
+        </xsl:variable>
+        <xsl:variable name="shown_details">
+         <!-- Show details -->
+         <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+          <m:mtr>
+           <m:mtd>
+            <m:mrow>
+             <xsl:apply-templates select="*[position()=2]"/>
+            </m:mrow>
+           </m:mtd>
+          </m:mtr>
+          <m:mtr>
+           <m:mtd>
+            <m:mrow>
+             <m:mtext mathcolor="Maroon">we&#x00a0;proved</m:mtext>
+             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
+             <xsl:apply-templates select="*[position()=3]"/>
+             <m:mrow>
+              <m:mphantom>
+               <m:mtext>_</m:mtext>
+              </m:mphantom>
+              <xsl:if test="$test">
+               <m:mtext mathcolor="Green">(hide&#x00a0;details)</m:mtext>
+              </xsl:if>
+             </m:mrow>
+            </m:mrow>
+           </m:mtd>
+          </m:mtr>
+         </m:mtable>
+        </xsl:variable>
+        <xsl:choose>
+         <xsl:when test="$test">
+          <m:maction actiontype="toggle">
+           <xsl:copy-of select="$hidden_details"/>
+           <xsl:copy-of select="$shown_details"/>
+          </m:maction>
+         </xsl:when>
+         <xsl:otherwise>
+          <xsl:copy-of select="$shown_details"/>
+         </xsl:otherwise>
+        </xsl:choose>
       </xsl:when>
       <!-- LETIN1 -->
       <xsl:when test="$name='letin1'">
@@ -1017,15 +1073,12 @@ which generates the toplevel element (see for instance xlink) -->
          </m:mtr>
         </m:mtable>
       </xsl:when>
-
-      <!-- CSC: Il caso che segue e' stato buttato li' giusto per vedere -->
-      <!-- qualche cosa. Irene, appena puoi, risistemalo.                -->
       <xsl:when test="$name='by_induction'">
        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
         <m:mtr>
          <m:mtd>
           <m:mrow>
-           <m:mtext mathcolor="red">We prove </m:mtext>
+           <m:mtext mathcolor="red">We&#x00a0;prove</m:mtext>
            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
            <xsl:apply-templates select="../*[3]"/>
           </m:mrow>
@@ -1034,9 +1087,9 @@ which generates the toplevel element (see for instance xlink) -->
         <m:mtr>
          <m:mtd>
           <m:mrow>
-           <m:mtext mathcolor="red">by induction on </m:mtext>
+           <m:mtext mathcolor="red">by&#x00a0;induction&#x00a0;on</m:mtext>
            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
-           <xsl:apply-templates
+           <xsl:apply-templates 
             select="*[position()=last()]/*[position()=last()]"/>
           </m:mrow>
          </m:mtd>
@@ -1044,12 +1097,13 @@ which generates the toplevel element (see for instance xlink) -->
         <m:mtr>
          <m:mtd>
           <m:mrow>
-           <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
            <m:mtable align="baseline 1" equalrows="false" columnalign="left">
             <xsl:for-each select="*[position()>3 and not(position()=last())]">
              <m:mtr>
               <m:mtd>
-               <xsl:apply-templates select="."/>
+               <m:mrow>
+                <xsl:apply-templates select="."/>
+               </m:mrow>
               </m:mtd>
              </m:mtr>
             </xsl:for-each>
@@ -1065,7 +1119,7 @@ which generates the toplevel element (see for instance xlink) -->
         <m:mtr>
          <m:mtd>
           <m:mrow>
-           <m:mtext mathcolor="red">Case </m:mtext>
+           <m:mtext mathcolor="red">Case</m:mtext>
            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
            <xsl:apply-templates select="*[2]"/>
           </m:mrow>
@@ -1079,7 +1133,9 @@ which generates the toplevel element (see for instance xlink) -->
             <xsl:if test="*[3]/*[position()>1]">
              <m:mtr>
               <m:mtd>
-               <m:mtext mathcolor="red">By induction hypothesis, we have:</m:mtext>
+               <m:mrow>
+                <m:mtext mathcolor="red">By&#x00a0;induction&#x00a0;hypothesis,&#x00a0;we&#x00a0;have:</m:mtext>
+               </m:mrow>
               </m:mtd>
              </m:mtr>
              <m:mtr>
@@ -1099,7 +1155,9 @@ which generates the toplevel element (see for instance xlink) -->
             </xsl:if>
             <m:mtr>
              <m:mtd>
-              <xsl:apply-templates select="*[4]"/>
+              <m:mrow>
+               <xsl:apply-templates select="*[4]"/>
+              </m:mrow>
              </m:mtd>
             </m:mtr>
            </m:mtable>
@@ -1129,6 +1187,7 @@ which generates the toplevel element (see for instance xlink) -->
         </xsl:choose>
        </m:mrow>
       </xsl:when>
+      <!-- false_ind  -->
       <xsl:when test="$name='false_ind'">
        <m:mtable align="baseline 1" equalrows="false" columnalign="left">
         <m:mtr>
@@ -1147,8 +1206,6 @@ which generates the toplevel element (see for instance xlink) -->
         </m:mtr>
        </m:mtable>
       </xsl:when>
-      <!--CSC fine della parte da risistemare -->
-
       <!-- LET-IN -->
       <xsl:when test="$name='letin'">
         <m:mtable align="baseline 1" equalrows="false" columnalign="left">
@@ -1252,7 +1309,7 @@ which generates the toplevel element (see for instance xlink) -->
          <m:mtr>
           <m:mtd>
            <m:mrow>
-            <m:mtext>Then apply it to</m:mtext>
+            <m:mtext>Then&#x00a0;apply&#x00a0;it&#x00a0;to</m:mtext>
             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
             <xsl:apply-templates select="*[position()>2]"/>
            </m:mrow>
@@ -1282,7 +1339,7 @@ which generates the toplevel element (see for instance xlink) -->
          <m:mtr>
           <m:mtd>
            <m:mrow>
-            <m:mtext>In particular, we have</m:mtext>
+            <m:mtext>In&#x00a0;particular,&#x00a0;we&#x00a0;have</m:mtext>
            </m:mrow>
           </m:mtd>
          </m:mtr>
@@ -1317,8 +1374,6 @@ which generates the toplevel element (see for instance xlink) -->
          </m:mtr>
         </m:mtable>
       </xsl:when>
-      <!-- CSC: Il caso che segue e' stato buttato li' giusto per vedere -->
-      <!-- qualche cosa. Irene, appena puoi, risistemalo.                -->
       <!-- full_or_ind -->
       <xsl:when test="$name='full_or_ind'">
         <m:mtable align="baseline 1" equalrows="false" columnalign="left">
@@ -1341,7 +1396,7 @@ which generates the toplevel element (see for instance xlink) -->
          <m:mtr>
           <m:mtd>
            <m:mrow>
-            <m:mtext>We proceed by cases to prove</m:mtext>
+            <m:mtext>We&#x00a0;proceed&#x00a0;by&#x00a0;cases&#x00a0;to&#x00a0;prove</m:mtext>
             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
             <xsl:apply-templates select="*[3]"/>
            </m:mrow>
@@ -1350,7 +1405,7 @@ which generates the toplevel element (see for instance xlink) -->
          <m:mtr>
           <m:mtd>
            <m:mrow>
-            <m:mtext>Left: suppose</m:mtext>
+            <m:mtext>Left:&#x00a0;suppose</m:mtext>
             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
             <m:mo stretchy="false">(</m:mo>
             <xsl:apply-templates select="*[4]/m:bvar/m:ci"/>
@@ -1362,8 +1417,8 @@ which generates the toplevel element (see for instance xlink) -->
          </m:mtr>
          <m:mtr>
           <m:mtd>
-           <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
            <m:mrow>
+            <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
             <xsl:apply-templates select="*[4]/*[3]"/>
            </m:mrow>
           </m:mtd>
@@ -1371,7 +1426,7 @@ which generates the toplevel element (see for instance xlink) -->
          <m:mtr>
           <m:mtd>
            <m:mrow>
-            <m:mtext>Right: suppose</m:mtext>
+            <m:mtext>Right:&#x00a0;suppose</m:mtext>
             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
             <m:mo stretchy="false">(</m:mo>
             <xsl:apply-templates select="*[5]/m:bvar/m:ci"/>
@@ -1390,7 +1445,6 @@ which generates the toplevel element (see for instance xlink) -->
          </m:mtr>
         </m:mtable>
       </xsl:when>
-      <!--CSC fine della parte da risistemare -->
       <!-- OR_IND -->
       <xsl:when test="$name='or_ind'">
         <m:mtable align="baseline 1" equalrows="false" columnalign="left">
@@ -1413,11 +1467,11 @@ which generates the toplevel element (see for instance xlink) -->
          <m:mtr>
           <m:mtd>
            <m:mrow>
-            <m:mtext>We prove</m:mtext>
+            <m:mtext>We&#x00a0;prove</m:mtext>
             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
             <xsl:apply-templates select="*[3]"/>
             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
-            <m:mtext>by cases:</m:mtext>
+            <m:mtext>by&#x00a0;cases:</m:mtext>
            </m:mrow>
           </m:mtd>
          </m:mtr>
@@ -1467,7 +1521,7 @@ which generates the toplevel element (see for instance xlink) -->
             <m:mtext>:</m:mtext>
             <xsl:apply-templates select="*[4]"/>
             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
-            <m:mtext>such that</m:mtext>
+            <m:mtext>such&#x00a0;that</m:mtext>
             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
             <m:mtext>(</m:mtext>
              <xsl:apply-templates select="*[5]"/>
@@ -1486,6 +1540,131 @@ which generates the toplevel element (see for instance xlink) -->
          </m:mtr>
         </m:mtable>
       </xsl:when>
+      <!-- ***************************************** -->
+      <!-- *********** NOTATIONS ******************* -->
+      <!-- ***************************************** -->
+      <!-- subst -->
+      <xsl:when test="$name='subst'">
+        <xsl:apply-templates select="*[3]"/>
+<!-- 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'">
+        <m:msup>
+         <m:mo mathcolor="green">
+          <xsl:if test="$id != ''">
+           <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
+          </xsl:if>&#8593;</m:mo>
+        <xsl:apply-templates select="*[2]"/>
+        </m:msup>
+       <m:mrow>
+        <m:mo stretchy="false">(</m:mo>
+         <xsl:apply-templates select="*[3]"/>
+        <m:mo stretchy="false">)</m:mo>
+        </m:mrow>
+      </xsl:when>
+      <!-- lift_with_base -->
+      <xsl:when test="$name='lift_with_base'">
+        <m:msubsup>
+         <m:mo mathcolor="green">
+          <xsl:if test="$id != ''">
+           <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
+          </xsl:if>&#8593;</m:mo>
+        <xsl:apply-templates select="*[3]"/>
+        <xsl:apply-templates select="*[4]"/>
+        </m:msubsup>
+       <m:mrow>
+        <m:mo stretchy="false">(</m:mo>
+         <xsl:apply-templates select="*[2]"/>
+        <m:mo stretchy="false">)</m:mo>
+        </m:mrow>      
+      </xsl:when>
+      <!-- beta_red1 -->
+      <xsl:when test="$name='beta_red1'">
+        <xsl:apply-templates select="*[2]"/>
+        <m:munder>
+         <m:mo mathcolor="green">
+          <xsl:if test="$id != ''">
+           <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
+          </xsl:if>&#8594;</m:mo>
+          <m:mi mathcolor="green">&#946;</m:mi>
+        </m:munder>
+        <xsl:apply-templates select="*[3]"/>
+      </xsl:when>
+      <!-- beta_red -->
+      <xsl:when test="$name='beta_red'">
+        <xsl:apply-templates select="*[2]"/>
+        <m:munderover>
+         <m:mo mathcolor="green">
+          <xsl:if test="$id != ''">
+           <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
+          </xsl:if>&#8594;</m:mo>
+          <m:mi mathcolor="green">&#946;</m:mi>
+          <m:mi mathcolor="green">*</m:mi>
+        </m:munderover>
+        <xsl:apply-templates select="*[3]"/>
+      </xsl:when>
+      <!-- par_beta_red1 -->
+      <xsl:when test="$name='par_beta_red1'">
+        <xsl:apply-templates select="*[2]"/>
+        <m:munder>
+         <m:mo mathcolor="green">
+          <xsl:if test="$id != ''">
+           <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
+          </xsl:if>&#8658;</m:mo>
+          <m:mi mathcolor="green">&#946;</m:mi>
+        </m:munder>
+        <xsl:apply-templates select="*[3]"/>
+      </xsl:when>
+      <!-- par_beta_red -->
+      <xsl:when test="$name='par_beta_red'">
+        <xsl:apply-templates select="*[2]"/>
+        <m:munderover>
+         <m:mo mathcolor="green">
+          <xsl:if test="$id != ''">
+           <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
+          </xsl:if>&#8658;</m:mo>
+          <m:mi mathcolor="green">&#946;</m:mi>
+          <m:mi mathcolor="green">*</m:mi>
+        </m:munderover>
+        <xsl:apply-templates select="*[3]"/>
+      </xsl:when>
+      <!-- forgetful -->
+      <xsl:when test="$name='forgetful'">
+       <m:mfenced open="|" close="|">
+        <xsl:if test="$id != ''">
+         <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates select="*[2]"/>
+       </m:mfenced>
+      </xsl:when>
+      <!-- isomorphic -->
+      <xsl:when test="$name='isomorphic'">
+        <xsl:apply-templates select="*[2]"/>
+        <m:mo mathcolor="green">
+         <xsl:if test="$id != ''">
+          <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
+         </xsl:if>&#8773;</m:mo>
+        <xsl:apply-templates select="*[3]"/>
+      </xsl:when>
+      <!-- interp -->
+      <xsl:when test="$name='forgetful'">
+       <m:mfenced open="[" close="]">
+        <xsl:if test="$id != ''">
+         <xsl:attribute name="m:xref"><xsl:value-of select="$id"/></xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates select="*[2]"/>
+       </m:mfenced>
+      </xsl:when> 
+
       <!-- ERROR -->
       <xsl:otherwise>
        <m:mi>ERROR</m:mi>
@@ -1519,7 +1698,7 @@ which generates the toplevel element (see for instance xlink) -->
          <m:mtr>
           <m:mtd>
            <m:mrow>
-            <m:mtext mathcolor="Maroon">we get</m:mtext>
+            <m:mtext mathcolor="Maroon">we&#x00a0;get</m:mtext>
             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
             <xsl:apply-templates select="."/>
            </m:mrow>
@@ -1537,7 +1716,7 @@ which generates the toplevel element (see for instance xlink) -->
          <m:mtr>
           <m:mtd>
            <m:mrow>
-            <m:mtext mathcolor="Maroon">we get</m:mtext>
+            <m:mtext mathcolor="Maroon">we&#x00a0;get</m:mtext>
             <m:mphantom><m:mtext>_</m:mtext></m:mphantom>
             <xsl:apply-templates select="."/>
            </m:mrow>
@@ -1553,7 +1732,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">
@@ -1600,7 +1784,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>
@@ -1618,7 +1802,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>
@@ -1647,43 +1836,43 @@ which generates the toplevel element (see for instance xlink) -->
  <xsl:variable name="symbol">
   <xsl:choose>
    <xsl:when test="m:and[1]">
-    <xsl:value-of select="'wedge'"/>
+    <xsl:value-of select="'&#8743;'"/>
    </xsl:when>
    <xsl:when test="m:or[1]">
-    <xsl:value-of select="'vee'"/>
+    <xsl:value-of select="'&#8744;'"/>
    </xsl:when>
    <xsl:when test="m:geq[1]">
-    <xsl:value-of select="'geq'"/>
+    <xsl:value-of select="'&#8805;'"/>
    </xsl:when>
    <xsl:when test="m:leq[1]">
-    <xsl:value-of select="'leq'"/>
+    <xsl:value-of select="'&#8804;'"/>
    </xsl:when>
    <xsl:when test="m:gt[1]">
-    <xsl:value-of select="'gt'"/>
+    <xsl:value-of select="'&#62;'"/>
    </xsl:when>
    <xsl:when test="m:lt[1]">
-    <xsl:value-of select="'lt'"/>
+    <xsl:value-of select="'&#60;&#32;'"/>
    </xsl:when>
    <xsl:when test="m:eq[1]">
-    <xsl:value-of select="'Equal'"/>
+    <xsl:value-of select="'&#61;'"/>
    </xsl:when>
    <xsl:when test="m:in[1]">
-    <xsl:value-of select="'Element'"/>
+    <xsl:value-of select="'&#x02208;'"/>
    </xsl:when>
    <xsl:when test="m:subset[1]">
-    <xsl:value-of select="'SubsetEqual'"/>
+    <xsl:value-of select="'&#x02286;'"/>
    </xsl:when>
    <xsl:when test="m:prsubset[1]">
-    <xsl:value-of select="'subset'"/>
+    <xsl:value-of select="'&#x02282;'"/>
    </xsl:when>
    <xsl:when test="m:intersect[1]">
-    <xsl:value-of select="'Intersection'"/>
+    <xsl:value-of select="'&#x022C2;'"/>
    </xsl:when>
    <xsl:when test="m:union[1]">
-    <xsl:value-of select="'Union'"/>
+    <xsl:value-of select="'&#x022C3;'"/>
    </xsl:when>
    <xsl:when test="m:setdiff[1]">
-    <xsl:value-of select="'Backslash'"/>
+    <xsl:value-of select="'&#x02216;'"/>
    </xsl:when>
   </xsl:choose>
  </xsl:variable>
@@ -1693,7 +1882,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>
@@ -1711,9 +1900,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}"> 
-         <m:mchar name="{$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>
@@ -1737,9 +1929,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> 
-    <m:mchar name="emptyset"/>
-   </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">
@@ -1753,7 +1948,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>
@@ -1770,7 +1970,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>
@@ -1781,7 +1986,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>
@@ -1805,7 +2015,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>
@@ -1832,11 +2047,6 @@ which generates the toplevel element (see for instance xlink) -->
   </m:mfenced>
 </xsl:template>
 
-<!-- *********************************** -->
-<!--          PROOF ELEMENTS             -->
-<!-- *********************************** -->
-
-
 
 <!--**********************-->
 <!--       COUNTING       -->
@@ -1919,6 +2129,3 @@ which generates the toplevel element (see for instance xlink) -->
 </xsl:template>
 
 </xsl:stylesheet> 
-
-
-