version 1.122, 2008/05/28 01:45:48
|
version 1.123, 2008/05/28 23:50:53
|
Line 189 sub texenginechanger {
|
Line 189 sub texenginechanger {
|
my %userenv = &Apache::lonnet::get('environment',['texengine']); |
my %userenv = &Apache::lonnet::get('environment',['texengine']); |
my $texengine=$userenv{'texengine'}; |
my $texengine=$userenv{'texengine'}; |
|
|
my $pref=&mt('Preferred method to display Math'); |
|
my %mathchoices=('' => 'Default', |
my %mathchoices=('' => 'Default', |
'tth' => 'TeX to HTML', |
'tth' => 'tth (TeX to HTML)', |
#'ttm' => 'TeX to MathML', |
#'ttm' => 'TeX to MathML', |
'jsMath' => 'jsMath', |
'jsMath' => 'jsMath', |
'mimetex' => 'Convert to Images' |
'mimetex' => 'mimetex (Convert to Images)' |
); |
); |
my $selectionbox=&Apache::loncommon::select_form($texengine,'texengine', |
my $selectionbox=&Apache::loncommon::select_form($texengine,'texengine', |
%mathchoices); |
%mathchoices); |
my $jsMath_start=&Apache::lontexconvert::jsMath_header(); |
my $jsMath_start=&Apache::lontexconvert::jsMath_header(); |
my $change=&mt('Change'); |
my %lt=&Apache::lonlocal::texthash( |
$r->print(<<ENDLSCREEN); |
'headline' => 'Change Math Preferences', |
<br /> |
'preftxt' => 'Preferred method to display Math', |
|
'change' => 'Change', |
|
'exmpl' => 'Examples', |
|
'jsmath' => 'jsMath:', |
|
'tth' => 'tth (TeX to HTML):', |
|
'mimetex' => 'mimetex (Convert to Images):', |
|
); |
|
|
|
$r->print(<<ENDLSCREEN); |
|
<h2>$lt{'headline'}</h2> |
<form name="prefs" action="/adm/preferences" method="post"> |
<form name="prefs" action="/adm/preferences" method="post"> |
<input type="hidden" name="action" value="verify_and_change_texengine" /> |
<input type="hidden" name="action" value="verify_and_change_texengine" /> |
<p>$pref: $selectionbox</p> |
<p> |
<p><input type="submit" value="$change" /></p> |
$lt{'preftxt'}:<br /> |
</form> |
$selectionbox <input type="submit" value="$lt{'change'}" /> |
Examples: |
|
<p> TeX to HTML <br /> |
|
<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=tth" width="400" height="200"></iframe> |
|
</p> |
</p> |
<p>jsMath <br /> |
</form> |
|
<br /> |
|
<hr /> |
|
$lt{'exmpl'} |
|
|
|
<h3>$lt{'jsmath'}</h3> |
|
<p> |
$jsMath_start |
$jsMath_start |
<script type="text/javascript"> |
<script type="text/javascript"> |
if (jsMath.nofonts == 1) { |
if (jsMath.nofonts == 1) { |
document.writeln |
document.writeln |
('<center><div style="padding: 10; border-style: solid; border-width:3;' |
('<div style="padding: 10; border-style: solid; border-width:3;' |
+' border-color: #DD0000; background-color: #FFF8F8; width: 75%; text-align: left">' |
+' border-color: #DD0000; background-color: #FFF8F8; width: 75%; text-align: left">' |
+'<small><font color="#AA0000"><b>Warning:</b> ' |
+'<small><font color="#AA0000"><b>Warning:</b> ' |
+'It looks like you don\\\'t have the TeX math fonts installed. ' |
+'It looks like you don\\\'t have the TeX math fonts installed. ' |
Line 227 if (jsMath.nofonts == 1) {
|
Line 237 if (jsMath.nofonts == 1) {
|
+'needed fonts. In the meantime, jsMath will do the best it can ' |
+'needed fonts. In the meantime, jsMath will do the best it can ' |
+'with the fonts you have, but it may not be pretty and some equations ' |
+'with the fonts you have, but it may not be pretty and some equations ' |
+'may not be rendered correctly. ' |
+'may not be rendered correctly. ' |
+'</font></small></div></center>'); |
+'</font></small></div>'); |
} |
} |
</script> |
</script> |
<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=jsMath" width="400" height="120"></iframe> |
<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=jsMath" width="400" height="120"></iframe> |
|
|
</p> |
</p> |
<p> Convert to Images <br /> |
|
<br /> |
<h3>$lt{'mimetex'}</h3> |
|
<p> |
<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=mimetex" width="400" height="100"></iframe> |
<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=mimetex" width="400" height="100"></iframe> |
</p> |
</p> |
|
|
|
<h3>$lt{'tth'}</h3> |
|
<p> |
|
<iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=tth" width="400" height="200"></iframe> |
|
</p> |
ENDLSCREEN |
ENDLSCREEN |
if ($env{'environment.texengine'} ne 'jsMath') { |
if ($env{'environment.texengine'} ne 'jsMath') { |
$r->print('<script type="text/javascript">jsMath.Process()</script>'); |
$r->print('<script type="text/javascript">jsMath.Process()</script>'); |