--- loncom/xml/londefdef.pm 2005/02/10 23:00:09 1.256 +++ loncom/xml/londefdef.pm 2005/02/18 23:22:43 1.257 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.256 2005/02/10 23:00:09 albertel Exp $ +# $Id: londefdef.pm,v 1.257 2005/02/18 23:22:43 albertel Exp $ # # # Copyright Michigan State University Board of Trustees @@ -106,6 +106,13 @@ sub start_m { $currentstring=&Apache::run::evaluate($currentstring,$safeeval,$$parstack[-1]); } if ($currentstring=~/^(\s*\\\\\s*)*$/) {$currentstring = ' \vskip 0 mm ';} + # detect simple math mode entry exits, and convert them + # to use \ensuremath + if ($currentstring=~/^\s*\$[^\$].*[^\$]\$\s*$/) { + $currentstring=~s/^\$//; + $currentstring=~s/\$$//; + $currentstring='\ensuremath{'.$currentstring.'}'; + } $Apache::lonxml::post_evaluate=0; } return $currentstring;