# The LearningOnline Network with CAPA # TeX Content Handler # # 05/29/00,05/30,10/11 Gerd Kortemeyer package Apache::lontex; use strict; use Apache::File; use Apache::lontexconvert; use Apache::Constants qw(:common); use tth; # ================================================================ Main Handler sub handler { my $r=shift; my @texcontents; my $texstring; # ----------------------------------------------------------- Set document type if ($ENV{'browser.mathml'}) { $r->content_type('text/xml'); } else { $r->content_type('text/html'); } $r->send_http_header; return OK if $r->header_only; # ------------------------------------------------------------------- Read file { my $fh=Apache::File->new($r->filename); @texcontents=<$fh>; } $texstring=join("\n",@texcontents); # --------------------------------------------------------------- Render Output $r->print(&Apache::lontexconvert::header()); $r->print( ''); $r->print(&Apache::lontexconvert::converted(\$texstring)); $r->print(''); $r->print(&Apache::lontexconvert::footer()); return OK; } 1; __END__