--- loncom/xml/lontexconvert.pm 2007/06/19 20:10:55 1.83 +++ loncom/xml/lontexconvert.pm 2008/07/18 13:09:33 1.88 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # TeX Conversion Module # -# $Id: lontexconvert.pm,v 1.83 2007/06/19 20:10:55 albertel Exp $ +# $Id: lontexconvert.pm,v 1.88 2008/07/18 13:09:33 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -108,6 +108,14 @@ sub convert_real { $xmlstring=~s/^\s*\
jsMath.Process()'."\n"; } + sub jsMath_state { + my ($level) = @_; + return $jsMath_sent_header[$level]; + } } sub tex_engine { if (exists($env{'form.texengine'})) { - return $env{'form.texengine'}; + if ($env{'form.texengine'} ne '') { + return $env{'form.texengine'}; + } } if ($env{'request.course.id'} && exists($env{'course.'.$env{'request.course.id'}.'.texengine'})) { @@ -220,9 +234,11 @@ sub tex_engine { } sub init_math_support { + my ($inherit_jsmath) = @_; &init_tth(); &Apache::lontexconvert::jsMath_push(); - if (lc(&tex_engine()) eq 'jsmath') { + if (lc(&tex_engine()) eq 'jsmath' || + ($inherit_jsmath && &jsMath_state(-2))) { return &Apache::lontexconvert::jsMath_header(); } return;