Subversion Repositories wimsdev

Rev

Rev 11717 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. #!/bin/sh
  2.  
  3. htmlfile="wims_mathml_info.html"
  4.  
  5. idx=`date +%s`
  6. datum=`date +%m/%Y`
  7. listfile="/tmp/list.$idx"
  8. if [ -e wims_mathml.l ] ; then
  9. echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
  10. <html>
  11. <head>
  12.  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
  13.  <title>Latex supported in wims_mathml</title>
  14. </head>
  15. <style>
  16. li{display:inline-block;}
  17. div { display: none;}
  18. a:active + div { display: block;background-color:yellow;}
  19. </style>
  20. <body>
  21.  <ul>" > $htmlfile
  22. cat wims_mathml.l | grep "^\"" | awk -F\" '{if($2 != "<" && length($2)>5) print $2}' | tr '&{([]})#\' ' ' | sort -duif> $listfile
  23. while read line ; do
  24.  
  25.  chk=`echo $line | wc -c | tr -d '[:blank:]'`
  26.  if [ $chk -gt 1 ] ; then
  27.   math=`./wims_mathml --tex-size "150%" --tex-string "\\\\$line"`
  28.   chk=`echo $math | grep "&" | wc -l | tr -d '[:blank:]'`
  29.   if [ "$math" = "\$ERROR" ] || [ "$math" = "ERROR" ] || [ "$chk" = "0" ] ; then
  30.    echo "<li><a>\\\\$line</a><div>see latex syntax</div></li>" >> $htmlfile
  31.   else
  32.    echo "<li><a>$math</a><div>\\$line</div></li>" >> $htmlfile
  33.   fi
  34.  fi
  35. done < "$listfile"
  36.  
  37. rm $listfile
  38. echo "   </li>
  39.  </ul>
  40.  <script>
  41.  
  42.  </script>
  43. </body>
  44. </html>
  45. ">> $htmlfile
  46. else
  47.  place=`pwd`
  48.  echo "
  49. no file called \"wims_mathml.l\" in this script directory $place ! "
  50.  read whatever
  51. fi
  52.  
  53. exit
  54.