--- loncom/xml/lontexconvert.pm 2016/08/05 21:24:01 1.112.2.6 +++ loncom/xml/lontexconvert.pm 2019/02/15 20:56:22 1.122 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # TeX Conversion Module # -# $Id: lontexconvert.pm,v 1.112.2.6 2016/08/05 21:24:01 raeburn Exp $ +# $Id: lontexconvert.pm,v 1.122 2019/02/15 20:56:22 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -178,6 +178,7 @@ sub convert_real { $xmlstring=~s/^\s*\
'.$$texstring.''; + return &MathJax_header().$startspan. + ''.$endspan; } { @@ -296,6 +305,16 @@ sub MathJax_converted { return ''."\n"; } + #sub MathJax_process { + # my $state = pop(@MathJax_sent_header); + # return '' if !$state; + # return "\n". + # ''."\n"; + #} + #sub MathJax_state { + # my ($level) = @_; + # return $MathJax_sent_header[$level]; + #} } sub tex_engine { @@ -320,7 +339,12 @@ sub tex_engine { } return $env{'environment.texengine'}; } - return 'tth'; + my $dom = $env{'request.role.domain'} || $env{'user.domain'}; + my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); + if ($domdefaults{'texengine'} ne '') { + return $domdefaults{'texengine'}; + } + return $Apache::lonnet::deftex; } sub init_math_support { @@ -388,9 +412,9 @@ sub converted { if ($mode =~ /tth/i) { return &tth_converted($string); } elsif ($mode =~ /jsmath/i) { - return &MathJax_converted($string); - } elsif ($mode =~ /mathjax/i) { return &MathJax_converted($string); + } elsif ($mode =~ /mathjax/i) { + return &MathJax_converted($string); } elsif ($mode =~ /mimetex/i) { return &mimetex_converted($string); } elsif ($mode =~ /raw/i) {