version 1.14, 2003/02/03 18:03:53
|
version 1.16, 2003/02/14 19:35:55
|
Line 46 use tth;
|
Line 46 use tth;
|
use vars qw($errorstring); |
use vars qw($errorstring); |
use Apache::lonmsg; |
use Apache::lonmsg; |
use Apache::lonxml; |
use Apache::lonxml; |
|
use Apache::lonmenu; |
|
|
# ====================================================================== Header |
# ====================================================================== Header |
|
|
Line 70 sub header {
|
Line 71 sub header {
|
return &Apache::lonxml::xmlbegin(). |
return &Apache::lonxml::xmlbegin(). |
&Apache::lonxml::fontsettings(). |
&Apache::lonxml::fontsettings(). |
"\n<head>\n". |
"\n<head>\n". |
&Apache::lonxml::registerurl(undef,'tex'). |
&Apache::lonmenu::registerurl(undef,'tex'). |
"\n</head>\n"; |
"\n</head>\n"; |
} |
} |
|
|
Line 122 sub to_convert {
|
Line 123 sub to_convert {
|
sub msgtexconverted { |
sub msgtexconverted { |
my $message=shift; |
my $message=shift; |
|
|
#FIXME this crap needs to go but right now the -L option might be |
|
#ignored if this isn;t the first time the tth engine is used |
|
#thus the \\document class crap, it makes sure we init the LaTeX stuff |
|
if ($ENV{'browser.mathml'}) { |
if ($ENV{'browser.mathml'}) { |
&tth::ttminit(); |
&tth::ttminit(); |
&tth::ttmoptions("-L"); |
if ($ENV{'browser.unicode'}) { |
|
&tth::ttmoptions('-L -u1'); |
|
} else { |
|
&tth::ttmoptions('-L -u0'); |
|
} |
} else { |
} else { |
&tth::tthinit(); |
&tth::tthinit(); |
&tth::tthoptions("-L"); |
if ($ENV{'browser.unicode'}) { |
|
&tth::tthoptions('-L -u1'); |
|
} else { |
|
&tth::tthoptions('-L -u0'); |
|
} |
} |
} |
$message=~s/(\$\$.+?\$\$)/&to_convert("\\documentclass{article}".$1)/ge; |
$message=~s/(\$\$.+?\$\$)/&to_convert($1)/ge; |
$message=~s/(\$.+?\$)/&to_convert("\\documentclass{article}".$1)/ge; |
$message=~s/(\$.+?\$)/&to_convert($1)/ge; |
$message=~s/(\\\(.+?\\\))/&to_convert("\\documentclass{article}".$1)/ge; |
$message=~s/(\\\(.+?\\\))/&to_convert($1)/ge; |
$message=~s/(\\\[.+?\\\])/&to_convert("\\documentclass{article}".$1)/ge; |
$message=~s/(\\\[.+?\\\])/&to_convert($1)/ge; |
return $message.$errorstring; |
return $message.$errorstring; |
} |
} |
|
|