[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm
foxr
lon-capa-cvs@mail.lon-capa.org
Wed, 11 Jan 2006 11:58:09 -0000
foxr Wed Jan 11 06:58:09 2006 EDT
Modified files:
/loncom/xml londefdef.pm
Log:
Get a bit more specific about when wrapfig is allowed:
- If the user requests an image alignment that would normally turn on wrapfig
inside a table, wrapfig is disallowed since that makes the image size computation
fail and the figure disappear as it becomes width 0mm. In this case, wrapfig
is mapped to parpic
- If the user requests an image alignment that would turn on wrapfig outside
a table, that's ok and allowed to make text wrapping better.`
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.311 loncom/xml/londefdef.pm:1.312
--- loncom/xml/londefdef.pm:1.311 Mon Jan 9 17:53:25 2006
+++ loncom/xml/londefdef.pm Wed Jan 11 06:58:06 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Tags Default Definition Module
#
-# $Id: londefdef.pm,v 1.311 2006/01/09 22:53:25 albertel Exp $
+# $Id: londefdef.pm,v 1.312 2006/01/11 11:58:06 foxr Exp $
#
#
# Copyright Michigan State University Board of Trustees
@@ -2765,12 +2765,7 @@
$safeeval,
undef,1));
if(!$align) {
- # disabled for now see BUG#4535
- if (0 && &is_inside_of($tagstack, "table")) {
- $align = "right"; # Force wraptext use.
- } else {
$align = "bottom"; # This is html's default so it's ours too.
- }
}
#
&Apache::lonxml::debug("Alignemnt = $align");
@@ -2785,11 +2780,17 @@
$parstack,
$safeeval,
undef,0);
- &Apache::lonxml::debug("LaTeX rendering = $latex_rendering");
+ # &Apache::lonxml::debug("LaTeX rendering = $latex_rendering");
if(!$latex_rendering) {
- $latex_rendering = "texwrap";
+ $latex_rendering = "texwrap";
+ }
+ # using texwrap inside a table does not work. So, if after all of this,
+ # texwrap is on, we turn it off if we detect we're in a table:
+ #
+ if (($latex_rendering eq 'texwrap') && &is_inside_of($tagstack, "table")) {
+ $latex_rendering = 'parpic';
}
- &Apache::lonxml::debug("LaTeX rendering = $latex_rendering image file: $src");
+ # &Apache::lonxml::debug("LaTeX rendering = $latex_rendering image file: $src");
#if original gif/jpg/png file exist do following:
my $origsrc=$src;