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

foxr lon-capa-cvs@mail.lon-capa.org
Tue, 05 Sep 2006 21:57:57 -0000


foxr		Tue Sep  5 17:57:57 2006 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  Make \multicolumn produce a {|p{n}|} where n is the sum of the computed
  widths of the columns it spans.  Then, since now we have a paragraph mode
  in the cell, re-enable the <br /> tag which had been causing infinite loops
  within LaTeX/TeX.
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.335 loncom/xml/londefdef.pm:1.336
--- loncom/xml/londefdef.pm:1.335	Sat Sep  2 14:49:37 2006
+++ loncom/xml/londefdef.pm	Tue Sep  5 17:57:57 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.335 2006/09/02 18:49:37 albertel Exp $
+# $Id: londefdef.pm,v 1.336 2006/09/05 21:57:57 foxr Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -1214,20 +1214,11 @@
 		$signal=1;
 	    }
 	    if (($tempo[$i] eq 'td') || ($tempo[$i] eq 'th')) {
-		my $colspan = 
-		    &Apache::lonxml::get_param('colspan', $parstack,
-					       $safeeval, $i, 0);
-		if ($colspan) {
-		    $signal = 2;
-		} else {
-		    $signal = 1;
-		}
+		$signal = 1;
 	    }
 	}
 	if ($signal eq 1) {
 	    $currentstring .= ' \vskip 0 mm ';
-	} elsif ($signal eq '2') {
-	    # multicol doesn't like blank lines
 	} elsif ($$tagstack[-2] ne 'sub' && $$tagstack[-2] ne 'sup') {
 	    $currentstring .= '\strut \\\\ \strut ';
 	}
@@ -2209,9 +2200,13 @@
 		# 
 
 		if ($colspan > 1) {
+		    my $spanwidth = 0;
+		    for (my $spancol = $jn; $spancol < $jn + $colspan; $spancol++) {
+			$spanwidth += $fwidth[$spancol];
+		    }
 		    $output .= '\multicolumn{'.
 			$colspan
-			.'}{|l|}{';
+			."}{|p{$spanwidth mm}|}{";
 		}
 
 		if ($rowspan > 1) {