--- loncom/xml/lonxml.pm 2003/11/06 19:24:11 1.291 +++ loncom/xml/lonxml.pm 2003/11/21 18:54:10 1.294 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.291 2003/11/06 19:24:11 sakharuk Exp $ +# $Id: lonxml.pm,v 1.294 2003/11/21 18:54:10 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -337,8 +337,8 @@ sub xmlparse { &Apache::style::styleparser($target,$styletext)); } } - } elsif ($ENV{'construction_space_style'} && ($ENV{'request.state'} eq 'construct')) { - my $location=&Apache::lonnet::filelocation('',$ENV{'construction_space_style'}); + } elsif ($ENV{'construct.style'} && ($ENV{'request.state'} eq 'construct')) { + my $location=&Apache::lonnet::filelocation('',$ENV{'construct.style'}); my $styletext=&Apache::lonnet::getfile($location); if ($styletext ne '-1') { %style_for_target = (%style_for_target, @@ -404,7 +404,9 @@ sub latex_special_symbols { $string=~s/\\ /\\char92 /g; $string=~s/\^/\\\^ /g; $string=~s/\~/\\char126 /g; - $string=~s/(&[^A-Za-z\#])/\\$1/g; + #fixup & if it doesn't look like + # { or α + $string=~s/(&(?!((\#[0-9]+)|([a-z]+));))/\\$1/gi; $string=~s/([^&])\#/$1\\#/g; $string=~s/(\$|_|{|})/\\$1/g; $string=~s/\\char92 /\\texttt{\\char92}/g; @@ -992,6 +994,7 @@ sub parstring { my $val=$token->[2]->{$_}; $val =~ s/([\%\@\\\"\'])/\\$1/g; #if ($val =~ m/^[\%\@]/) { $val="\\".$val; } + if ($val !~ m/^\s*\$[a-z_]/i) { $val =~ s/\$/\\\$/g; } $temp .= "my \$$_=\"$val\";"; } }