Diff for /loncom/xml/londefdef.pm between versions 1.355 and 1.356

version 1.355, 2007/02/27 23:44:53 version 1.356, 2007/03/09 00:08:02
Line 2201  sub end_table { Line 2201  sub end_table {
  #   single rowspan, columspan and combined row/colspans will   #   single rowspan, columspan and combined row/colspans will
                 #   work correctly.  LaTeX is delicate here.                  #   work correctly.  LaTeX is delicate here.
  #    RF.   #    RF.
   
  # Start a rowspan if necessary:   # 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 $rowspan = $Apache::londefdef::table[-1]{'rowspan'}[$in][$jn];
  my $colspan = $Apache::londefdef::table[-1]{'colspan'}[$in][$jn];   my $colspan = $Apache::londefdef::table[-1]{'colspan'}[$in][$jn];
  #   #
  #  Do the appropriate magic if this has a colspan   #  Do the appropriate magic if this has a colspan
  #    # 
   
    my $spanwidth = 0;
  if ($colspan > 1) {   if ($colspan > 1) {
     my $spanwidth = 0;  
     for (my $spancol = $jn; $spancol < $jn + $colspan; $spancol++) {      for (my $spancol = $jn; $spancol < $jn + $colspan; $spancol++) {
  $spanwidth += $fwidth[$spancol];   $spanwidth += $fwidth[$spancol];
     }      }
Line 2226  sub end_table { Line 2227  sub end_table {
     else {      else {
  $output .= "{|p{$spanwidth mm}|}{";   $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   # Rowspan... if colspan is 1, and there's an alignment we'll need
Line 2246  sub end_table { Line 2249  sub end_table {
  }   }
     }      }
     $have_rowspan++;      $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] =~      $Apache::londefdef::table[-1]{'content'}[$in][$jn] =~
  s{^\s*\\par\s*}{};   s{^\s*\\par\s*}{};
     $Apache::londefdef::table[-1]{'content'}[$in][$jn] =~      $Apache::londefdef::table[-1]{'content'}[$in][$jn] =~
  s{\s*\\vskip\s*0pt\s*$}{};   s{\s*\\vskip\s*0pt\s*$}{};
     
     #      #
     # If we did not throw in a multicolumn to align, then add       # If we did not throw in a multicolumn to align, then add 
     # an extra {      # an extra {
Line 2266  sub end_table { Line 2273  sub end_table {
  if (($rowspan eq '^') || ($rowspan eq '_')) {   if (($rowspan eq '^') || ($rowspan eq '_')) {
     $have_rowspan++;      $have_rowspan++;
  }   }
  #--------------------------------------------------------------      #--------------------------------------------------------------
   
   
  # For right and center alignment of single cells.   # For right and center alignment of single cells.

Removed from v.1.355  
changed lines
  Added in v.1.356


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>