Package: smlnj / 110.79-2

mltex2html-perl-fixes Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
diff --git i/MLRISC/Doc/html/mltex2html w/MLRISC/Doc/html/mltex2html
index 24d393f..d76b5aa 100755
--- i/MLRISC/Doc/html/mltex2html
+++ w/MLRISC/Doc/html/mltex2html
@@ -1000,6 +1000,7 @@ newcommand("tableofcontents", 0, \&tableofcontents);
 # Import style file
 #
 ############################################################################
+use lib '.';
 require "mltex.thm";
 
 ############################################################################
@@ -1266,7 +1267,7 @@ sub processSection
 
      # Verbatim mode handling
      if ($MODE eq "verbatim")
-     {  if (s|\\end{verbatim}|$ENDPRE|) { leaveMode("verbatim"); }
+     {  if (s|\\end\{verbatim\}|$ENDPRE|) { leaveMode("verbatim"); }
         else 
         { s/</&lt;/g;
           s/>/&gt;/g;
@@ -1276,7 +1277,7 @@ sub processSection
      }
 
      if ($MODE eq "alltt")
-     {  if (s|\\end{alltt}|$ENDALLTT|) { leaveMode("alltt"); };
+     {  if (s|\\end\{alltt\}|$ENDALLTT|) { leaveMode("alltt"); };
         push @TEXT, $_;
         next;
      }
@@ -1296,16 +1297,16 @@ sub processSection
      }
  
      # special formatting environments 
-     if (s|\\begin{SML}|$BEGINPRE|) { enterMode("sml"); };
-     if (s|\\end{SML}|$ENDPRE|) { leaveMode("sml"); };
-     if (s|\\begin{code}|$BEGINPRE|) { enterMode("code"); };
-     if (s|\\end{code}|$ENDPRE|) { leaveMode("code"); };
-     if (s|\\begin{verbatim}|$BEGINPRE|) { enterMode("verbatim"); };
-     if (s|\\begin{alltt}|$BEGINALLTT|) { enterMode("alltt"); };
+     if (s|\\begin\{SML\}|$BEGINPRE|) { enterMode("sml"); };
+     if (s|\\end\{SML\}|$ENDPRE|) { leaveMode("sml"); };
+     if (s|\\begin\{code\}|$BEGINPRE|) { enterMode("code"); };
+     if (s|\\end\{code\}|$ENDPRE|) { leaveMode("code"); };
+     if (s|\\begin\{verbatim\}|$BEGINPRE|) { enterMode("verbatim"); };
+     if (s|\\begin\{alltt\}|$BEGINALLTT|) { enterMode("alltt"); };
 
      # method
-     if (s|\\begin{methods}|<dl><dt><tt>|) { enterMode("methods"); };
-     if (s|\\end{methods}|</tt></dl>|) { leaveMode("methods"); };
+     if (s|\\begin\{methods\}|<dl><dt><tt>|) { enterMode("methods"); };
+     if (s|\\end\{methods\}|</tt></dl>|) { leaveMode("methods"); };
      s|\&|</tt><dd>|g if $MODE eq "methods";
      s|\\\\|<dt><tt>|g if $MODE eq "methods";
 
@@ -1314,19 +1315,19 @@ sub processSection
      s|\\item|<li>|;
   
      # Tables
-     s|\\begin{tabular}{($PARAM)}|&begintab($1,"")|oge;
-     s|\\end{tabular}|&endtab()|oge;
+     s|\\begin\{tabular\}\{($PARAM)\}|&begintab($1,"")|oge;
+     s|\\end\{tabular\}|&endtab()|oge;
      
-     s|\\begin{Table}{($PARAM)}{($PARAM)}|&begintab($1,$2)|oge;
-     s|\\end{Table}|&endtab()|oge;
+     s|\\begin\{Table\}\{($PARAM)\}\{($PARAM)\}|&begintab($1,$2)|oge;
+     s|\\end\{Table\}|&endtab()|oge;
 
      s|\&|&addtab()|oge if $MODE eq "tabular";
      s|\\\\|&tabnewline()|oge if $MODE eq "tabular";
      s|\\\\|&newline()|oge if $MODE eq "latex";
   
      # SML mode handling
-     s|\\sml{($PARAM)}|&sml($1)|oge;
-     s|\\code{($PARAM)}|<tt>\1</tt>|g;
+     s|\\sml\{($PARAM)\}|&sml($1)|oge;
+     s|\\code\{($PARAM)\}|<tt>\1</tt>|g;
      if ($MODE eq "sml") { $_ = smldisplay($_); }
   
      # Math mode handling
@@ -1342,27 +1343,27 @@ sub processSection
 
      if (s|\\\[\s*$|<dl><dt><dd>|) { enterMode("displaymath"); }
      if (s|\\\]|</dl>|) { leaveMode("displaymath"); }
-     if (s|\\begin{eqnarray\*}|<dl><dt><dd>|) { enterMode("eqnarray*"); }
-     if (s|\\end{eqnarray\*}|</dl>|) { leaveMode("eqnarray*"); }
-     if (s|\\begin{eqnarray}|<dl><dt><dd>|) { enterMode("eqnarray"); }
-     if (s|\\end{eqnarray}|</dl>|) { leaveMode("eqnarray"); }
+     if (s|\\begin\{eqnarray\*\}|<dl><dt><dd>|) { enterMode("eqnarray*"); }
+     if (s|\\end\{eqnarray\*\}|</dl>|) { leaveMode("eqnarray*"); }
+     if (s|\\begin\{eqnarray\}|<dl><dt><dd>|) { enterMode("eqnarray"); }
+     if (s|\\end\{eqnarray\}|</dl>|) { leaveMode("eqnarray"); }
 
      # How to handle environment
-     s|~?\\begin{($ENV0)}|&beginenv($1)|oge;
-     s|~?\\begin{($ENV1)}{($PARAM)}|&beginenv($1,$2)|oge;
-     s|~?\\begin{($ENV2)}{($PARAM)}{($PARAM)}|&beginenv($1,$2,$3)|oge;
-     s|~?\\end{($PARAM)}|&endenv($1)|oge;
+     s|~?\\begin\{($ENV0)\}|&beginenv($1)|oge;
+     s|~?\\begin\{($ENV1)\}\{($PARAM)\}|&beginenv($1,$2)|oge;
+     s|~?\\begin\{($ENV2)\}\{($PARAM)\}\{($PARAM)\}|&beginenv($1,$2,$3)|oge;
+     s|~?\\end\{($PARAM)\}|&endenv($1)|oge;
 
      # How to handle commands
      s/~?\\($COMMAND0)(\{\}|\b)/&command($1)/oge;
-     s|~?\\($COMMAND1){($PARAM)}|&command($1,$2)|oge;
-     s|~?\\($COMMAND2){($PARAM)}{($PARAM)}|&command($1,$2,$3)|oge;
-     s|~?\\($COMMAND3){($PARAM)}{($PARAM)}{($PARAM)}|&command($1,$2,$3,$4)|oge;
+     s|~?\\($COMMAND1)\{($PARAM)\}|&command($1,$2)|oge;
+     s|~?\\($COMMAND2)\{($PARAM)\}\{($PARAM)\}|&command($1,$2,$3)|oge;
+     s|~?\\($COMMAND3)\{($PARAM)\}\{($PARAM)\}\{($PARAM)\}|&command($1,$2,$3,$4)|oge;
 
      # Math mode stuff
      s|\\_|_|g;
-     s|\\{|{|g;
-     s|\\}|}|g;
+     s|\\\{|{|g;
+     s|\\\}|}|g;
 
      # Indentation
      s|\\noindent ||g;