--- loncom/interface/lonpreferences.pm 2005/02/25 05:54:01 1.54 +++ loncom/interface/lonpreferences.pm 2005/02/28 19:08:11 1.57 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.54 2005/02/25 05:54:01 albertel Exp $ +# $Id: lonpreferences.pm,v 1.57 2005/02/28 19:08:11 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -190,9 +190,9 @@ sub texenginechanger { my $pref=&mt('Preferred method to display Math'); my %mathchoices=('' => 'No Preference', 'tth' => 'TeX to HTML', - #'ttm' => 'TeX to MathML', + 'ttm' => 'TeX to MathML', 'jsMath' => 'jsMath', - #'mimetex' => 'Convert to Images' + 'mimetex' => 'Convert to Images' ); my $selectionbox=&Apache::loncommon::select_form($texengine,'texengine', %mathchoices); @@ -200,6 +200,8 @@ sub texenginechanger { my $jsMath_example=&Apache::lontexconvert::jsMath_converted(\$mathexample); $mathexample='$$\int\left(\frac{a+b}{c^6*d}\right)$$'; my $tth_example=&Apache::lontexconvert::tth_converted(\$mathexample); + $mathexample='$$\int\left(\frac{a+b}{c^6*d}\right)$$'; + my $mimetex_example=&Apache::lontexconvert::mimetex_converted(\$mathexample); my $change=&mt('Change'); $r->print(< @@ -209,11 +211,11 @@ sub texenginechanger { Examples:

TeX to HTML
$tth_example

- +

jsMath
- $jsMath_example

- +

Convert to Images
$mimetex_example

ENDLSCREEN + if ($ENV{'environment.texengine'} ne 'jsMath') { + $r->print(''); + } } @@ -243,6 +248,13 @@ sub verify_and_change_texengine { # Screenname my $newtexengine = $ENV{'form.texengine'}; $newtexengine=~s/[^\-\w]//g; + if ($newtexengine eq 'ttm') { + &Apache::lonnet::appenv('browser.mathml' => 1); + } else { + if ($ENV{'environment.texengine'} eq 'ttm') { + &Apache::lonnet::appenv('browser.mathml' => 0); + } + } my $message=''; if ($newtexengine) { &Apache::lonnet::put('environment',{'texengine' => $newtexengine}); @@ -253,6 +265,8 @@ sub verify_and_change_texengine { &Apache::lonnet::delenv('environment\.texengine'); $message='Reset preferred math display.'; } + + $r->print(< $message