Diff for /loncom/xml/londefdef.pm between versions 1.197 and 1.202

version 1.197, 2004/01/30 17:31:06 version 1.202, 2004/03/12 15:21:49
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 635  sub start_h1 { Line 636  sub start_h1 {
  $currentstring .= $token->[4];   $currentstring .= $token->[4];
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  my $pre;   my $pre;
  my $align=&Apache::lonxml::get_param('align',$parstack,$safeeval,undef,1);   my $align=lc(&Apache::lonxml::get_param('align',$parstack,$safeeval,undef,1));
  if (($align eq 'center') || (not defined $align)) {   if (($align eq 'center') || (not defined $align)) {
     $pre='\begin{center}';      $pre='\begin{center}';
  } elsif ($align eq 'left') {   } elsif ($align eq 'left') {
Line 1099  sub end_q { Line 1100  sub end_q {
 }  }
   
 #-- <p> tag (end tag optional)  #-- <p> tag (end tag optional)
   #optional attribute - align="center|left|right"
 sub start_p {  sub start_p {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;      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') {
  my $signal=1;   my $align=&Apache::lonxml::get_param('align',$parstack,$safeeval,undef,1);
  foreach my $tag (@$tagstack) {if (lc($tag) eq 'b') {$signal=0;}}   if ($align eq 'center') {
  if ($signal) {$currentstring .= '\par ';}      $currentstring='\begin{center}\par';
    } elsif ($align eq 'right') {
       $currentstring='\makebox['.$ENV{'form.textwidth'}.']{\hfill\llap{';
    } elsif ($align eq 'left') {
       $currentstring='\noindent\makebox['.$ENV{'form.textwidth'}.']{\rlap{';
    }
    my $signal=1;#<p> does not work inside <b>...</b> 
    foreach my $tag (@$tagstack) {if (lc($tag) eq 'b') {$signal=0;}
    if (!$signal) {$currentstring = '';}
    }
     }      }
     return $currentstring;      return $currentstring;
 }  }
   
 sub end_p {  sub end_p {
     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') {
    if ($$tagstack[-1] eq 'p') {
       my $align=&Apache::lonxml::get_param('align',$parstack,$safeeval,undef,1);
       if ($align eq 'center') {
    $currentstring .= '\end{center}';
       } elsif ($align eq 'right') {
    $currentstring .= '}}';
       } elsif ($align eq 'left') {
    $currentstring .= '}\hfill}';
       }
    }
     }      }
     return $currentstring;      return $currentstring;
 }  }
Line 1316  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 1327  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 1339  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 1350  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;
 }  }

Removed from v.1.197  
changed lines
  Added in v.1.202


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