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

foxr lon-capa-cvs@mail.lon-capa.org
Fri, 27 Jan 2006 22:30:25 -0000


foxr		Fri Jan 27 17:30:25 2006 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  defect 4540 - scale back width of tables if they won't fit on the printed page
  for target tex.
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.315 loncom/xml/londefdef.pm:1.316
--- loncom/xml/londefdef.pm:1.315	Wed Jan 25 06:30:14 2006
+++ loncom/xml/londefdef.pm	Fri Jan 27 17:30:23 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.315 2006/01/25 11:30:14 foxr Exp $
+# $Id: londefdef.pm,v 1.316 2006/01/27 22:30:23 foxr Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -1980,7 +1980,12 @@
             $Apache::londefdef::table[-1]{'width'}=$1*$textwidth/100;
 	} else {
 	    $Apache::londefdef::table[-1]{'width'}=$TeXwidth;
-	}        
+	}
+        #  In the end, however the table width cannot be wider than $textwidth...
+	
+	if ($Apache::londefdef::table[-1]{'width'} > $textwidth) {
+	    $Apache::londefdef::table[-1]{'width'} = $textwidth;
+	}
 
         #table's border
 	my $border = &Apache::lonxml::get_param('border',$parstack,$safeeval);