--- loncom/xml/londefdef.pm 2005/03/15 11:20:49 1.262 +++ loncom/xml/londefdef.pm 2005/03/16 21:35:17 1.264 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.262 2005/03/15 11:20:49 foxr Exp $ +# $Id: londefdef.pm,v 1.264 2005/03/16 21:35:17 raeburn Exp $ # # # Copyright Michigan State University Board of Trustees @@ -2506,9 +2506,11 @@ sub start_img { my ($height_param,$width_param)= &image_size($src,0.3,$parstack,$safeeval); my $destpath = $path; - $destpath =~ s/ /\_/; # Spaces in path cause LaTex to vomit. + $destpath =~ s/ /\_/g; # Spaces in path cause LaTex to vomit. + my $destfile = $file; + $destfile =~ s/ /\_/g; $currentstring .= '\graphicspath{{'.$destpath.'}}' - .'\includegraphics[width='.$width_param.' mm,height='.$height_param.'mm]{'.$file.'} '; + .'\includegraphics[width='.$width_param.' mm,height='.$height_param.'mm]{'.$destfile.'} '; # If there's an alignment specification we need to honor it here. # For the horizontal alignments, we will also honor the @@ -3755,7 +3757,7 @@ sub image_replication { $pssrc =~ s/\.(gif|jpg|jpeg|png)$/.ps/i; if (not -e $epssrc && not -e $pssrc) { my $result=&Apache::lonnet::repcopy($epssrc); - if ($result ne 'OK') { &Apache::lonnet::repcopy($pssrc); } + if ($result ne 'ok') { &Apache::lonnet::repcopy($pssrc); } } return ''; } @@ -3832,14 +3834,14 @@ sub get_eps_image { &Apache::lonxml::debug("Filelocation gives; $src
"); if (! -e $src) { &Apache::lonxml::debug("$src does not exist"); - if (&Apache::lonnet::repcopy($src) ne 'OK' ) { + if (&Apache::lonnet::repcopy($src) ne 'ok' ) { &Apache::lonxml::debug("Repcopy of $src failed (1)"); #if replication failed try to find ps file $src=~s/\.eps$/\.ps/; &Apache::lonxml::debug("Now looking for $src"); #if no ps file try to replicate it if (not -e $src && - &Apache::lonnet::repcopy($src) ne 'OK') { + &Apache::lonnet::repcopy($src) ne 'ok') { &Apache::lonxml::debug("Failed to find or replicate $src"); #if replication failed try to produce eps file dynamically