--- loncom/xml/londefdef.pm 2005/02/09 19:51:43 1.255 +++ loncom/xml/londefdef.pm 2005/04/06 06:08:13 1.255.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.255 2005/02/09 19:51:43 albertel Exp $ +# $Id: londefdef.pm,v 1.255.2.1 2005/04/06 06:08:13 matthew Exp $ # # # Copyright Michigan State University Board of Trustees @@ -2508,8 +2508,13 @@ sub start_img { if (-e $newsrc) { #eps counterpart for image exist if ($path) { + my $size; + if ($width_param) { $size.='width='.$width_param.' mm,'; } + if ($height_param) { $size.='height='.$height_param.' mm]'; } + $size='['.$size; + $size=~s/,$/]/; $currentstring .= '\graphicspath{{'.$path.'}}' - .'\includegraphics[width='.$width_param.' mm,height='.$height_param.'mm]{'.$file.'} '; + .'\includegraphics'.$size.'{'.$file.'} '; } } else { #there is no eps counterpart for image - check for ps one @@ -3800,19 +3805,29 @@ sub image_size { } else { $width_param = $TeXwidth; } - $height_param=$TeXwidth/$old_width_param*$height_param; + if ($TeXheight) { + $height_param = $TeXheight; + } elsif ($old_width_param) { + $height_param=$TeXwidth/$old_width_param*$height_param; + } } elsif ($TeXheight ne '') { $height_param = $TeXheight; - $width_param = $TeXheight/$height_param*$width_param; + if ($height_param) { + $width_param = $TeXheight/$height_param*$width_param; + } } elsif ($width ne '') { my $old_width_param=$width_param; $width_param = $width*$scaling; - $height_param=$width_param/$old_width_param*$height_param; + if ($old_width_param) { + $height_param=$width_param/$old_width_param*$height_param; + } } if ($width_param > $ENV{'form.textwidth'}) { my $old_width_param=$width_param; $width_param =0.95*$ENV{'form.textwidth'}; - $height_param=$width_param/$old_width_param*$height_param; + if ($old_width_param) { + $height_param=$width_param/$old_width_param*$height_param; + } } return ($height_param, $width_param); }