[LON-CAPA-cvs] cvs: loncom /homework randomlabel.pm

foxr lon-capa-cvs@mail.lon-capa.org
Tue, 12 Apr 2005 09:56:07 -0000


foxr		Tue Apr 12 05:56:07 2005 EDT

  Modified files:              
    /loncom/homework	randomlabel.pm 
  Log:
  Clean up the output of clean_up_image to prevent latex failure..
  now we have a label that has a url.. of the broken logo...
  
  
Index: loncom/homework/randomlabel.pm
diff -u loncom/homework/randomlabel.pm:1.68 loncom/homework/randomlabel.pm:1.69
--- loncom/homework/randomlabel.pm:1.68	Tue Apr 12 05:35:22 2005
+++ loncom/homework/randomlabel.pm	Tue Apr 12 05:56:07 2005
@@ -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 @@
 	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");