--- loncom/xml/londefdef.pm 2002/09/16 19:06:57 1.89 +++ loncom/xml/londefdef.pm 2002/10/07 17:57:37 1.90 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.89 2002/09/16 19:06:57 sakharuk Exp $ +# $Id: londefdef.pm,v 1.90 2002/10/07 17:57:37 sakharuk Exp $ # # # Copyright Michigan State University Board of Trustees @@ -1549,7 +1549,7 @@ EDITBUTTON my $currentstring = ''; my $width_param = ''; my $height_param = ''; - my $scaling = .3; + my $scaling = .3; if ($target eq 'web') { $currentstring = $token->[4]; @@ -1568,10 +1568,14 @@ EDITBUTTON my $TeXwidth = &Apache::lonxml::get_param('TeXwidth',$parstack,$safeeval); my $TeXheight = &Apache::lonxml::get_param('TeXheight',$parstack,$safeeval); my $width = &Apache::lonxml::get_param('width',$parstack,$safeeval); - if ($TeXwidth ne '') { - $width_param = $TeXwidth; - } elsif ($TeXheight ne '') { - $width_param = $TeXheight/$height_param*$width_param; + if ($TeXwidth ne '') { + if ($TeXwidth=~/(\d+)\s*\%/) { + $width_param = $1*$ENV{'form.textwidth'}/100; + } else { + $width_param = $TeXwidth; + } + } elsif ($TeXheight ne '') { + $width_param = $TeXheight/$height_param*$width_param; } elsif ($width ne '') { $width_param = $width*$scaling; }