--- loncom/xml/londefdef.pm 2004/08/25 19:57:27 1.238 +++ loncom/xml/londefdef.pm 2004/08/30 18:25:55 1.239 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.238 2004/08/25 19:57:27 albertel Exp $ +# $Id: londefdef.pm,v 1.239 2004/08/30 18:25:55 sakharuk Exp $ # # # Copyright Michigan State University Board of Trustees @@ -2434,6 +2434,8 @@ sub start_img { $currentstring.='[IMAGE: '.$alttag.']'; } } elsif ($target eq 'tex') { + my $oldSRC=$src; + $oldSRC=~s/\.(gif|jpg|png)$/\.eps/; $src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src); #if original gif/jpg/png file exist do following: if (-e $src) { @@ -2442,6 +2444,7 @@ sub start_img { my ($file,$path)=&file_path($src); my $newsrc = $src; $newsrc =~ s/\.(gif|jpg|png)$/.eps/i; + my $dummy_content=&Apache::lonnet::getfile($oldSRC); $file=~s/\.(gif|jpg|png)$/.eps/i; #where can we find the picture? if (-e $newsrc) { @@ -3710,7 +3713,11 @@ sub eps_generation { $newsrc=~s/\/home\/httpd\/lonUsers//; $newsrc=~s/\/([^\/]+)\/(\w)\/(\w)\/(\w)\//\/$1\//; } - return ' \graphicspath{{/home/httpd/prtspool'.$newsrc.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; + if ($newsrc=~/\/userfiles\//) { + return ' \graphicspath{{'.$newsrc.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; + } else { + return ' \graphicspath{{/home/httpd/prtspool'.$newsrc.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; + } } sub file_path {