Diff for /loncom/xml/lontexconvert.pm between versions 1.112.2.1 and 1.112.2.2

version 1.112.2.1, 2012/05/10 19:19:30 version 1.112.2.2, 2012/05/25 16:42:28
Line 241  sub displaystyle { Line 241  sub displaystyle {
     return 0;      return 0;
 }  }
   
   sub MathJax_converted {
       my $texstring=shift;
       my $tag='math/tex;';
       if (&displaystyle($texstring)) { $tag='math/tex; mode=display'; }
       &clean_out_math_mode($texstring);
       return &MathJax_header().
         '<script type="'.$tag.'">'.$$texstring.'</script>';
   }
   
   {
       #Relies heavily on the previous jsMath installation
       my @MathJax_sent_header;
       sub MathJax_reset {
           undef(@MathJax_sent_header);
       }
       sub MathJax_push {
           push(@MathJax_sent_header,0);
       }
       sub MathJax_header {
           if (!@MathJax_sent_header) {
               &Apache::lonnet::logthis("mismatched calls of MathJax_header and MathJax_process");
               return '';
           }
           return '' if $MathJax_sent_header[-1];
           $MathJax_sent_header[-1]=1;
           return
             '<script type="text/javascript" src="/adm/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>'."\n";
       }
   }
   
 sub jsMath_converted {  sub jsMath_converted {
     my $texstring=shift;      my $texstring=shift;
     my $tag='span';      my $tag='span';
Line 308  sub init_math_support { Line 338  sub init_math_support {
  ($inherit_jsmath && &jsMath_state(-2))) {   ($inherit_jsmath && &jsMath_state(-2))) {
  return &Apache::lontexconvert::jsMath_header();   return &Apache::lontexconvert::jsMath_header();
     }      }
       &Apache::lontexconvert::MathJax_push();
       if (lc(&tex_engine()) eq 'mathjax') { # ||
           #($inherit_jsmath && &jsMath_state(-2))) {
           return &Apache::lontexconvert::MathJax_header();
       }
     return;      return;
 }  }
   
Line 368  sub converted { Line 403  sub converted {
  return &tth_converted($string);   return &tth_converted($string);
     } elsif ($mode =~ /jsmath/i) {      } elsif ($mode =~ /jsmath/i) {
  return &jsMath_converted($string);   return &jsMath_converted($string);
       } elsif ($mode =~ /mathjax/i) {
           return &MathJax_converted($string);
     } elsif ($mode =~ /mimetex/i) {      } elsif ($mode =~ /mimetex/i) {
  return &mimetex_converted($string);   return &mimetex_converted($string);
     } elsif ($mode =~ /raw/i) {      } elsif ($mode =~ /raw/i) {
Line 576  Header Line 613  Header
   
 =item jsMath_converted()  =item jsMath_converted()
   
   =item MathJax_converted()
           - Mimics the jsMath functionality
   
 =item tex_engine()  =item tex_engine()
   
   

Removed from v.1.112.2.1  
changed lines
  Added in v.1.112.2.2


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