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

sakharuk lon-capa-cvs@mail.lon-capa.org
Wed, 14 Jul 2004 13:49:10 -0000


sakharuk		Wed Jul 14 09:49:10 2004 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  Bug 3209 (<table> align parameter) is fixed.
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.227 loncom/xml/londefdef.pm:1.228
--- loncom/xml/londefdef.pm:1.227	Mon Jul 12 13:57:36 2004
+++ loncom/xml/londefdef.pm	Wed Jul 14 09:49:09 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.227 2004/07/12 17:57:36 sakharuk Exp $
+# $Id: londefdef.pm,v 1.228 2004/07/14 13:49:09 sakharuk Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -1803,7 +1803,7 @@
 		$textwidth=$Apache::londefdef::table[-2]{'TeXlen'}[$Apache::londefdef::table[-2]{'row_number'}][$Apache::londefdef::table[-2]{'counter_columns'}]; 
 	    } else {
               #try to use all space not used before (minus 5% for LaTeX table internal) - rather silly
-		my $textwidth=$Apache::londefdef::table[-2]{'width'};
+		$textwidth=$Apache::londefdef::table[-2]{'width'};
 		for (my $i=0;$i<$Apache::londefdef::table[-2]{'counter_columns'};$i++) {
 		    $textwidth=$textwidth-$Apache::londefdef::table[-2]{'TeXlen'}[0][$i];
 		}
@@ -1874,7 +1874,7 @@
 	}
         #free space and number of empty columns
 	my ($available_space,$empty_columns)=($Apache::londefdef::table[-1]{'width'},0);
-##	&Apache::lonnet::logthis("Available space $Apache::londefdef::table[-1]{'width'}");
+	if ($#Apache::londefdef::table ne 0) {$available_space=0.9*$available_space;} 
 	for (my $jn=0;$jn<=$Apache::londefdef::table[-1]{'counter_columns'};$jn++) {
 	    if ($Apache::londefdef::table[-1]{'TeXlen'}[0][$jn]==0) {
 		$empty_columns++;
@@ -2013,13 +2013,13 @@
 	for (my $in=0;$in<=$Apache::londefdef::table[-1]{'row_number'};$in++) {
 	    for (my $jn=0;$jn<=$#fwidth;$jn++) {
 		if ($Apache::londefdef::table[-1]{'align'}[$in][$jn] eq 'c') {
-		    $output.='\begin{center}';
+		    $output.='\vspace*{-6 mm}\begin{center}';
 		} elsif ($Apache::londefdef::table[-1]{'align'}[$in][$jn] eq 'r') {
 		    $output.=' \hfill \llap{'
 		}
 		$output.=$Apache::londefdef::table[-1]{'content'}[$in][$jn];
 		if ($Apache::londefdef::table[-1]{'align'}[$in][$jn] eq 'c') {
-		    $output.='\end{center}';
+		    $output.='\end{center}\vspace*{-6 mm}';
 		} elsif ($Apache::londefdef::table[-1]{'align'}[$in][$jn] eq 'r') {
 		    $output.='} ';
 		}
@@ -2177,7 +2177,7 @@
 		$current_length=2.5*&LATEX_length($data);
                     my @words=split(/ /,$data);
 		    foreach my $word (@words) {
-			my $lengthword=2.5*&LATEX_length($word);
+			my $lengthword=2*&LATEX_length($word);
 			if ($min_length<$lengthword) {$min_length=$lengthword;}
 		    }
 	    }