Index: /main/trunk/greenstone2/perllib/plugins/BibTexPlugin.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugins/BibTexPlugin.pm	(revision 31779)
+++ /main/trunk/greenstone2/perllib/plugins/BibTexPlugin.pm	(revision 31780)
@@ -791,5 +791,5 @@
 
     # quoted { } chars
-    $text =~ s@\\{@{@g;
+    $text =~ s@\\\{@{@g;
     $text =~ s@\\}@}@g;
 
@@ -805,7 +805,7 @@
 
     $text =~ s@\\infty@infinity@g;       # or unicode 0x221E...
-    $text =~ s@\^{(.*?)}@<sup>$1</sup>@g; # superscript
+    $text =~ s@\^\{(.*?)}@<sup>$1</sup>@g; # superscript
     $text =~ s@\^([^\{])@<sup>$1</sup>@g;
-    $text =~ s@\_{(.*?)}@<sub>$1</sub>@g; # subscript
+    $text =~ s@\_\{(.*?)}@<sub>$1</sub>@g; # subscript
     $text =~ s@\_([^\{])@<sub>$1</sub>@g;
 
Index: /main/trunk/greenstone2/perllib/plugins/LaTeXPlugin.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugins/LaTeXPlugin.pm	(revision 31779)
+++ /main/trunk/greenstone2/perllib/plugins/LaTeXPlugin.pm	(revision 31780)
@@ -166,6 +166,6 @@
 
     ###### process latex for the main text ######
-    $$textref =~ s/^.*?\\begin{document}//s;
-    $$textref =~ s/\\end{document}.*?$//s;
+    $$textref =~ s/^.*?\\begin\{document}//s;
+    $$textref =~ s/\\end\{document}.*?$//s;
     $$textref = $self->process_latex("-html",$$textref);
     $doc_obj->add_utf8_text($cursection, $$textref);
@@ -318,5 +318,5 @@
 	return "<br/>" . $tabbing . "<br/>\n";
     }
-    $text =~ s@\\begin{tabbing}(.*?)\\end{tabbing}@do_tabbing($1)@ges;
+    $text =~ s@\\begin\{tabbing}(.*?)\\end\{tabbing}@do_tabbing($1)@ges;
     sub do_tabular {
 	my $tabular=shift;
@@ -324,9 +324,9 @@
 	$tabular =~ s~[\\][\\]\s*~</td></tr>\n <tr><td>~g;
 	$tabular =~ s~\\hline~~g; # for now...
-	$tabular =~ s~<td>\s*\\multicolumn{(\d+)}{.*?}~<td colspan="$1">~g;
+	$tabular =~ s~<td>\s*\\multicolumn\{(\d+)}\{.*?}~<td colspan="$1">~g;
 	return "<table border=\"1\">\n <tr><td>"
 	    . $tabular . "</td></tr></table>\n";
     }
-    $text =~ s@\\begin{tabular}(?:\[.*?\])?{.*?}(.*?)\\end{tabular} @
+    $text =~ s@\\begin\{tabular}(?:\[.*?\])?{.*?}(.*?)\\end\{tabular} @
     		do_tabular($1)  @xges;
 
@@ -344,5 +344,5 @@
 
     # is this an amstext environment, or just custom for that input file?
-    $text =~ s@\\begin{(algorithm)}(.*?)\\end{\1}@remove_equals($2)@ges;
+    $text =~ s@\\begin\{(algorithm)}(.*?)\\end\{\1}@remove_equals($2)@ges;
 
     # convert latex-style accented characters.
@@ -369,9 +369,9 @@
     $text =~ s~\\(?:clearemptydoublepage|newpage)~~g;
     ### counters, contents, environments, labels, etc ###
-    $text =~ s~\\(?:addcontentsline){.*?}{.*?}{.*}~~g;
-    $text =~ s~\s*\\begin{itemize}\s*~\n<ul>\n~g;
-    $text =~ s~\s*\\end{itemize}\s*~</li></ul>\n~g;
-    $text =~ s~\s*\\begin{enumerate}\s*~<ol>\n~g;
-    $text =~ s~\s*\\end{enumerate}\s*~</li></ol>\n~g;
+    $text =~ s~\\(?:addcontentsline){.*?}\{.*?}\{.*}~~g;
+    $text =~ s~\s*\\begin\{itemize}\s*~\n<ul>\n~g;
+    $text =~ s~\s*\\end\{itemize}\s*~</li></ul>\n~g;
+    $text =~ s~\s*\\begin\{enumerate}\s*~<ol>\n~g;
+    $text =~ s~\s*\\end\{enumerate}\s*~</li></ol>\n~g;
     if ($text =~ s~\s*\\item~</li>\n<li>~g) {
 	# (count for first list item)
@@ -388,5 +388,5 @@
 	$text =~ s~{\\tt\s*(.*?)}~<tt>$1</tt>~g;
 	$text =~ s~\\(?:texttt|tt|ttseries)\s*{(.*?)}~<tt>$1</tt>~g;
-	$text =~ s~\\emph{(.*?)}~<em>$1</em>~g;
+	$text =~ s~\\emph\{(.*?)}~<em>$1</em>~g;
 	$text =~ s~{\\(?:em|it)\s*(.*?)}~<em>$1</em>~g;
 	$text =~ s~{\\(?:bf|bfseries)\s*(.*?)}~<strong>$1</strong>~g;
@@ -429,5 +429,5 @@
 
     # quoted { } chars
-    $text =~ s~\\{~{~g;
+    $text =~ s~\\\{~{~g;
     $text =~ s~\\}~}~g;
 
@@ -479,10 +479,10 @@
     $text =~ s~\\cup\b~ U ~g;
 
-    $text =~ s~\\frac\s*{(.+?)}{(.+?)}~math_fraction($1,$2)~ge;
+    $text =~ s~\\frac\s*{(.+?)}\{(.+?)}~math_fraction($1,$2)~ge;
 
     if ($html_markup) {
-	$text =~ s~\^{(.*?)}~<sup>$1</sup>~g;  # a^b superscript
+	$text =~ s~\^\{(.*?)}~<sup>$1</sup>~g;  # a^b superscript
 	$text =~ s~\^([^\{])~<sup>$1</sup>~g;
-	$text =~ s~\_{(.*?)}~<sub>$1</sub>~g;  # a_b subscript
+	$text =~ s~\_\{(.*?)}~<sub>$1</sub>~g;  # a_b subscript
 	$text =~ s~\_([^\{])~<sub>$1</sub>~g;
 	
Index: /main/trunk/greenstone2/perllib/plugins/MediaWikiPlugin.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugins/MediaWikiPlugin.pm	(revision 31779)
+++ /main/trunk/greenstone2/perllib/plugins/MediaWikiPlugin.pm	(revision 31780)
@@ -663,5 +663,5 @@
             
   # extract the _content_ macro
-  $about_page_content =~ m/_content_ {(.|\n)*<\/div>\n\n<\/div>\n}/i;
+  $about_page_content =~ m/_content_ \{(.|\n)*<\/div>\n\n<\/div>\n}/i;
   $about_page_content = $&;
   
