--- loncom/xml/lontexconvert.pm 2017/10/07 00:50:57 1.120 +++ 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.120 2017/10/07 00:50:57 raeburn Exp $ +# $Id: lontexconvert.pm,v 1.122 2019/02/15 20:56:22 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -271,11 +271,19 @@ sub displaystyle { sub MathJax_converted { my $texstring=shift; - my $tag='math/tex;'; - if (&displaystyle($texstring)) { $tag='math/tex; mode=display'; } + my ($tag,$startspan,$endspan); + $tag='math/tex;'; + if (&displaystyle($texstring)) { + $tag='math/tex; mode=display'; + $startspan=''; + $endspan=''; + } else { + $startspan=''; + $endspan=''; + } &clean_out_math_mode($texstring); - return &MathJax_header(). - ''; + return &MathJax_header().$startspan. + ''.$endspan; } { @@ -313,7 +321,7 @@ sub tex_engine { if (exists($env{'form.texengine'})) { if ($env{'form.texengine'} ne '') { if (lc($env{'form.texengine'}) eq 'jsmath') { - return 'MathJax'; + return 'MathJax'; } return $env{'form.texengine'}; } @@ -336,7 +344,7 @@ sub tex_engine { if ($domdefaults{'texengine'} ne '') { return $domdefaults{'texengine'}; } - return 'MathJax'; + return $Apache::lonnet::deftex; } sub init_math_support {