version 1.118, 2016/02/20 00:12:45
|
version 1.121, 2018/04/23 18:59:28
|
Line 271 sub displaystyle {
|
Line 271 sub displaystyle {
|
|
|
sub MathJax_converted { |
sub MathJax_converted { |
my $texstring=shift; |
my $texstring=shift; |
my $tag='math/tex;'; |
my ($tag,$startspan,$endspan); |
if (&displaystyle($texstring)) { $tag='math/tex; mode=display'; } |
$tag='math/tex;'; |
|
if (&displaystyle($texstring)) { |
|
$tag='math/tex; mode=display'; |
|
$startspan=''; |
|
$endspan=''; |
|
} else { |
|
$startspan='<span style="display:inline-block;">'; |
|
$endspan='</span>'; |
|
} |
&clean_out_math_mode($texstring); |
&clean_out_math_mode($texstring); |
return &MathJax_header(). |
return &MathJax_header().$startspan. |
'<script type="'.$tag.'">'.$$texstring.'</script>'; |
'<script type="'.$tag.'">'.$$texstring.'</script>'.$endspan; |
} |
} |
|
|
{ |
{ |
Line 331 sub tex_engine {
|
Line 339 sub tex_engine {
|
} |
} |
return $env{'environment.texengine'}; |
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 { |
sub init_math_support { |
Line 548 sub postprocess_algebra {
|
Line 561 sub postprocess_algebra {
|
# $string =~s/\\fun/ /g; |
# $string =~s/\\fun/ /g; |
|
|
# sqrt(3,4) means the 4 root of 3 |
# 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 |
# log(3,4) means the log base 4 of 3 |
$string =~s/\\log\\left\((.+?),(.+?)\\right\)/\\log_{$2}\\left($1\\right)/gs; |
$string =~s/\\log\\left\((.+?),(.+?)\\right\)/\\log_{$2}\\left($1\\right)/gs; |