[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm

foxr lon-capa-cvs@mail.lon-capa.org
Mon, 19 Sep 2005 10:59:09 -0000


foxr		Mon Sep 19 06:59:09 2005 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  Try using wrapfigure env. to get better text wrapping on figures.
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.285 loncom/xml/londefdef.pm:1.286
--- loncom/xml/londefdef.pm:1.285	Thu Aug 11 18:04:09 2005
+++ loncom/xml/londefdef.pm	Mon Sep 19 06:59:08 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.285 2005/08/11 22:04:09 foxr 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 @@
                           '\usepackage{textcomp}'.
                           '\usepackage{makeidx}'.
                           '\usepackage[dvips]{graphicx}'.
+			  '\usepackage{wrapfig}'.
 			  '\usepackage{picins}'.
                           '\usepackage{epsfig}'.
                           '\usepackage{calc}'.
@@ -2617,16 +2618,17 @@
 	    } 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.'}';