Diff for /loncom/xml/londefdef.pm between versions 1.51 and 1.52

version 1.51, 2002/04/05 18:11:11 version 1.52, 2002/04/08 15:17:01
Line 1264  EDITBUTTON Line 1264  EDITBUTTON
             if ($target eq 'web') {              if ($target eq 'web') {
               $currentstring = $token->[4];                     $currentstring = $token->[4];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  &Apache::lonxml::startredirection;  
  my $border = &Apache::lonxml::get_param('border',$parstack,$safeeval);   my $border = &Apache::lonxml::get_param('border',$parstack,$safeeval);
  unless (defined $border) { $border = 0; }   unless (defined $border) { $border = 0; }
  @Apache::londefdef::rows = ();  
  @Apache::londefdef::columns = ();  
  $Apache::londefdef::counter_columns = 0;  
  $Apache::londefdef::hinc = '';  
                 $Apache::londefdef::vinc = '';     
  $Apache::londefdef::vvinc = '';  
  if ($border) {    if ($border) { 
     $Apache::londefdef::hinc = '\hline ';       $Apache::londefdef::table{'hinc'} = '\hline '; 
     $Apache::londefdef::vinc =  '&';       $Apache::londefdef::table{'vinc'} = '&'; 
     $Apache::londefdef::vvinc =  '|';      $Apache::londefdef::table{'vvinc'} = '|';
    } else {
       $Apache::londefdef::table{'hinc'} = ''; 
       $Apache::londefdef::table{'vinc'} = ''; 
       $Apache::londefdef::table{'vvinc'} = '';
  }   }
     }       } 
    return $currentstring;     return $currentstring;
Line 1287  EDITBUTTON Line 1284  EDITBUTTON
             if ($target eq 'web') {              if ($target eq 'web') {
               $currentstring = $token->[2];                     $currentstring = $token->[2];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  my $output=&Apache::lonxml::endredirection;   my $output = '';
  $output =~ s/<\/td>\s*<td\s*([^>]*)>/$Apache::londefdef::vinc/g;   my $header_of_table = '{'.$Apache::londefdef::table{'vvinc'};
  $output =~ s/<td\s*([^>]*)>//g;  
  $output =~ s/<\/td>//g;  
  my $header_of_table = '{'.$Apache::londefdef::vvinc;  
  my $in;   my $in;
  for ($in=0;$in<$Apache::londefdef::counter_columns;$in++) {   for ($in=0;$in<$Apache::londefdef::table{'counter_columns'};$in++) {
     $header_of_table .= $Apache::londefdef::columns[$in].$Apache::londefdef::vvinc;      $header_of_table .= @{ $Apache::londefdef::table{'columns'} }[$in].$Apache::londefdef::table{'vvinc'};
       $output .=  $Apache::londefdef::table{'rowdata'}[$in];
       chop $output;
       $output .= ' \\\\ ';
  }   }
  $header_of_table .= '}';   $header_of_table .= '}';
  $currentstring .= '\begin{tabular}'.$header_of_table.$output.$Apache::londefdef::hinc.'\end{tabular}';   $currentstring .= '\begin{tabular}'.$header_of_table.$output.$Apache::londefdef::table{'hinc'}.'\end{tabular}';
     }      }
    return $currentstring;     return $currentstring;
  }   }
Line 1309  EDITBUTTON Line 1306  EDITBUTTON
               $currentstring = $token->[4];                     $currentstring = $token->[4];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  if (substr(&Apache::lonxml::get_param('align',$parstack,$safeeval),0,1) ne '') {   if (substr(&Apache::lonxml::get_param('align',$parstack,$safeeval),0,1) ne '') {
     push @Apache::londefdef::rows, substr(&Apache::lonxml::get_param('align',$parstack,$safeeval),0,1);      push @ {$Apache::londefdef::table{'rows'} }, substr(&Apache::lonxml::get_param('align',$parstack,$safeeval),0,1);
  } else {   } else {
     push @Apache::londefdef::rows, 'c';      push @ {$Apache::londefdef::table{'rows'} }, 'c';
  }   }
  $currentstring = '\hline ';   push ( @{ $Apache::londefdef::table{'rowdata'} }, $Apache::londefdef::table{'hinc'});
  $Apache::londefdef::counter_columns = 0;   $Apache::londefdef::table{'counter_columns'} = 0;
   
     }       } 
    return $currentstring;     return $currentstring;
  }           }        
Line 1324  EDITBUTTON Line 1322  EDITBUTTON
             if ($target eq 'web') {              if ($target eq 'web') {
  $currentstring = $token->[2];        $currentstring = $token->[2];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = '\\\\';   
     }      }
    return $currentstring;     return $currentstring;
  }   }
Line 1337  EDITBUTTON Line 1334  EDITBUTTON
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  my $what_to_push = substr(&Apache::lonxml::get_param('align',$parstack,$safeeval),0,1);   my $what_to_push = substr(&Apache::lonxml::get_param('align',$parstack,$safeeval),0,1);
  if ($what_to_push eq '') {   if ($what_to_push eq '') {
     $what_to_push = substr($Apache::londefdef::rows[0],0,1);      $what_to_push = substr($Apache::londefdef::table{'rows'}[0],0,1);;
  }   }
     push @Apache::londefdef::columns, $what_to_push;      push @{ $Apache::londefdef::table{'columns'} }, $what_to_push;
  $Apache::londefdef::counter_columns++;   $Apache::londefdef::table{'counter_columns'}++;
  $currentstring = $token->[4];;   &Apache::lonxml::startredirection();
   ;
     }       } 
    return $currentstring;     return $currentstring;
  }           }        
Line 1351  EDITBUTTON Line 1349  EDITBUTTON
             if ($target eq 'web') {              if ($target eq 'web') {
  $currentstring = $token->[2];        $currentstring = $token->[2];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = $token->[2];;   my $current_row = $#{ $Apache::londedef::table{'rows'} };
    my $data=&Apache::lonxml::endredirection();
    @{ $Apache::londefdef::table{'rowdata'} }[$current_row] .= $data.' '.$Apache::londefdef::table{'vinc'};
     }      }
    return $currentstring;     return $currentstring;
  }   }

Removed from v.1.51  
changed lines
  Added in v.1.52


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