--- loncom/xml/londefdef.pm 2005/08/07 16:53:07 1.284 +++ loncom/xml/londefdef.pm 2005/09/19 10:59:08 1.286 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.284 2005/08/07 16:53:07 albertel Exp $ +# $Id: londefdef.pm,v 1.286 2005/09/19 10:59:08 foxr Exp $ # # # Copyright Michigan State University Board of Trustees @@ -166,6 +166,7 @@ sub start_html { '\usepackage{textcomp}'. '\usepackage{makeidx}'. '\usepackage[dvips]{graphicx}'. + '\usepackage{wrapfig}'. '\usepackage{picins}'. '\usepackage{epsfig}'. '\usepackage{calc}'. @@ -2617,16 +2618,17 @@ sub start_img { } elsif ($align eq "left") { if ($latex_rendering eq "parpic") { $currentstring = '\parpic[l]{'.$currentstring.'}'; - } else { # parbox rendering - $currentstring = "\\strut\\newline\n". - '\parbox{'.$width_param.'mm}{'.$currentstring.'}'; + } else { # wrapfig render + $currentstring = '\begin{wrapfigure}{l}{'.$width_param.'mm}' + .'\scalebox{1.0}{'.$currentstring.'}\end{wrapfigure}'; } } elsif ($align eq "right") { if ($latex_rendering eq "parpic") { $currentstring = '\parpic[r]{'.$currentstring.'}'; - } else { # parbox rendering. - $currentstring = '\parbox{'.$width_param.'mm}{\begin{flushright}' - .$currentstring.'\end{flushright}} \newline'."\n"; + } else { # wrapfig rendering + $currentstring = '\begin{wrapfigure}{r}{'.$width_param.'mm}' + .'\scalebox{1.0}{'.$currentstring.'}\end{wrapfigure}'; + } } else { # Bottom is also default. # $currentstring = '\raisebox{'.$height_param.'mm}{'.$currentstring.'}'; @@ -3965,6 +3967,13 @@ sub image_height { sub get_eps_image { my ($src)=@_; my $orig_src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1], $src); + + # In order to prevent the substitution of the alt text, we need to + # be sure the orig_src file is on system now so: + + if (! -e $orig_src) { + &Apache::lonnet::repcopy($orig_src); # Failure is not completely fatal. + } &Apache::lonxml::debug("get_eps_image: Original image: $orig_src"); my ($spath, $sname, $sext) = fileparse($src, qr/\.(gif|png|jpg|jpeg)/i); $src=~s/\.(gif|png|jpg|jpeg)$/\.eps/i;