--- loncom/xml/lontexconvert.pm 2016/02/20 00:12:45 1.118 +++ loncom/xml/lontexconvert.pm 2017/10/07 00:50:57 1.120 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # TeX Conversion Module # -# $Id: lontexconvert.pm,v 1.118 2016/02/20 00:12:45 raeburn Exp $ +# $Id: lontexconvert.pm,v 1.120 2017/10/07 00:50:57 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -331,7 +331,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 'MathJax'; } sub init_math_support { @@ -548,7 +553,7 @@ sub postprocess_algebra { # $string =~s/\\fun/ /g; # sqrt(3,4) means the 4 root of 3 - $string =~s/\\sqrt{([^,]+),([^\}]+)}/\\sqrt[$2]{$1}/gs; + $string =~s/\\sqrt\{([^,]+),([^\}]+)}/\\sqrt[$2]{$1}/gs; # log(3,4) means the log base 4 of 3 $string =~s/\\log\\left\((.+?),(.+?)\\right\)/\\log_{$2}\\left($1\\right)/gs;