Subversion Repositories wimsdev

Rev

Rev 5691 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5539 schaersvoo 1
#!/bin/sh
11717 schaersvoo 2
 
5539 schaersvoo 3
htmlfile="wims_mathml_info.html"
11717 schaersvoo 4
 
5539 schaersvoo 5
idx=`date +%s`
11717 schaersvoo 6
datum=`date +%m/%Y`
5539 schaersvoo 7
listfile="/tmp/list.$idx"
8
if [ -e wims_mathml.l ] ; then
11717 schaersvoo 9
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
5539 schaersvoo 10
<html>
11717 schaersvoo 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 type=\"text/css\">
16
 .tabel td {
17
 padding:1px;
18
 border-width:1px;
19
 border-style:solid 1px;
20
 text-align:center;
21
 background-color:#c6d4ff;
22
 font-size:0.4em;
23
 }
24
 div { display: none;}
25
 a:active + div { display: block;background-color:yellow;}
26
 </style>
27
 <body>
28
 <table summary=\"latex commands\" class=\"tabel\"><caption style=\"font-size:0.5em;\">($datum) wims_mathml (click to see the command)</caption><tr>" > $htmlfile
5539 schaersvoo 29
Tr=4;
11717 schaersvoo 30
# 5 columns... 
31
cat wims_mathml.l | grep "^\"" | awk -F\" '{if($2 != "<" && length($2)>5) print $2}' | tr '&{([]})#\' ' ' | sort -duif> $listfile
32
while read line ; do
33
 
34
 chk=`echo $line | wc -c | tr -d '[:blank:]'`
35
 if [ $chk -gt 1 ] ; then
36
  math=`./wims_mathml --tex-size "200%" --tex-string "\\\\$line"`
37
  chk=`echo $math | grep "&" | wc -l | tr -d '[:blank:]'`
38
  if [ "$math" = "\$ERROR" ] || [ "$math" = "ERROR" ] || [ "$chk" = "0" ] ; then
39
   echo "<td><a>\\$line</a><div>see latex syntax</div></td>" >> $htmlfile
40
  else
41
   echo "<td><a>$math</a><div>\\$line</div></td>" >> $htmlfile
42
  fi
43
 fi
44
 p=$(($p+1))
45
 if [ $p -gt $Tr ] ; then
46
  echo  "</tr><tr>">> $htmlfile
47
  p=0
48
 fi
49
done < "$listfile"
50
if [ $p -gt $Tr ] ; then
51
 echo  "</tr><tr>">> $htmlfile
52
fi
53
 
54
rm $listfile
55
echo "   </tr>
56
  </table>
57
  <script type=\"text/javascript\">
58
 
59
  </script>
60
 </body>
5539 schaersvoo 61
</html>
62
">> $htmlfile  
63
else
11717 schaersvoo 64
 place=`pwd`
65
 echo "
66
 no file called \"wims_mathml.l\" in this script directory $place ! "
67
 read whatever
5539 schaersvoo 68
fi
11717 schaersvoo 69
 
70
exit
71