Subversion Repositories wimsdev

Rev

Rev 5690 | Rev 11717 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. #!/bin/sh
  2. oeffile="wims_mathml_info.oef"
  3. phtmlfile="wims_mathml_info.phtml"
  4. htmlfile="wims_mathml_info.html"
  5. idx=`date +%s`
  6. listfile="/tmp/list.$idx"
  7. if [ -e wims_mathml.l ] ; then
  8.     echo "\statement{
  9.    <table summary=\"mathml_info.oef\">
  10.    <tr><td>latex command</td><td></td><td>Unicode</td></tr>
  11.    "> $oeffile
  12.     echo "
  13.    <table summary=\"mathml_info.oef\">
  14.    <tr><td>latex command</td><td></td><td>Unicode</td></tr>
  15.    "> $phtmlfile
  16.     echo "
  17. <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
  18. <html>
  19.    <head>
  20.             <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
  21.             <title>
  22.                     Latex supported in wims_mathml
  23.             </title>
  24.    </head>
  25.    <body>
  26.    <table summary=\"latex commands\" style=\"font-size:8px\"><tr>" > $htmlfile
  27. firstletter="a"
  28. Tr=4;
  29. # 5 columns... !
  30. echo  "         <th>Environments</td><th>\begin{env}&sdot;&sdot;&sdot;\end{env}</th>" >> $htmlfile
  31. p=0
  32. e=$(($Tr - 2))
  33. while [ $p -le $e ] ;do
  34.     echo "<td>&nbsp;</td>" >> $htmlfile
  35.     p=$(($p+1))
  36. done
  37. echo "</tr><tr>" >> $htmlfile
  38.  
  39. a=0
  40. for p in matrix pmatrix bmatrix  Bmatrix vmatrix Vmatrix smallmatrix cases dcases align* align aligned gathered split array alignat svg equation eqnarray ; do
  41.     echo "<td>$p</td>" >> $htmlfile
  42.     a=$(($a+1))
  43.     if [ $a -gt $Tr ] ; then
  44.         echo "</tr><tr>" >> $htmlfile
  45.         a=0
  46.     fi
  47. done
  48. p=0
  49. e=$(($Tr - $a))
  50. while [ $p -le $e ] ;do
  51.     echo "<td>&nbsp;</td>" >> $htmlfile
  52.     p=$(($p+1))
  53. done
  54. echo "</tr><tr>" >> $htmlfile
  55.  
  56.     cat wims_mathml.l | grep "^\"" | awk -F\" '{if($2 != "<" && length($2)>5) print $2}' | tr '&{([]})#\' ' ' | sort -duif> $listfile
  57.     p=0
  58.     a=0
  59.     while [ $a -le $Tr ] ; do
  60.         echo "<th>$firstletter</th>\c" >> $htmlfile
  61.         a=$((a+1))
  62.     done
  63.     echo "</tr><tr>">> $htmlfile
  64.     while read line ; do
  65.         letter_one=$( set -f; printf "%c " $line )
  66.         letter_one=`echo $letter_one | tr '[:upper:]' '[:lower:]'`
  67.         if [ "$letter_one" != "$firstletter" ] ; then
  68.             firstletter=$letter_one
  69.             a=$p
  70.             while [ $a -le $Tr ] ; do
  71.                 echo  "<td>&nbsp;</td>" >> $htmlfile
  72.                 a=$((a+1))
  73.             done
  74.             echo  "</tr><tr>" >> $htmlfile
  75.             a=0
  76.             while [ $a -le $Tr ] ; do
  77.                 echo  "<th>$firstletter</th>" >> $htmlfile
  78.                 a=$((a+1))
  79.             done
  80.             echo  "</tr><tr>" >> $htmlfile
  81.             p=0
  82.         fi
  83.         chk=`echo $line | wc -c | tr -d '[:blank:]'`
  84.         if [ $chk -gt 1 ] ; then
  85.             echo "<td>\\\\$line\c</td>" >> $htmlfile
  86.             echo "<tr><td>&bsol;$line</td><td>:</td><td>\( \\$line \)</td></tr>" >> $oeffile
  87.             echo "<tr><td>&bsol;$line</td><td>:</td><td>
  88. !insmath \\$line
  89. </td></tr>" >> $phtmlfile
  90.             p=$((p+1))
  91.             if [ $p -gt $Tr ] ; then
  92.                 echo  "</tr><tr>">> $htmlfile
  93.                 p=0
  94.             fi
  95.         fi
  96.     done < "$listfile"
  97.     rm $listfile
  98.     echo "      </tr>
  99.         </table>
  100.    </body>
  101. </html>
  102. ">> $htmlfile  
  103. echo "</table>
  104. }" >> $oeffile
  105. echo "</table>
  106. " >> $phtmlfile
  107. else
  108.     place=`pwd`
  109.     echo "
  110.    
  111.    no file called \"wims_mathml.l\" in this script directory $place !
  112.    
  113.    "
  114.     read whatever
  115. fi
  116.