Rev 11717 | 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> |
||
16695 | bpr | 15 | <style> |
16 | li{display:inline-block;} |
||
11717 | schaersvoo | 17 | div { display: none;} |
18 | a:active + div { display: block;background-color:yellow;} |
||
19 | </style> |
||
20 | <body> |
||
16695 | bpr | 21 | <ul>" > $htmlfile |
11717 | schaersvoo | 22 | cat wims_mathml.l | grep "^\"" | awk -F\" '{if($2 != "<" && length($2)>5) print $2}' | tr '&{([]})#\' ' ' | sort -duif> $listfile |
23 | while read line ; do |
||
16695 | bpr | 24 | |
11717 | schaersvoo | 25 | chk=`echo $line | wc -c | tr -d '[:blank:]'` |
26 | if [ $chk -gt 1 ] ; then |
||
16695 | bpr | 27 | math=`./wims_mathml --tex-size "150%" --tex-string "\\\\$line"` |
11717 | schaersvoo | 28 | chk=`echo $math | grep "&" | wc -l | tr -d '[:blank:]'` |
29 | if [ "$math" = "\$ERROR" ] || [ "$math" = "ERROR" ] || [ "$chk" = "0" ] ; then |
||
16695 | bpr | 30 | echo "<li><a>\\\\$line</a><div>see latex syntax</div></li>" >> $htmlfile |
11717 | schaersvoo | 31 | else |
16695 | bpr | 32 | echo "<li><a>$math</a><div>\\$line</div></li>" >> $htmlfile |
11717 | schaersvoo | 33 | fi |
34 | fi |
||
35 | done < "$listfile" |
||
16695 | bpr | 36 | |
11717 | schaersvoo | 37 | rm $listfile |
16695 | bpr | 38 | echo " </li> |
39 | </ul> |
||
40 | <script> |
||
41 | |||
11717 | schaersvoo | 42 | </script> |
43 | </body> |
||
5539 | schaersvoo | 44 | </html> |
16695 | bpr | 45 | ">> $htmlfile |
5539 | schaersvoo | 46 | else |
11717 | schaersvoo | 47 | place=`pwd` |
48 | echo " |
||
49 | no file called \"wims_mathml.l\" in this script directory $place ! " |
||
50 | read whatever |
||
5539 | schaersvoo | 51 | fi |
11717 | schaersvoo | 52 | |
53 | exit |