Diff for /loncom/xml/londefdef.pm between versions 1.171 and 1.178

version 1.171, 2003/09/05 19:35:40 version 1.178, 2003/10/01 21:13:50
Line 92  sub start_m { Line 92  sub start_m {
     $Apache::lontexconvert::errorstring='';      $Apache::lontexconvert::errorstring='';
  }   }
  #&Apache::lonxml::debug("M is ends with:$currentstring:");   #&Apache::lonxml::debug("M is ends with:$currentstring:");
    $Apache::lonxml::post_evaluate=0;
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = &Apache::lonxml::get_all_text_unbalanced("/m",$parser);   $currentstring = &Apache::lonxml::get_all_text_unbalanced("/m",$parser);
    my $eval=&Apache::lonxml::get_param('eval',$parstack,$safeeval);
    if ($eval eq 'on') {
       $currentstring=&Apache::run::evaluate($currentstring,$safeeval,$$parstack[-1]);
    }
  if ($currentstring=~/^(\s*\\\\\s*)*$/) {$currentstring = ' \vskip 0 mm ';}   if ($currentstring=~/^(\s*\\\\\s*)*$/) {$currentstring = ' \vskip 0 mm ';}
    $Apache::lonxml::post_evaluate=0;
     } else {      } else {
  my $inside = &Apache::lonxml::get_all_text_unbalanced("/m",$parser);   my $inside = &Apache::lonxml::get_all_text_unbalanced("/m",$parser);
     }      }
Line 1638  sub start_dl { Line 1644  sub start_dl {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[4];        $currentstring = $token->[4];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = '\begin{description}';     $currentstring = '\begin{description}';
    @Apache::londefdef::description=();
    $Apache::londefdef::DD_redirection=0;
    $Apache::londefdef::DT_redirection=0;
     }       } 
     return $currentstring;      return $currentstring;
 }  }
   
 sub end_dl {  sub end_dl {
     my ($target,$token) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[2];        $currentstring = $token->[2];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = '\end{description}';     if ($Apache::londefdef::DT_redirection) {
       my $data=&item_cleanup;
       push @Apache::londefdef::description,'\item['.$data.']';
       $Apache::londefdef::DT_redirection=0;
    } elsif ($Apache::londefdef::DD_redirection) {
       $Apache::londefdef::description[-1].=&Apache::lonxml::endredirection();
    }
    foreach my $element (@Apache::londefdef::description) {
       $currentstring.=' '.$element.' ';
    }
    @Apache::londefdef::description=();
    $currentstring.='\end{description}';  
     }       } 
     return $currentstring;      return $currentstring;
 }  }
   
 #-- <dt> tag  #-- <dt> tag (end tag optional)
 sub start_dt {  sub start_dt {
     my ($target,$token) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';      my $currentstring='';
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[4];        $currentstring = $token->[4];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = '\item[';     if ($Apache::londefdef::DT_redirection) {
       my $data=&item_cleanup;
       push @Apache::londefdef::description,'\item['.$data.']';
       $Apache::londefdef::DT_redirection=0;
    } elsif ($Apache::londefdef::DD_redirection) {
       $Apache::londefdef::description[-1].=&Apache::lonxml::endredirection();
       $Apache::londefdef::DD_redirection=0;
    }
    &Apache::lonxml::startredirection();
    $Apache::londefdef::DT_redirection=1;
     }       } 
     return $currentstring;      return $currentstring;
 }  }
   
 sub end_dt {  sub end_dt {
     my ($target,$token) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[2];       $currentstring = $token->[2];    
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = ']';     my $data=&item_cleanup;
    push @Apache::londefdef::description,'\item['.$data.']';
    $Apache::londefdef::DT_redirection=0;
     }       } 
     return $currentstring;      return $currentstring;
 }  }
   
   sub item_cleanup {
       my $item=&Apache::lonxml::endredirection();
       $item=~s/\\begin{center}//g;
       $item=~s/\\end{center}//g;
       return $item;
   }
   
 #-- <dd> tag  #-- <dd> tag
 sub start_dd {  sub start_dd {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
Line 1684  sub start_dd { Line 1722  sub start_dd {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[4];        $currentstring = $token->[4];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  if ($$tagstack[-2] eq 'dl') {   if ($Apache::londefdef::DT_redirection) {
     $currentstring = ' \item [] ';        my $data=&item_cleanup;
  } elsif ($$tagstack[-2] eq 'dt') {      push @Apache::londefdef::description,'\item['.$data.']';
     $currentstring = ']';       $Apache::londefdef::DT_redirection=0;
  }   }
    $Apache::londefdef::DD_redirection=1;
    &Apache::lonxml::startredirection();
     }       } 
     return $currentstring;      return $currentstring;
 }  }
   
 sub end_dd {  sub end_dd {
     my ($target,$token) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[2];       $currentstring = $token->[2];    
     }       }  elsif ($target eq 'tex') {
    $Apache::londefdef::description[-1].=&Apache::lonxml::endredirection();
    $Apache::londefdef::DD_redirection=0;
       }
     return $currentstring;      return $currentstring;
 }  }
   
Line 2165  sub start_applet { Line 2208  sub start_applet {
     $currentstring='[APPLET: '.$alttag.']';      $currentstring='[APPLET: '.$alttag.']';
  }   }
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = " \\begin{figure} ";   my $alttag= &Apache::lonxml::get_param('alt',$parstack,
          $safeeval,undef,1);
    unless ($alttag) {
       my $code=&Apache::lonxml::get_param('code',$parstack,$safeeval,
    undef,1);
       $alttag=&Apache::lonmeta::alttag($Apache::lonxml::pwd[-1],
        $code);
    }
    $currentstring.='\begin{center} \fbox{Java Applet: '.$alttag.
       '.}\end{center}';
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 2176  sub end_applet { Line 2228  sub end_applet {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[2];   $currentstring = $token->[2];
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = " \\end{figure}";  
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 2199  sub start_embed { Line 2250  sub start_embed {
     $currentstring='[EMBED: '.$alttag.']';      $currentstring='[EMBED: '.$alttag.']';
  }   }
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = " \\begin{figure} ";    
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 2209  sub end_embed { Line 2259  sub end_embed {
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[2];        $currentstring = $token->[2];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {  
  $currentstring = " \\end{figure}";    
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 2229  sub start_param { Line 2278  sub start_param {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[4];        $currentstring = $token->[4];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = " \\begin{figure} ";    
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 2240  sub end_param { Line 2288  sub end_param {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[2];        $currentstring = $token->[2];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = " \\end{figure}";    
     }       } 
     return $currentstring;      return $currentstring;
 }  }

Removed from v.1.171  
changed lines
  Added in v.1.178


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