version 1.112.2.5, 2016/08/05 21:04:25
|
version 1.112.2.8, 2019/02/15 17:52:54
|
Line 270 sub displaystyle {
|
Line 270 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 320 sub tex_engine {
|
Line 328 sub tex_engine {
|
} |
} |
return $env{'environment.texengine'}; |
return $env{'environment.texengine'}; |
} |
} |
|
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 'tth'; |
return 'tth'; |
} |
} |
|
|
Line 388 sub converted {
|
Line 401 sub converted {
|
if ($mode =~ /tth/i) { |
if ($mode =~ /tth/i) { |
return &tth_converted($string); |
return &tth_converted($string); |
} elsif ($mode =~ /jsmath/i) { |
} elsif ($mode =~ /jsmath/i) { |
return &jMathJax_converted($string); |
return &MathJax_converted($string); |
} elsif ($mode =~ /mathjax/i) { |
} elsif ($mode =~ /mathjax/i) { |
return &MathJax_converted($string); |
return &MathJax_converted($string); |
} elsif ($mode =~ /mimetex/i) { |
} elsif ($mode =~ /mimetex/i) { |
Line 537 sub postprocess_algebra {
|
Line 550 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; |
Line 603 Header
|
Line 616 Header
|
|
|
=item tex_engine() |
=item tex_engine() |
|
|
|
|
=item init_math_support() |
=item init_math_support() |
|
|
=item mimetex_valign() |
=item mimetex_valign() |