Diff for /loncom/xml/londefdef.pm between versions 1.199 and 1.203

version 1.199, 2004/02/19 19:57:48 version 1.203, 2004/03/15 19:19:04
Line 535  sub start_body { Line 535  sub start_body {
  if ($ENV{'request.state'} ne 'published') {   if ($ENV{'request.state'} ne 'published') {
     $currentstring.=(<<EDITBUTTON);      $currentstring.=(<<EDITBUTTON);
  <form method="post">   <form method="post">
  <input type="submit" name="editmode" value="Edit" />   <input type="submit" name="editmode" accesskey="e" value="Edit" />
  </form>   </form>
 EDITBUTTON  EDITBUTTON
  } else {   } else {
     $currentstring.=&Apache::lonmenu::menubuttons(undef,$target,1);      $currentstring.=&Apache::lonmenu::menubuttons(undef,$target,1);
  }   }
    $currentstring.=&Apache::lonxml::message_location();
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = '\begin{document}';     $currentstring = '\begin{document}';  
     }       } 
Line 1337  sub start_sub { Line 1338  sub start_sub {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring .= $token->[4];   $currentstring .= $token->[4];
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring .= "\$_{";   $currentstring .= '\ensuremath{_{';
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 1348  sub end_sub { Line 1349  sub end_sub {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring .= $token->[2];   $currentstring .= $token->[2];
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring .= "}\$";   $currentstring .= '}}';
     }      }
     return $currentstring;      return $currentstring;
 }  }
Line 1360  sub start_sup { Line 1361  sub start_sup {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring .= $token->[4];   $currentstring .= $token->[4];
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring .= "\$^{";   $currentstring .= '\ensuremath{^{';
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 1371  sub end_sup { Line 1372  sub end_sup {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring .= $token->[2];   $currentstring .= $token->[2];
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring .= "}\$";   $currentstring .= '}}';
     }      }
     return $currentstring;      return $currentstring;
 }  }
Line 1794  sub start_table { Line 1795  sub start_table {
  if (not defined $TeXwidth) {   if (not defined $TeXwidth) {
     my $htmlwidth = &Apache::lonxml::get_param('width',$parstack,$safeeval,undef,1);      my $htmlwidth = &Apache::lonxml::get_param('width',$parstack,$safeeval,undef,1);
     if ($htmlwidth=~/%/) {      if ($htmlwidth=~/%/) {
                   $Apache::londefdef::table[-1]{'percent'}=1;
  $htmlwidth=~/(\d+)/;   $htmlwidth=~/(\d+)/;
  my $value=$1*$textwidth/100;   $Apache::londefdef::table[-1]{'width'}=$1*$textwidth/100;;
  $Apache::londefdef::table[-1]{'width'}=$value;  
     } else {      } else {
  $Apache::londefdef::table[-1]{'width'}=$textwidth;   $Apache::londefdef::table[-1]{'width'}=$textwidth;
     }      }
  } elsif ($TeXwidth=~/%/) {   } elsif ($TeXwidth=~/%/) {
       $Apache::londefdef::table[-1]{'percent'}=1;
     $TeXwidth=~/(\d+)/;      $TeXwidth=~/(\d+)/;
     my $value=$1*$textwidth/100;      my $value=$1*$textwidth/100;
             $Apache::londefdef::table[-1]{'width'}=$value;              $Apache::londefdef::table[-1]{'width'}=$value;
Line 1880  sub end_table { Line 1882  sub end_table {
  $length_row_final[$jn]=0.9*$available_length/$needed;   $length_row_final[$jn]=0.9*$available_length/$needed;
     }      }
  }   }
           #recalculation for the use of all available width if width is defined in %
           if ($Apache::londefdef::table[-1]{'percent'}==1) {
       my $current=0; 
       for (my $i=0;$i<=$#length_row_final;$i++) {  
    $current+=$length_row_final[$i];
       }
       my $coef=$Apache::londefdef::table[-1]{'width'}/$current;
       for (my $i=0;$i<=$#length_row_final;$i++) {  
    $length_row_final[$i]*=$coef;
       }
    }
  #fill the table   #fill the table
  for (my $in=0;$in<=$Apache::londefdef::table[-1]{'row_number'};$in++) {   for (my $in=0;$in<=$Apache::londefdef::table[-1]{'row_number'};$in++) {
     for (my $jn=0;$jn<=$#length_row_final;$jn++) {      for (my $jn=0;$jn<=$#length_row_final;$jn++) {

Removed from v.1.199  
changed lines
  Added in v.1.203


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