Subversion Repositories wimsdev

Rev

Rev 5691 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5691 Rev 11717
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
oeffile="wims_mathml_info.oef"
-
 
3
phtmlfile="wims_mathml_info.phtml"
-
 
-
 
2
 
4
htmlfile="wims_mathml_info.html"
3
htmlfile="wims_mathml_info.html"
-
 
4
 
5
idx=`date +%s`
5
idx=`date +%s`
-
 
6
datum=`date +%m/%Y`
6
listfile="/tmp/list.$idx"
7
listfile="/tmp/list.$idx"
7
if [ -e wims_mathml.l ] ; then
8
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\">
9
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
18
<html>
10
<html>
19
    <head>
11
 <head>
20
            <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
12
  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
-
 
13
  <title>Latex supported in wims_mathml</title>
21
            <title>
14
 </head>
22
                    Latex supported in wims_mathml
15
 <style type=\"text/css\">
23
            </title>
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;}
24
    </head>
26
 </style>
25
    <body>
27
 <body>
26
    <table summary=\"latex commands\" style=\"font-size:8px\"><tr>" > $htmlfile
28
 <table summary=\"latex commands\" class=\"tabel\"><caption style=\"font-size:0.5em;\">($datum) wims_mathml (click to see the command)</caption><tr>" > $htmlfile
27
firstletter="a"
-
 
28
Tr=4;
29
Tr=4;
29
# 5 columns... !
30
# 5 columns... 
30
echo  "         <th>Environments</td><th>\begin{env}&sdot;&sdot;&sdot;\end{env}</th>" >> $htmlfile
31
cat wims_mathml.l | grep "^\"" | awk -F\" '{if($2 != "<" && length($2)>5) print $2}' | tr '&{([]})#\' ' ' | sort -duif> $listfile
31
p=0
-
 
32
e=$(($Tr - 2))
-
 
33
while [ $p -le $e ] ;do
32
while read line ; do
34
    echo "<td>&nbsp;</td>" >> $htmlfile
-
 
35
    p=$(($p+1))
-
 
36
done
-
 
37
echo "</tr><tr>" >> $htmlfile
-
 
38
 
33
 
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
34
 chk=`echo $line | wc -c | tr -d '[:blank:]'`
42
    a=$(($a+1))
-
 
43
    if [ $a -gt $Tr ] ; then
35
 if [ $chk -gt 1 ] ; then
44
        echo "</tr><tr>" >> $htmlfile
36
  math=`./wims_mathml --tex-size "200%" --tex-string "\\\\$line"`
45
        a=0
-
 
46
    fi
-
 
47
done
-
 
48
p=0
-
 
49
e=$(($Tr - $a))
-
 
50
while [ $p -le $e ] ;do
37
  chk=`echo $math | grep "&" | wc -l | tr -d '[:blank:]'`
51
    echo "<td>&nbsp;</td>" >> $htmlfile
38
  if [ "$math" = "\$ERROR" ] || [ "$math" = "ERROR" ] || [ "$chk" = "0" ] ; then
52
    p=$(($p+1))
-
 
53
done
-
 
54
echo "</tr><tr>" >> $htmlfile
39
   echo "<td><a>\\$line</a><div>see latex syntax</div></td>" >> $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
40
  else
59
    while [ $a -le $Tr ] ; do
-
 
60
        echo "<th>$firstletter</th>\c" >> $htmlfile
41
   echo "<td><a>$math</a><div>\\$line</div></td>" >> $htmlfile
61
        a=$((a+1))
-
 
62
    done
42
  fi
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
43
 fi
70
            while [ $a -le $Tr ] ; do
-
 
71
                echo  "<td>&nbsp;</td>" >> $htmlfile
-
 
72
                a=$((a+1))
44
 p=$(($p+1))
73
            done
-
 
74
            echo  "</tr><tr>" >> $htmlfile
-
 
75
            a=0
-
 
76
            while [ $a -le $Tr ] ; do
45
 if [ $p -gt $Tr ] ; then
77
                echo  "<th>$firstletter</th>" >> $htmlfile
-
 
78
                a=$((a+1))
-
 
79
            done
-
 
80
            echo  "</tr><tr>" >> $htmlfile
46
  echo  "</tr><tr>">> $htmlfile
81
            p=0
47
  p=0
82
        fi
48
 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
49
done < "$listfile"
89
</td></tr>" >> $phtmlfile
-
 
90
            p=$((p+1))
-
 
91
            if [ $p -gt $Tr ] ; then
50
if [ $p -gt $Tr ] ; then
92
                echo  "</tr><tr>">> $htmlfile
51
 echo  "</tr><tr>">> $htmlfile
93
                p=0
-
 
94
            fi
-
 
95
        fi
52
fi
96
    done < "$listfile"
53
   
97
    rm $listfile
54
rm $listfile
98
    echo "      </tr>
55
echo "   </tr>
99
        </table>
56
  </table>
-
 
57
  <script type=\"text/javascript\">
-
 
58
   
-
 
59
  </script>
100
    </body>
60
 </body>
101
</html>
61
</html>
102
">> $htmlfile  
62
">> $htmlfile  
103
echo "</table>
-
 
104
}" >> $oeffile
-
 
105
echo "</table>
-
 
106
" >> $phtmlfile
-
 
107
else
63
else
108
    place=`pwd`
64
 place=`pwd`
109
    echo "
65
 echo "
110
   
-
 
111
    no file called \"wims_mathml.l\" in this script directory $place !
66
 no file called \"wims_mathml.l\" in this script directory $place ! "
112
   
-
 
113
    "
-
 
114
    read whatever
67
 read whatever
115
fi
68
fi
-
 
69
 
-
 
70
exit
-
 
71