--- loncom/interface/lonpreferences.pm 2005/02/25 05:54:01 1.54 +++ loncom/interface/lonpreferences.pm 2005/02/26 05:37:23 1.56 @@ -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.56 2005/02/26 05:37:23 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -190,7 +190,7 @@ 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' ); @@ -231,8 +231,10 @@ if (jsMath.nofonts == 1) { $jsMath_example

- ENDLSCREEN + if ($ENV{'environment.texengine'} ne 'jsMath') { + $r->print(''); + } } @@ -243,6 +245,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 +262,8 @@ sub verify_and_change_texengine { &Apache::lonnet::delenv('environment\.texengine'); $message='Reset preferred math display.'; } + + $r->print(< $message