Subversion Repositories wimsdev

Rev

Rev 5690 | Rev 11717 | 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
2
oeffile="wims_mathml_info.oef"
3
phtmlfile="wims_mathml_info.phtml"
4
htmlfile="wims_mathml_info.html"
5
idx=`date +%s`
6
listfile="/tmp/list.$idx"
7
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\">
18
<html>
19
    <head>
20
            <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
21
            <title>
22
                    Latex supported in wims_mathml
23
            </title>
24
    </head>
25
    <body>
26
    <table summary=\"latex commands\" style=\"font-size:8px\"><tr>" > $htmlfile
27
firstletter="a"
28
Tr=4;
5691 bpr 29
# 5 columns... !
5690 bpr 30
echo  "         <th>Environments</td><th>\begin{env}&sdot;&sdot;&sdot;\end{env}</th>" >> $htmlfile
5539 schaersvoo 31
p=0
32
e=$(($Tr - 2))
33
while [ $p -le $e ] ;do
5690 bpr 34
    echo "<td>&nbsp;</td>" >> $htmlfile
5539 schaersvoo 35
    p=$(($p+1))
36
done
5690 bpr 37
echo "</tr><tr>" >> $htmlfile
5539 schaersvoo 38
 
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
5690 bpr 41
    echo "<td>$p</td>" >> $htmlfile
5539 schaersvoo 42
    a=$(($a+1))
43
    if [ $a -gt $Tr ] ; then
5690 bpr 44
        echo "</tr><tr>" >> $htmlfile
5539 schaersvoo 45
        a=0
46
    fi
47
done
48
p=0
49
e=$(($Tr - $a))
50
while [ $p -le $e ] ;do
5690 bpr 51
    echo "<td>&nbsp;</td>" >> $htmlfile
5539 schaersvoo 52
    p=$(($p+1))
53
done
5690 bpr 54
echo "</tr><tr>" >> $htmlfile
5539 schaersvoo 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
59
    while [ $a -le $Tr ] ; do
5690 bpr 60
        echo "<th>$firstletter</th>\c" >> $htmlfile
5539 schaersvoo 61
        a=$((a+1))
62
    done
5690 bpr 63
    echo "</tr><tr>">> $htmlfile
5539 schaersvoo 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
70
            while [ $a -le $Tr ] ; do
5690 bpr 71
                echo  "<td>&nbsp;</td>" >> $htmlfile
5539 schaersvoo 72
                a=$((a+1))
73
            done
5690 bpr 74
            echo  "</tr><tr>" >> $htmlfile
5539 schaersvoo 75
            a=0
76
            while [ $a -le $Tr ] ; do
5690 bpr 77
                echo  "<th>$firstletter</th>" >> $htmlfile
5539 schaersvoo 78
                a=$((a+1))
79
            done
5690 bpr 80
            echo  "</tr><tr>" >> $htmlfile
5539 schaersvoo 81
            p=0
82
        fi
83
        chk=`echo $line | wc -c | tr -d '[:blank:]'`
84
        if [ $chk -gt 1 ] ; then
5691 bpr 85
            echo "<td>\\\\$line\c</td>" >> $htmlfile
5539 schaersvoo 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
89
</td></tr>" >> $phtmlfile
90
            p=$((p+1))
91
            if [ $p -gt $Tr ] ; then
5690 bpr 92
                echo  "</tr><tr>">> $htmlfile
5539 schaersvoo 93
                p=0
94
            fi
95
        fi
96
    done < "$listfile"
97
    rm $listfile
98
    echo "      </tr>
99
        </table>
100
    </body>
101
</html>
102
">> $htmlfile  
103
echo "</table>
104
}" >> $oeffile
105
echo "</table>
106
" >> $phtmlfile
107
else
108
    place=`pwd`
109
    echo "
110
 
111
    no file called \"wims_mathml.l\" in this script directory $place !
112
 
113
    "
114
    read whatever
115
fi