Diff for /loncom/xml/londefdef.pm between versions 1.231.2.3 and 1.232

version 1.231.2.3, 2004/09/15 20:30:43 version 1.232, 2004/08/16 17:11:10
Line 66  sub initialize_londefdef { Line 66  sub initialize_londefdef {
     @Apache::londefdef::description=();      @Apache::londefdef::description=();
     $Apache::londefdef::DD_redirection=0;      $Apache::londefdef::DD_redirection=0;
     $Apache::londefdef::DT_redirection=0;      $Apache::londefdef::DT_redirection=0;
     $Apache::londefdef::list_index=0;  
 }  }
   
 #======================= TAG SUBROUTINES =====================  #======================= TAG SUBROUTINES =====================
Line 155  sub start_html { Line 154  sub start_html {
     &Apache::lonxml::fontsettings();           &Apache::lonxml::fontsettings();     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  @Apache::londefdef::table = ();   @Apache::londefdef::table = ();
  $currentstring .= '\documentclass[letterpaper]{article}';   $currentstring .= '\documentclass[letterpaper]{book}';
  if ($ENV{'form.latex_type'}=~'batchmode') {$currentstring .='\batchmode';}    if ($ENV{'form.latex_type'}=~'batchmode') {$currentstring .='\batchmode';} 
  $currentstring .= '\newcommand{\keephidden}[1]{}'.   $currentstring .= '\newcommand{\keephidden}[1]{}'.
                           '\renewcommand{\deg}{$^{\circ}$}'.                            '\renewcommand{\deg}{$^{\circ}$}'.
Line 177  sub start_html { Line 176  sub start_html {
 }  }
   
 sub end_html {  sub end_html {
     my ($target,$token) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = &Apache::lonxml::xmlend();   $currentstring = &Apache::lonxml::xmlend($target,$parser);
     }      }
     return $currentstring;      return $currentstring;
 }  }
Line 1135  sub end_p { Line 1134  sub end_p {
  $currentstring .= $token->[2];   $currentstring .= $token->[2];
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  my $align=&Apache::lonxml::get_param('align',$parstack,$safeeval,undef,1);   my $align=&Apache::lonxml::get_param('align',$parstack,$safeeval,undef,1);
  if (not defined $align) {   if ($align eq 'center') {
     $currentstring.='\strut\\\\\strut ';  
  } elsif ($align eq 'center') {  
     $currentstring .= '\end{center}';      $currentstring .= '\end{center}';
  } elsif ($align eq 'right') {   } elsif ($align eq 'right') {
     $currentstring .= '}}';      $currentstring .= '}}';
  } elsif ($align eq 'left') {   } elsif ($align eq 'left') {
     $currentstring .= '}\hfill}';      $currentstring .= '}\hfill}';
  }    }
     }      }
     return $currentstring;      return $currentstring;
 }  }
Line 1486  sub start_li { Line 1483  sub start_li {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[4];        $currentstring = $token->[4];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  my $type=&Apache::lonxml::get_param('type',$parstack,$safeeval,undef,0);   my  $type=&Apache::lonxml::get_param('type',$parstack,$safeeval,undef,1);
  my $value=&Apache::lonxml::get_param('value',$parstack,$safeeval,undef,0);   if ($type=~/circle/) {
  #FIXME need to support types i and I       $currentstring .= ' \item[o] ';
  if ($type=~/disc/) {  
     $currentstring .= ' \item[$\bullet$] ';  
  } elsif ($type=~/circle/) {  
     $currentstring .= ' \item[$\circ$] ';  
  } elsif ($type=~/square/) {   } elsif ($type=~/square/) {
     $currentstring .= ' \item[$\diamond$] ';      $currentstring .= ' \item[$\Box$] ';
  } elsif ($type eq '1') {   } elsif ($type ne '') { 
     $currentstring .= ' \item['.($Apache::londefdef::list_index+1).'.]';      $currentstring .= ' \item['.$type.'] ';
  } elsif ($type eq 'A') {  
     $currentstring .= ' \item['.('A'..'Z')[$Apache::londefdef::list_index].'.]';  
  } elsif ($type eq 'a') {  
     $currentstring .= ' \item['.('a'..'z')[$Apache::londefdef::list_index].'.]';  
  } elsif ($value ne '') {  
     $currentstring .= ' \item['.$value.'] ';  
  } else {   } else {
     $currentstring .= ' \item ';      $currentstring .= ' \item ';
  }     }  
  $Apache::londefdef::list_index++;      } 
     }  
     return $currentstring;      return $currentstring;
 }  }
   
Line 1554  sub start_ul { Line 1540  sub start_ul {
  $currentstring = $token->[4];        $currentstring = $token->[4];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  my $TeXtype=&Apache::lonxml::get_param('type',$parstack,$safeeval,undef,0);   my $TeXtype=&Apache::lonxml::get_param('type',$parstack,$safeeval,undef,0);
  $Apache::londefdef::list_index=0;  
  if ($TeXtype eq 'disc') {   if ($TeXtype eq 'disc') {
     $currentstring .= '\renewcommand{\labelitemi}{$\bullet$}'.      $currentstring .= '\renewcommand{\labelitemi}{$\bullet$}'.
                               '\renewcommand{\labelitemii}{$\bullet$}'.                                 '\renewcommand{\labelitemii}{$\bullet$}'. 
Line 1643  sub start_ol { Line 1628  sub start_ol {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[4];        $currentstring = $token->[4];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $Apache::londefdef::list_index=0;  
  my $type=&Apache::lonxml::get_param('type',$parstack,$safeeval,undef,0);   my $type=&Apache::lonxml::get_param('type',$parstack,$safeeval,undef,0);
  if ($type eq '1') {   if ($type eq '1') {
     $currentstring .= '\renewcommand{\labelenumi}{\arabic{enumi}.}'.      $currentstring .= '\renewcommand{\labelenumi}{\arabic{enumi}.}'.
Line 2673  sub start_allow { Line 2657  sub start_allow {
     $src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src);      $src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src);
     $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=      $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=
  &Apache::lonnet::clutter($src);   &Apache::lonnet::clutter($src);
     if ($target eq 'tex') { &image_replication($src); }      &image_replication($src);
     my $result;      my $result;
     if ($target eq 'edit') {      if ($target eq 'edit') {
  $result .=&Apache::edit::tag_start($target,$token);   $result .=&Apache::edit::tag_start($target,$token);

Removed from v.1.231.2.3  
changed lines
  Added in v.1.232


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