Diff for /loncom/xml/londefdef.pm between versions 1.415.4.1 and 1.422

version 1.415.4.1, 2010/08/16 16:14:32 version 1.422, 2010/08/27 09:42:48
Line 2048  sub start_table { Line 2048  sub start_table {
  my $width  = &Apache::lonxml::get_param('TeXwidth', $parstack, $safeeval, undef, 0);   my $width  = &Apache::lonxml::get_param('TeXwidth', $parstack, $safeeval, undef, 0);
  my $theme  = &Apache::lonxml::get_param('TeXtheme', $parstack, $safeeval, undef, 0);   my $theme  = &Apache::lonxml::get_param('TeXtheme', $parstack, $safeeval, undef, 0);
  my $align  = &Apache::lonxml::get_param('align', $parstack, $safeeval, undef, 0);   my $align  = &Apache::lonxml::get_param('align', $parstack, $safeeval, undef, 0);
         my $cell_border = &Apache::lonxml::get_param('rules', $parstack, $safeeval, undef, 0);   my $cell_border = &Apache::lonxml::get_param('rules', $parstack, $safeeval, undef, 0);
   
  # The only thing that needs any figuring out is the width.. and then only if it is   # The only thing that needs any figuring out is the width.. and then only if it is
  # a percent. If not it's assumed to be some valid TeX measurement unit e.g. 3.0cm   # a percent. If not it's assumed to be some valid TeX measurement unit e.g. 3.0cm
  #   #
   
  my $table = new Apache::lontable();   my $table = new Apache::lontable();
         if ((defined $border) && ($border > 0)) {   if ((defined $border) && ($border > 0)) {
         #    &Apache::lonnet::logthis("Turning on table borders: $border");   #    &Apache::lonnet::logthis("Turning on table borders: $border");
             $table->table_border(1);      $table->table_border(1);
             if ($cell_border ne 'none') {      if ($cell_border ne 'none') {
                 $table->cell_border(1); # html specs that border turns on both...unless rules='none'.   $table->cell_border(1); # html specs that border turns on both...unless rules='none'.
             }      }
         }   }
         # Only all or nothing for cell borders for now:   # Only all or nothing for cell borders for now:
   
         if ((defined $cell_border) && ($cell_border ne 'none')) {   if ((defined $cell_border) && ($cell_border ne 'none')) {
         #    &Apache::lonnet::logthis("Turning on cell borders: $cell_border");   #    &Apache::lonnet::logthis("Turning on cell borders: $cell_border");
     $table->cell_border(1);      $table->cell_border(1);
  }   }
         if (defined $theme) {   if (defined $theme) {
     $table->theme($theme);      $table->theme($theme);
  }   }
  if (defined $align) {   if (defined $align) {
Line 2080  sub start_table { Line 2080  sub start_table {
  if (!(defined $width)) {   if (!(defined $width)) {
     $width = '70%';      $width = '70%';
  }   }
   
  # If a percentage, need to calculate what this means in terms of   # If a percentage, need to calculate what this means in terms of
  # page width:   # page width:
   
Line 2193  sub end_table { Line 2193  sub end_table {
   
  my $table = pop(@Apache::londefdef::table);   my $table = pop(@Apache::londefdef::table);
  my $t     = $table->generate();   my $t     = $table->generate();
    &Apache::lonnet::logthis("Generating string");
  $currentstring = $t->generate_string();   $currentstring = $t->generate_string();
    &Apache::lonnet::logthis("Generated: $currentstring");
  &enable_para();   &enable_para();
  #--------------------------------------------------------------   #--------------------------------------------------------------
  #  Old table code:   #  Old table code:
Line 3169  sub start_img { Line 3171  sub start_img {
    # Render unto browsers that which are the browser's...     # Render unto browsers that which are the browser's...
   
     if ($target eq 'web' || $target eq 'webgrade') {      if ($target eq 'web' || $target eq 'webgrade') {
  if ($env{'browser.imagesuppress'} ne 'on') {          my $enc = ('yes' eq 
     my $enc = ('yes' eq                      lc(&Apache::lonxml::get_param('encrypturl',$parstack,
        lc(&Apache::lonxml::get_param('encrypturl',$parstack,                        $safeeval)));
      $safeeval)));          $currentstring.=&Apache::lonenc::encrypt_ref($token,{'src'=>$src},
     $currentstring.=&Apache::lonenc::encrypt_ref($token,{'src'=>$src},                           $enc);
  $enc);  
  } else {  
     my $alttag = &Apache::lonxml::get_param('alt',$parstack,$safeeval,  
     undef,1);  
     if (!$alttag) {  
  $alttag = &Apache::lonmeta::alttag($Apache::lonxml::pwd[-1],  
    $src);  
     }  
     $currentstring.='[IMAGE: '.$alttag.']';  
  }  
   
  # and render unto TeX that which is LaTeX  
   
       # and render unto TeX that which is LaTeX
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  #   #
  #  The alignment will require some superstructure to be put around   #  The alignment will require some superstructure to be put around
Line 3287  sub start_img { Line 3278  sub start_img {
    ['', 'none','parbox', 'parpic', 'wrapfigure'], $token, 2);     ['', 'none','parbox', 'parpic', 'wrapfigure'], $token, 2);
         my $alt=    &Apache::lonxml::get_param('alt',$parstack,$safeeval);          my $alt=    &Apache::lonxml::get_param('alt',$parstack,$safeeval);
         my $enc=    &Apache::lonxml::get_param('encrypturl',$parstack,$safeeval);          my $enc=    &Apache::lonxml::get_param('encrypturl',$parstack,$safeeval);
    
  $currentstring .=&Apache::edit::select_arg('Encrypt URL:','encrypturl',   $currentstring .=&Apache::edit::select_arg('Encrypt URL:','encrypturl',
    ['no','yes'], $token, 2);     ['no','yes'], $token, 2);
         if (($alt=~/\S/) && (lc($enc) eq 'yes')) {          if (($alt=~/\S/) && (lc($enc) eq 'yes')) {
Line 3301  sub start_img { Line 3292  sub start_img {
         if ($token->[2]{'src'}=~/\$/) {          if ($token->[2]{'src'}=~/\$/) {
            $currentstring.=&mt('Variable image source');             $currentstring.=&mt('Variable image source');
         } elsif ($token->[2]{'src'}=~/\S/) {          } elsif ($token->[2]{'src'}=~/\S/) {
            $currentstring .= '<img src="'.$src.'" alt="'.$alt.'" ';     $currentstring .= '<img src="'.$src.'" alt="'.$alt.'" ';
            if ($width) { $currentstring.=' width="'.$width.'" '; }     if ($width) { $currentstring.=' width="'.$width.'" '; }
            if ($height) { $currentstring.=' height="'.$height.'" '; }     if ($height) { $currentstring.=' height="'.$height.'" '; }
            $currentstring .= ' />';     $currentstring .= ' />';
         } else {          } else {
            $currentstring.=&mt("No image source specified");             $currentstring.=&mt("No image source specified");
         }          }
Line 3375  sub start_applet { Line 3366  sub start_applet {
     &Apache::lonxml::extlink($archive);      &Apache::lonxml::extlink($archive);
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {      if ($target eq 'web' || $target eq 'webgrade') {
  if ($env{'browser.appletsuppress'} ne 'on') {          $currentstring = &Apache::lonenc::encrypt_ref($token,
     $currentstring = &Apache::lonenc::encrypt_ref($token,                                                        {'code'=>$code,
   {'code'=>$code,                                                         'archive'=>$archive}
    'archive'=>$archive}                                                       );
   );  
  } else {  
     my $alttag= &Apache::lonxml::get_param('alt',$parstack,  
    $safeeval,undef,1);  
     unless ($alttag) {  
  $alttag=&Apache::lonmeta::alttag($Apache::lonxml::pwd[-1],  
  $code);  
     }  
     $currentstring='[APPLET: '.$alttag.']';  
  }  
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  # Turn off some stuff we can't be inside thank you LaTeX          # Turn off some stuff we can't be inside thank you LaTeX
   
   
  my $restart_sub = 0;   my $restart_sub = 0;
  my $restart_sup = 0;   my $restart_sup = 0;
Line 3455  sub start_embed { Line 3435  sub start_embed {
     &Apache::lonxml::extlink($src);      &Apache::lonxml::extlink($src);
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {      if ($target eq 'web' || $target eq 'webgrade') {
  if ($env{'browser.embedsuppress'} ne 'on') {      $currentstring=&Apache::lonenc::encrypt_ref($token,{'src'=>$src}); 
     $currentstring=&Apache::lonenc::encrypt_ref($token,{'src'=>$src});  
  } else {  
     my $alttag=&Apache::lonxml::get_param  
  ('alt',$parstack,$safeeval,undef,1);  
     unless ($alttag) {  
  $alttag=&Apache::lonmeta::alttag($Apache::lonxml::pwd[-1],$src);  
     }  
     $currentstring='[EMBED: '.$alttag.']';  
  }  
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
     }       } 
     return $currentstring;      return $currentstring;
Line 3474  sub end_embed { Line 3445  sub end_embed {
     my ($target,$token) = @_;      my ($target,$token) = @_;
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {      if ($target eq 'web' || $target eq 'webgrade') {
  $currentstring = $token->[2];               $currentstring = $token->[2];
     } elsif ($target eq 'tex') {        } elsif ($target eq 'tex') {
     }           # ./.
       }
     return $currentstring;      return $currentstring;
 }  }
   
Line 3914  sub end_colgroup { Line 3886  sub end_colgroup {
     return $currentstring;      return $currentstring;
 }  }
   
   
 #-- <del> tag (end tag required)  #-- <del> tag (end tag required)
 sub start_del {  sub start_del {
     my ($target,$token) = @_;      my ($target,$token) = @_;
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {      if ($target eq 'web' || $target eq 'webgrade') {
  $currentstring = $token->[4];        $currentstring = $token->[4];     
       } elsif ($target eq 'tex') {
    &disable_para();
    $currentstring .= '\st{';  
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 3928  sub end_del { Line 3904  sub end_del {
     my ($target,$token) = @_;      my ($target,$token) = @_;
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {      if ($target eq 'web' || $target eq 'webgrade') {
  $currentstring = $token->[2];       $currentstring = $token->[2];     
       } elsif ($target eq 'tex') {
    &enable_para();
    $currentstring = '}';
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 4864  sub latex_header { Line 4843  sub latex_header {
  "\\usepackage{xcolor}\n".   "\\usepackage{xcolor}\n".
  '\usepackage{calc}'.   '\usepackage{calc}'.
  '\usepackage{amsmath}'.   '\usepackage{amsmath}'.
       '\usepackage{soul}',
  '\usepackage{amssymb}'.   '\usepackage{amssymb}'.
  '\usepackage{amsfonts}'.   '\usepackage{amsfonts}'.
  '\usepackage{amsthm}'.   '\usepackage{amsthm}'.

Removed from v.1.415.4.1  
changed lines
  Added in v.1.422


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