]> matita.cs.unibo.it Git - helm.git/commitdiff
UNICODEvsSYMBOL parameter added to select the old
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 20 Jun 2001 10:34:44 +0000 (10:34 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 20 Jun 2001 10:34:44 +0000 (10:34 +0000)
 <FONT FACE="symbol".../> way of getting mathematical symbol
 vs simply using UNICODE entities.

Only a very small percentage of stylesheets (notably part of
content_to_html.xsl and all of html_set.xsl) has been modified to
take into account the new variable.

helm/style/content_to_html.xsl
helm/style/html_set.xsl
helm/style/links_library.xsl
helm/style/proofs.xsl

index 5a48cc1ea49933cc3b3d492a119822d5c07f8353..4b51eb320c86729ac0d468e62836a916ac872db7 100644 (file)
@@ -34,6 +34,7 @@
 
 <xsl:param name="CICURI" select="''"/>
 <xsl:param name="type" select="'standalone'"/>
+<xsl:param name="UNICODEvsSYMBOL" select="'symbol'"/>
 
 <xsl:include href="html_init.xsl"/>
 <xsl:include href="html_set.xsl"/>
 
 <xsl:variable name="framewidth" select="45"/>
 
+<xsl:template name="mksymbol-1">
+ <xsl:param name="symbol" select="''"/>
+ <xsl:param name="color" select="''"/>
+ <xsl:param name="size" select="''"/>
+  <xsl:choose>
+   <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">
+    <xsl:variable name="fontsymbol">
+     <xsl:choose>
+      <xsl:when test="$symbol = 'forall'">
+       <xsl:value-of select="'&#x22;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'lambda'">
+       <xsl:value-of select="'l'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'prod'">
+       <xsl:value-of select="'&#x00d5;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'arrow'">
+       <xsl:value-of select="'&#x00ae;'"/>
+      </xsl:when>
+     </xsl:choose>
+    </xsl:variable>
+    <FONT FACE="symbol" SIZE="{$size}" mathcolor="{$color}">
+     <xsl:value-of select="$fontsymbol"/>
+    </FONT>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:variable name="unicodesymbol">
+     <xsl:choose>
+      <xsl:when test="$symbol = 'forall'">
+       <xsl:value-of select="'&#8704;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'lambda'">
+       <xsl:value-of select="'&#955;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'prod'">
+       <xsl:value-of select="'&#928;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'arrow'">
+       <xsl:value-of select="'&#8594;'"/>
+      </xsl:when>
+     </xsl:choose>
+    </xsl:variable>
+    <FONT color="{$color}">
+     <xsl:value-of select="$unicodesymbol"/>
+    </FONT>
+   </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 <xsl:template match="/">
  <xsl:param name="current_indent" select="0"/>
  <xsl:choose>
    <xsl:choose>
     <!-- FORALL -->
     <xsl:when test="$name='forall'">
-     <FONT FACE="Symbol" SIZE="+2" color="blue">&#x22;</FONT>
+     <xsl:call-template name="mksymbol-1">
+      <xsl:with-param name="symbol" select="$name"/>
+      <xsl:with-param name="color" select="'blue'"/>
+      <xsl:with-param name="size" select="'+2'"/>
+     </xsl:call-template>
      <xsl:apply-templates select="m:bvar/m:ci"/>
      <xsl:text>:</xsl:text>
      <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
      <xsl:apply-templates mode="inline" select="*[position()=3]"/>
     </xsl:when>
     <xsl:when test="$name='prod'">
-     <FONT FACE="Symbol" SIZE="+2" color="blue">&#x00d5;</FONT>
+     <xsl:call-template name="mksymbol-1">
+      <xsl:with-param name="symbol" select="$name"/>
+      <xsl:with-param name="color" select="'blue'"/>
+      <xsl:with-param name="size" select="'+2'"/>
+     </xsl:call-template>
      <xsl:apply-templates mode="inline" select="m:bvar/m:ci"/>
      <xsl:text>:</xsl:text>
      <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
     <xsl:when test="$name='arrow'">
      <xsl:text>(</xsl:text>
      <xsl:apply-templates mode="inline" select="*[position()=2]"/>
-     <FONT color="blue" SIZE="+0" FACE="symbol">
-      <xsl:text>&#x00ae;</xsl:text>
-     </FONT>
+     <xsl:call-template name="mksymbol-1">
+      <xsl:with-param name="symbol" select="$name"/>
+      <xsl:with-param name="color" select="'blue'"/>
+      <xsl:with-param name="size" select="'+0'"/>
+     </xsl:call-template>
      <xsl:apply-templates mode="inline" select="*[position()=3]"/>
      <xsl:text>)</xsl:text>
     </xsl:when>
 </xsl:template>
 
 <xsl:template mode="inline" match="m:lambda">
-      <FONT SIZE="+2" color="red" FACE="symbol">l</FONT>
+      <xsl:call-template name="mksymbol-1">
+       <xsl:with-param name="symbol" select="'lambda'"/>
+       <xsl:with-param name="color" select="'red'"/>
+       <xsl:with-param name="size" select="'+2'"/>
+      </xsl:call-template>
       <xsl:apply-templates select="m:bvar/m:ci"/>
       <xsl:text>:</xsl:text>
       <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
        <xsl:choose>
        <xsl:when test="$charlength > $framewidth">
          <!-- &#x03a0; -->
-         <FONT FACE="Symbol" SIZE="+2" color="blue">&#x22;</FONT>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'blue'"/>
+          <xsl:with-param name="size" select="'+2'"/>
+         </xsl:call-template>
          <xsl:apply-templates select="m:bvar/m:ci"/>
          <xsl:text>:</xsl:text>
          <xsl:apply-templates select="m:bvar/m:type">
       <xsl:when test="$name='prod'">
        <xsl:choose>
        <xsl:when test="$charlength > $framewidth">
-         <FONT FACE="Symbol" SIZE="+2" color="blue">&#x00d5;</FONT>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'blue'"/>
+          <xsl:with-param name="size" select="'+2'"/>
+         </xsl:call-template>
          <xsl:apply-templates select="m:bvar/m:ci"/>
          <xsl:text>:</xsl:text>
          <xsl:apply-templates select="m:bvar/m:type">
         <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
        </xsl:call-template>
        <!-- -> -->
-       <FONT color="blue" SIZE="+0" FACE="symbol">
-        <xsl:text>&#x00ae;</xsl:text>
-       </FONT>
+       <xsl:call-template name="mksymbol-1">
+        <xsl:with-param name="symbol" select="$name"/>
+        <xsl:with-param name="color" select="'blue'"/>
+        <xsl:with-param name="size" select="'+2'"/>
+       </xsl:call-template>
        <xsl:apply-templates select="*[position()=3]">
         <xsl:with-param name="current_indent" select="$current_indent + 5"/>
        </xsl:apply-templates>
      <xsl:choose>
      <xsl:when test="$charlength > $framewidth">
        <!-- &#x03bb; -->
-       <FONT SIZE="+2" color="red" FACE="symbol">l</FONT>
+       <xsl:call-template name="mksymbol-1">
+        <xsl:with-param name="symbol" select="'lambda'"/>
+        <xsl:with-param name="color" select="'red'"/>
+        <xsl:with-param name="size" select="'+2'"/>
+       </xsl:call-template>
        <xsl:apply-templates select="m:bvar/m:ci"/>
        <xsl:text>:</xsl:text>
        <xsl:apply-templates select="m:bvar/m:type">
index 224c76088a51a62dcf2de94d419affc5464b6419..73338c48f1d8c53a357680f40ace5392ccf73655 100644 (file)
 <!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                      -->
 <!--***********************************************************************--> 
 
+<xsl:template name="mksymbol">
+ <xsl:param name="symbol" select="''"/>
+  <xsl:choose>
+   <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">
+    <xsl:variable name="fontsymbol">
+     <xsl:choose>
+      <xsl:when test="$symbol = 'emptyset'">
+       <xsl:value-of select="'&#198;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'in'">
+       <xsl:value-of select="'&#206;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'notin'">
+       <xsl:value-of select="'&#207;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'intersect'">
+       <xsl:value-of select="'&#199;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'union'">
+       <xsl:value-of select="'&#200;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'subset'">
+       <xsl:value-of select="'&#205;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'prsubset'">
+       <xsl:value-of select="'&#204;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'setdiff'">
+       <xsl:value-of select="'/'"/>
+      </xsl:when>
+     </xsl:choose>
+    </xsl:variable>
+    <FONT FACE="symbol" SIZE="+0" mathcolor="blue">
+     <xsl:value-of select="$fontsymbol"/>
+    </FONT>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:variable name="unicodesymbol">
+     <xsl:choose>
+      <xsl:when test="$symbol = 'emptyset'">
+       <xsl:value-of select="'&#8709;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'in'">
+       <xsl:value-of select="'&#8712;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'notin'">
+       <xsl:value-of select="'&#8713;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'intersect'">
+       <xsl:value-of select="'&#8745;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'union'">
+       <xsl:value-of select="'&#8746;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'subset'">
+       <xsl:value-of select="'&#8838;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'prsubset'">
+       <xsl:value-of select="'&#8834;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'setdiff'">
+       <xsl:value-of select="'&#47;'"/>
+      </xsl:when>
+     </xsl:choose>
+    </xsl:variable>
+    <xsl:value-of select="$unicodesymbol"/>
+   </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 <!-- **************************************************************** -->
 <!--                   INLINE MODE                                    -->
 <!-- **************************************************************** -->
   </xsl:variable>-->
   <xsl:choose>
    <xsl:when test="count(child::*) = 0">
-    <FONT FACE="symbol" SIZE="+0" mathcolor="blue">&#198;</FONT>
+    <xsl:call-template name="mksymbol">
+     <xsl:with-param name="symbol" select="'emptyset'"/>
+    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
     <xsl:choose>
   <xsl:text>(</xsl:text>
   <xsl:apply-templates mode="inline" select="*[2]"/>
   <a href="{$uri}">
-   <FONT FACE="symbol" SIZE="+0" mathcolor="blue">
-    <xsl:value-of select="$symbol"/>
-   </FONT>
+   <xsl:call-template name="mksymbol">
+    <xsl:with-param name="symbol">
+     <xsl:value-of select="local-name(*[1])"/>
+    </xsl:with-param>
+   </xsl:call-template>
   </a>
   <xsl:apply-templates mode="inline" select="*[3]"/>
   <xsl:text>)</xsl:text>
       <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
      </xsl:call-template>
      <a href="{$uri}">
-      <FONT FACE="symbol" SIZE="+0" mathcolor="blue">
-       <xsl:value-of select="$symbol"/>
-      </FONT>
+      <xsl:call-template name="mksymbol">
+       <xsl:with-param name="symbol">
+        <xsl:value-of select="local-name(*[1])"/>
+       </xsl:with-param>
+      </xsl:call-template>
      </a>
      <xsl:apply-templates select="*[3]">
       <xsl:with-param name="current_indent" select="$current_indent + 2"/>
   </xsl:variable>-->
   <xsl:choose>
    <xsl:when test="count(child::*) = 0">
-    <FONT FACE="symbol" SIZE="+0" mathcolor="blue">&#198;</FONT>
+    <xsl:call-template name="mksymbol">
+     <xsl:with-param name="symbol" select="'emptyset'"/>
+    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
     <xsl:variable name="charlength">
index 1457169fd34f0d975930ef58b84f3b767c4e481e..a12807df235be0f031b36703fa8b8045c3b9a98c 100644 (file)
@@ -48,6 +48,7 @@
 
 <xsl:param name="naturalLanguage" select="'yes'"/>
 <xsl:param name="annotations" select="'no'"/>
+<xsl:param name="UNICODEvsSYMBOL" select="'symbol'"/>
 
 <xsl:param name="media-type" select="'text/html'"/>
 <xsl:param name="thmedia-type" select="'text/html'"/>
 <xsl:variable name="header0"><xsl:value-of select="$interfaceURL"/>?url=</xsl:variable>
 <xsl:variable name="thheader0"><xsl:value-of select="$thinterfaceURL"/>?url=</xsl:variable>
 <xsl:variable name="header1"><xsl:value-of select="$escaped-processorURL"/>apply?keys=</xsl:variable>
-<xsl:variable name="bothheader2">&#x26;param.naturalLanguage=<xsl:value-of select="$naturalLanguage"/>&#x26;param.annotations=<xsl:value-of select="$annotations"/>&#x26;prop.doctype-public=<xsl:value-of select="$escaped-doctype-public"/>&#x26;param.doctype-public=<xsl:value-of select="$escaped-doctype-public"/>&#x26;param.encoding=<xsl:value-of select="$encoding"/>&#x26;param.media-type=<xsl:value-of select="$media-type"/>&#x26;param.keys=<xsl:value-of select="$quotedkeys"/>&#x26;param.getterURL=<xsl:value-of select="$escaped-getterURL"/>&#x26;param.processorURL=<xsl:value-of select="$escaped-processorURL"/>&#x26;param.interfaceURL=<xsl:value-of select="$escaped-interfaceURL"/>&#x26;xmluri=<xsl:value-of select="$absPath"/></xsl:variable>
+<xsl:variable name="bothheader2">&#x26;param.naturalLanguage=<xsl:value-of select="$naturalLanguage"/>&#x26;param.UNICODEvsSYMBOL=<xsl:value-of select="$UNICODEvsSYMBOL"/>&#x26;param.annotations=<xsl:value-of select="$annotations"/>&#x26;prop.doctype-public=<xsl:value-of select="$escaped-doctype-public"/>&#x26;param.doctype-public=<xsl:value-of select="$escaped-doctype-public"/>&#x26;param.encoding=<xsl:value-of select="$encoding"/>&#x26;param.media-type=<xsl:value-of select="$media-type"/>&#x26;param.keys=<xsl:value-of select="$quotedkeys"/>&#x26;param.getterURL=<xsl:value-of select="$escaped-getterURL"/>&#x26;param.processorURL=<xsl:value-of select="$escaped-processorURL"/>&#x26;param.interfaceURL=<xsl:value-of select="$escaped-interfaceURL"/>&#x26;xmluri=<xsl:value-of select="$absPath"/></xsl:variable>
 <xsl:variable name="header2">&#x26;prop.media-type=<xsl:value-of select="$media-type"/>&#x26;prop.encoding=<xsl:value-of select="$encoding"/></xsl:variable>
 <xsl:variable name="thheader2">&#x26;prop.media-type=<xsl:value-of select="$thmedia-type"/>&#x26;param.thmedia-type=<xsl:value-of select="$thmedia-type"/>&#x26;param.thkeys=<xsl:value-of select="$quotedthkeys"/>&#x26;param.embedkeys=<xsl:value-of select="$quotedembedkeys"/>&#x26;param.thinterfaceURL=<xsl:value-of select="$escaped-thinterfaceURL"/>&#x26;param.thencoding=<xsl:value-of select="$thencoding"/>&#x26;prop.encoding=<xsl:value-of select="$thencoding"/></xsl:variable>
 
index 05cf06dd1f51d08d2d0747599be61968c1c4d3d8..a0302bde6a2bd04cdaa9a45d809364a245bd5662 100644 (file)
 </xsl:template>
 
 <!-- Auxiliary functions -->
+<!-- OMDOC: now we have name_of_uri generalized on the extension that -->
+<!-- can replace the next template                                    -->
 <xsl:template name="get_name">
  <xsl:param name="uri" select="''"/>
  <xsl:variable name="sub_after" select="substring-after($uri,'/')"/>