--- loncom/homework/randomlabel.pm 2005/04/12 09:35:22 1.68 +++ loncom/homework/randomlabel.pm 2005/04/12 09:56:07 1.69 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # random labelling tool # -# $Id: randomlabel.pm,v 1.68 2005/04/12 09:35:22 foxr Exp $ +# $Id: randomlabel.pm,v 1.69 2005/04/12 09:56:07 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -405,6 +405,11 @@ sub end_label { if ($type eq 'image') { &Apache::lonxml::debug("Turning $ltext, $Apache::lonxml::pwd[-1]"); $ltext=&Apache::imageresponse::clean_up_image($ltext); + # In .tex output mode, at least _ has to be replaced with + # \_ + if ($target eq 'tex') { + $ltext =~ s/\_/\\\_/g; + } # $ltext=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1], # $ltext); &Apache::lonxml::debug("into $ltext");