version 1.68, 2005/08/16 16:29:53
|
version 1.72, 2006/04/11 18:42:43
|
Line 42 package Apache::lontexconvert;
|
Line 42 package Apache::lontexconvert;
|
use strict; |
use strict; |
use tth(); |
use tth(); |
use vars qw($errorstring); |
use vars qw($errorstring); |
use Apache(); |
|
use Apache::lonmsg(); |
use Apache::lonmsg(); |
use Apache::lonxml(); |
use Apache::lonxml(); |
use Apache::lonmenu(); |
use Apache::lonmenu(); |
Line 70 sub init_tth {
|
Line 69 sub init_tth {
|
} |
} |
} |
} |
|
|
sub header { |
|
$errorstring=''; |
|
my $time=time; |
|
&init_tth(); |
|
return &Apache::lonxml::xmlbegin(). |
|
"\n<head>\n". |
|
&Apache::lonxml::fontsettings(). |
|
&Apache::lonmenu::registerurl(undef,'tex'). |
|
"\n</head>\n"; |
|
} |
|
|
|
# ================================================================== Conversion |
# ================================================================== Conversion |
|
|
$Apache::lontexconvert::messedup=0; |
$Apache::lontexconvert::messedup=0; |
Line 137 ENDCONV
|
Line 125 ENDCONV
|
$errorstring) { |
$errorstring) { |
&Apache::lonnet::logthis("Trying to kill myself"); |
&Apache::lonnet::logthis("Trying to kill myself"); |
$Apache::lontexconvert::messedup=1; |
$Apache::lontexconvert::messedup=1; |
my $request=Apache->request(); |
if (ref($Apache::lonxml::request)) { |
$request->child_terminate(); |
$Apache::lonxml::request->child_terminate(); |
|
} else { |
|
my $request; |
|
eval { $request=Apache->request; }; |
|
if (!$request) { |
|
eval { $request=Apache2::RequestUtil->request; }; |
|
} |
|
if ($request) { |
|
$request->child_terminate(); |
|
} else { |
|
&Apache::lonnet::logthis("Unable to find a request to do child_terminate on"); |
|
} |
|
} |
} |
} |
return $xmlstring; |
return $xmlstring; |
} |
} |
Line 181 sub jsMath_converted {
|
Line 181 sub jsMath_converted {
|
'<script type="text/javascript"> |
'<script type="text/javascript"> |
function NoFontMessage () {} |
function NoFontMessage () {} |
</script>'."\n". |
</script>'."\n". |
'<script src="/adm/jsMath/jsMath.js"></script>'."\n"; |
'<script type="text/javascript" src="/adm/jsMath/jsMath.js"></script>'."\n"; |
} |
} |
sub jsMath_process { |
sub jsMath_process { |
return '' if !$jsMath_sent_header; |
return '' if !$jsMath_sent_header; |
Line 189 sub jsMath_converted {
|
Line 189 sub jsMath_converted {
|
} |
} |
} |
} |
|
|
|
sub init_math_support { |
|
&Apache::lontexconvert::jsMath_reset(); |
|
if ($env{'environment.texengine'} eq 'jsMath' || |
|
$env{'form.texengine'} eq 'jsMath' ) { |
|
return &Apache::lontexconvert::jsMath_header(); |
|
} |
|
return; |
|
} |
|
|
sub mimetex_converted { |
sub mimetex_converted { |
my $texstring=shift; |
my $texstring=shift; |
my $displaystyle=&displaystyle($texstring); |
my $displaystyle=&displaystyle($texstring); |
Line 218 sub converted {
|
Line 227 sub converted {
|
return &tth_converted($string); |
return &tth_converted($string); |
} |
} |
|
|
# ====================================================================== Footer |
|
|
|
sub footer { |
|
my $xmlstring=''; |
|
if ($env{'request.state'} eq 'construct') { |
|
$xmlstring.='<address>'.$errorstring.'</address>'; |
|
} else { |
|
&Apache::lonmsg::author_res_msg($env{'request.filename'},$errorstring); |
|
} |
|
# -------------------------------------------------------------------- End Body |
|
$xmlstring.=&Apache::lonxml::xmlend(); |
|
return $xmlstring; |
|
} |
|
|
|
# ------------------------------------------------------------ Message display |
# ------------------------------------------------------------ Message display |
|
|
sub to_convert { |
sub to_convert { |