Diff for /loncom/xml/lontexconvert.pm between versions 1.12 and 1.16

version 1.12, 2002/10/28 20:40:25 version 1.16, 2003/02/14 19:35:55
Line 37 Line 37
 # to any other parties under any circumstances.  # to any other parties under any circumstances.
 #  #
 # 05/29/00,05/30,10/11,10/20 Gerd Kortemeyer  # 05/29/00,05/30,10/11,10/20 Gerd Kortemeyer
 # 05/03/2001 Scott Harrison  
 # 5/4 Gerd Kortemeyer  # 5/4 Gerd Kortemeyer
   
 package Apache::lontexconvert;  package Apache::lontexconvert;
Line 47  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 55  sub header { Line 55  sub header {
   my $time=time;    my $time=time;
   if ($ENV{'browser.mathml'}) {    if ($ENV{'browser.mathml'}) {
       &tth::ttminit();        &tth::ttminit();
         if ($ENV{'browser.unicode'}) {
     &tth::ttmoptions('-L -u1');
         } else {
     &tth::ttmoptions('-L -u0');
         }
   } else {    } else {
       &tth::tthinit();        &tth::tthinit();
         if ($ENV{'browser.unicode'}) {
     &tth::tthoptions('-L -u1');
         } else {
     &tth::tthoptions('-L -u0');
         }
   }    }
   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 113  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;
 }  }
   

Removed from v.1.12  
changed lines
  Added in v.1.16


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>