#!/bin/sh
htmlfile="wims_mathml_info.html"
idx=`date +%s`
datum=`date +%m/%Y`
listfile="/tmp/list.$idx"
if [ -e wims_mathml.l ] ; then
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<title>Latex supported in wims_mathml</title>
</head>
<style type=\"text/css\">
.tabel td {
padding:1px;
border-width:1px;
border-style:solid 1px;
text-align:center;
background-color:#c6d4ff;
font-size:0.4em;
}
div { display: none;}
a:active + div { display: block;background-color:yellow;}
</style>
<body>
<table summary=\"latex commands\" class=\"tabel\"><caption style=\"font-size:0.5em;\">($datum) wims_mathml (click to see the command)</caption><tr>" > $htmlfile
Tr=4;
# 5 columns...
cat wims_mathml.l | grep "^\"" | awk -F\" '{if($2 != "<" && length($2)>5) print $2}' | tr '&{([]})#\' ' ' | sort -duif> $listfile
while read line ; do
chk=`echo $line | wc -c | tr -d '[:blank:]'`
if [ $chk -gt 1 ] ; then
math=`./wims_mathml --tex-size "200%" --tex-string "\\\\$line"`
chk=`echo $math | grep "&" | wc -l | tr -d '[:blank:]'`
if [ "$math" = "\$ERROR" ] || [ "$math" = "ERROR" ] || [ "$chk" = "0" ] ; then
echo "<td><a>\\$line</a><div>see latex syntax</div></td>" >> $htmlfile
else
echo "<td><a>$math</a><div>\\$line</div></td>" >> $htmlfile
fi
fi
p=$(($p+1))
if [ $p -gt $Tr ] ; then
echo "</tr><tr>">> $htmlfile
p=0
fi
done < "$listfile"
if [ $p -gt $Tr ] ; then
echo "</tr><tr>">> $htmlfile
fi
rm $listfile
echo " </tr>
</table>
<script type=\"text/javascript\">
</script>
</body>
</html>
">> $htmlfile
else
place=`pwd`
echo "
no file called \"wims_mathml.l\" in this script directory $place ! "
read whatever
fi
exit