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

foxr lon-capa-cvs@mail.lon-capa.org
Fri, 09 Mar 2007 00:08:04 -0000


foxr		Thu Mar  8 19:08:04 2007 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  I don't think this is any worse than before.. But still does not
  fix the <br /> vs. <tr align="..."> issues.  It tries, when it
  won't break things to put a width on the \multirow.
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.355 loncom/xml/londefdef.pm:1.356
--- loncom/xml/londefdef.pm:1.355	Tue Feb 27 18:44:53 2007
+++ loncom/xml/londefdef.pm	Thu Mar  8 19:08:02 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.355 2007/02/27 23:44:53 foxr Exp $
+# $Id: londefdef.pm,v 1.356 2007/03/09 00:08:02 foxr Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -2201,17 +2201,18 @@
 		#   single rowspan, columspan and combined row/colspans will
                 #   work correctly.  LaTeX is delicate here.
 		#    RF.
-
+		
 		# Start a rowspan if necessary:
-
+		
+		my $primary_col_width = $fwidth[$jn]; # Width of primary column.
 		my $rowspan = $Apache::londefdef::table[-1]{'rowspan'}[$in][$jn];
 		my $colspan = $Apache::londefdef::table[-1]{'colspan'}[$in][$jn];
 		#
 		#  Do the appropriate magic if this has a colspan
 		# 
-
+		
+		my $spanwidth = 0;
 		if ($colspan > 1) {
-		    my $spanwidth = 0;
 		    for (my $spancol = $jn; $spancol < $jn + $colspan; $spancol++) {
 			$spanwidth += $fwidth[$spancol];
 		    }
@@ -2226,7 +2227,9 @@
 		    else {
 			$output .= "{|p{$spanwidth mm}|}{";
 		    }
-			
+		    
+		} else {
+		    $spanwidth = $primary_col_width; # If no span width will be just colwidth
 		}
 
 		# Rowspan... if colspan is 1, and there's an alignment we'll need
@@ -2246,13 +2249,17 @@
 			}
 		    }
 		    $have_rowspan++;
-		    $output .= '\multirow{'.$rowspan.'}[0]{*}{';
+		    if ($multirow_aligned) {
+			$output .= '\multirow{'.$rowspan.'}[0]{*}{';
+		    } else {
+			$output .= '\multirow{'.$rowspan."}[0]{$spanwidth mm}{";
+		    }
 		    
 		    $Apache::londefdef::table[-1]{'content'}[$in][$jn] =~
 			s{^\s*\\par\s*}{};
 		    $Apache::londefdef::table[-1]{'content'}[$in][$jn] =~
 			s{\s*\\vskip\s*0pt\s*$}{};
-
+			  
 		    #
 		    # If we did not throw in a multicolumn to align, then add 
 		    # an extra {
@@ -2266,7 +2273,7 @@
 		if (($rowspan eq '^') || ($rowspan eq '_')) {
 		    $have_rowspan++;
 		}
-		#--------------------------------------------------------------
+		    #--------------------------------------------------------------
 
 
 		# For right and center alignment of single cells.