]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/mmlextension.xsl
added html templates and pages
[helm.git] / helm / style / mmlextension.xsl
index 86d026562b4c1430c5e0c72892c15272304e97b5..fad3dce6b333edad5e4b32d06e5baa38c34cca9d 100644 (file)
@@ -1121,6 +1121,37 @@ which generates the toplevel element (see for instance xlink) -->
         <m:mo stretchy="false">}</m:mo>
        </m:mrow>
       </xsl:when>
+      <!-- APPEND -->
+      <xsl:when test="$name='append'">
+       <xsl:choose>
+        <xsl:when test="$charlength >= $framewidth">
+         <m:mtable align="baseline 1" equalrows="false" columnalign="left">
+          <m:mtr>
+           <m:mtd>
+            <m:mrow>
+             <xsl:apply-templates select="*[2]"/>
+             <m:mo>@</m:mo>
+            </m:mrow>
+           </m:mtd>
+          </m:mtr>
+          <m:mtr>
+           <m:mtd>
+            <m:mrow>
+             <xsl:apply-templates select="*[3]"/>
+            </m:mrow>
+           </m:mtd>
+          </m:mtr>
+         </m:mtable>
+        </xsl:when>
+        <xsl:otherwise>
+         <m:mrow>
+          <xsl:apply-templates select="*[2]"/>
+          <m:mo>@</m:mo>
+          <xsl:apply-templates select="*[3]"/>
+         </m:mrow>
+        </xsl:otherwise>
+       </xsl:choose>
+      </xsl:when>
       <!-- ITE -->
       <xsl:when test="$name='ite'">
        <xsl:choose>
@@ -2279,14 +2310,24 @@ which generates the toplevel element (see for instance xlink) -->
 </xsl:template>
 
 <xsl:template match="m:ci|m:csymbol" mode="charcount">
-<xsl:param name="incurrent_length" select="0"/> 
-<xsl:param name="nosibling" select="0"/>
+ <xsl:param name="incurrent_length" select="0"/> 
+ <xsl:param name="nosibling" select="0"/>
+ <xsl:variable name="mylength">
+  <xsl:choose>
+   <!-- special notation -->
+   <xsl:when test="text()='append'">3</xsl:when>
+   <!-- no notation -->
+   <xsl:otherwise>
+    <xsl:value-of select="string-length()"/>
+   </xsl:otherwise>
+  </xsl:choose>
+ </xsl:variable>
     <xsl:choose>
-    <xsl:when test="$framewidth > ($incurrent_length + string-length()) and ($nosibling = 0)">
-     <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/></xsl:apply-templates></xsl:variable>
+    <xsl:when test="$framewidth > ($incurrent_length + $mylength) and ($nosibling = 0)">
+     <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + $mylength"/></xsl:apply-templates></xsl:variable>
      <xsl:choose>
      <xsl:when test="string($siblength) = &quot;&quot;">
-      <xsl:value-of select="$incurrent_length + string-length()"/>
+      <xsl:value-of select="$incurrent_length + $mylength"/>
      </xsl:when>
      <xsl:otherwise>
       <xsl:value-of select="number($siblength)"/>
@@ -2294,7 +2335,7 @@ which generates the toplevel element (see for instance xlink) -->
      </xsl:choose>
     </xsl:when>
     <xsl:otherwise>
-     <xsl:value-of select="$incurrent_length + string-length()"/>
+     <xsl:value-of select="$incurrent_length + $mylength"/>
     </xsl:otherwise>
     </xsl:choose>
 </xsl:template>