File:  [LON-CAPA] / loncom / xml / londefdef.pm
Revision 1.93: download - view: text, annotated - select for diffs
Tue Oct 8 20:18:36 2002 UTC (21 years, 8 months ago) by sakharuk
Branches: MAIN
CVS tags: HEAD
Added replication of eps and ps in <img> tag.

    1: # The LearningOnline Network with CAPA
    2: # Tags Default Definition Module 
    3: #
    4: # $Id: londefdef.pm,v 1.93 2002/10/08 20:18:36 sakharuk Exp $
    5: # 
    6: #
    7: # Copyright Michigan State University Board of Trustees
    8: #
    9: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
   10: #
   11: # LON-CAPA is free software; you can redistribute it and/or modify
   12: # it under the terms of the GNU General Public License as published by
   13: # the Free Software Foundation; either version 2 of the License, or
   14: # (at your option) any later version.
   15: #
   16: # LON-CAPA is distributed in the hope that it will be useful,
   17: # but WITHOUT ANY WARRANTY; without even the implied warranty of
   18: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   19: # GNU General Public License for more details.
   20: #
   21: # You should have received a copy of the GNU General Public License
   22: # along with LON-CAPA; if not, write to the Free Software
   23: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   24: #
   25: # /home/httpd/html/adm/gpl.txt
   26: #
   27: # http://www.lon-capa.org/
   28: #
   29: # Copyright for TtHfunc and TtMfunc by Ian Hutchinson. 
   30: # TtHfunc and TtMfunc (the "Code") may be compiled and linked into 
   31: # binary executable programs or libraries distributed by the 
   32: # Michigan State University (the "Licensee"), but any binaries so 
   33: # distributed are hereby licensed only for use in the context
   34: # of a program or computational system for which the Licensee is the 
   35: # primary author or distributor, and which performs substantial 
   36: # additional tasks beyond the translation of (La)TeX into HTML.
   37: # The C source of the Code may not be distributed by the Licensee
   38: # to any other parties under any circumstances.
   39: #
   40: #
   41: # last modified 06/26/00 by Alexander Sakharuk
   42: # 11/6,11/30,02/01/01,5/4 Gerd Kortemeyer
   43: # 01/18 Alex Sakharuk
   44: 
   45: package Apache::londefdef; 
   46: 
   47: use Apache::lonnet;
   48: use strict;
   49: use Apache::lonxml;
   50: use Apache::File();
   51: use Image::Magick;
   52: 
   53: BEGIN {
   54: 
   55:     &Apache::lonxml::register('Apache::londefdef',('a','abbr','acronym','address','allow','applet','area','b','base','basefont','bgo','bgsound','big','blink','blockquote','blankspace','body','br','button','caption','center','cite','code','col','colgroup','dd','del','dfn','dir','div','dl','dt','em','embed','externallink','fieldset','font','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','hr','html','i','iframe','img','input','ins','insert','isindex','kbd','keygen','label','layer','legend','li','link','m','map','marquee','menu','meta','multicol','nobr','noembed','noframes','nolayer','noscript','object','ol','optgroup','option','output','p','param','pre','q','s','samp','select','server','small','spacer','span','strike','strong','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','u','ul','var','wbr'));
   56: 
   57: }
   58: 
   59: #======================= TAG SUBROUTINES =====================
   60: #-- <output>
   61: sub start_output {
   62:   my ($target) = @_;
   63:   if ($target eq 'meta') { $Apache::lonxml::metamode--; }
   64:   return '';
   65: }
   66: sub end_output {
   67:   my ($target) = @_;
   68:   if ($target eq 'meta') { $Apache::lonxml::metamode++; }
   69:   return '';
   70: }
   71: #-- <m> tag
   72: sub start_m {
   73:   my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
   74:   my $currentstring = '';
   75:   if ($target eq 'web') {
   76:     $Apache::lonxml::prevent_entity_encode++;
   77:     my $inside = &Apache::lonxml::get_all_text_unbalanced("/m",$parser);
   78:     $inside ='\\documentstyle{article}'.$inside;
   79:     &Apache::lonxml::debug("M is starting with:$inside:");
   80:     my $eval=&Apache::lonxml::get_param('eval',$parstack,$safeeval);
   81:     if ($eval eq 'on') {
   82:       $inside=&Apache::run::evaluate($inside,$safeeval,$$parstack[-1]);
   83:       #&Apache::lonxml::debug("M is evaulated to:$inside:");
   84:     }
   85:     $currentstring = &Apache::lontexconvert::converted(\$inside);
   86:     if ($Apache::lontexconvert::errorstring) {
   87:       &Apache::lonxml::warning("tth error: ".
   88: 			       $Apache::lontexconvert::errorstring);
   89:       $Apache::lontexconvert::errorstring='';
   90:     }
   91:     #&Apache::lonxml::debug("M is ends with:$currentstring:");
   92:   } elsif ($target eq 'tex') {
   93:     $currentstring = &Apache::lonxml::get_all_text_unbalanced("/m",$parser);
   94:     if ($currentstring=~/^(\s*\\\\\s*)*$/) {$currentstring = ' \vskip 0 mm ';}
   95:   } else {
   96:     my $inside = &Apache::lonxml::get_all_text_unbalanced("/m",$parser);
   97:   }
   98:   return $currentstring;
   99: }
  100: sub end_m {
  101:   my ($target,$token) = @_;
  102:   my $currentstring = '';
  103:   if ($target eq 'web') {
  104:     $Apache::lonxml::prevent_entity_encode--;
  105:   } elsif ($target eq 'tex') {
  106:     $currentstring = "";
  107:   } elsif ($target eq 'meta') {
  108:   }
  109:   return $currentstring;
  110: }
  111: #-- <html> tag    
  112:       sub start_html {
  113: 	    my ($target,$token) = @_;
  114:             my $currentstring = '';
  115: 	    if ($ENV{'browser.mathml'}) {
  116: 	      &tth::ttminit();
  117: 	    } else {
  118: 	      &tth::tthinit();
  119: 	    }
  120:             if ($target eq 'web') {
  121:               $currentstring = &Apache::lonxml::xmlbegin().
  122:                                &Apache::lonxml::fontsettings();     
  123: 	    } elsif ($target eq 'tex') {
  124: 	      @Apache::londefdef::table = ();
  125: 	      $currentstring .= '\documentclass[letterpaper]{article}
  126:                                  \newcommand{\keephidden}[1]{}
  127:                                  \renewcommand{\deg}{$^{\circ}$}
  128:                                  \usepackage[dvips]{graphicx}
  129:                                  \usepackage{epsfig}\usepackage{calc}
  130:                                  \newenvironment{choicelist}{\begin{enumerate}}{\end{enumerate}}';
  131: 	    }
  132: 	   return $currentstring;
  133: 	}
  134:         sub end_html {
  135: 	    my ($target,$token) = @_;
  136:             my $currentstring = '';
  137:             if ($target eq 'web') {
  138: 		$currentstring = &Apache::lonxml::xmlend();
  139: 	    }
  140: 	   return $currentstring;
  141: 	}
  142: #-- <head> tag
  143:       sub start_head {
  144: 	    my ($target,$token) = @_;
  145:             my $currentstring = '';
  146:             if ($target eq 'web') {
  147:               $currentstring = $token->[4];     
  148: 	    } 
  149: 	   return $currentstring;
  150: 	}
  151:         sub end_head {
  152: 	    my ($target,$token) = @_;
  153:             my $currentstring = '';
  154:             if ($target eq 'web') {
  155:               $currentstring = &Apache::lonxml::registerurl(undef,$target).
  156:                                $token->[2];    
  157:             } 
  158: 	   return $currentstring;
  159: 	}
  160: #-- <map> tag
  161:       sub start_map {
  162: 	    my ($target,$token) = @_;
  163:             my $currentstring = '';
  164:             if ($target eq 'web') {
  165:               $currentstring = $token->[4];     
  166: 	    } 
  167: 	   return $currentstring;
  168: 	}
  169:         sub end_map {
  170: 	    my ($target,$token) = @_;
  171:             my $currentstring = '';
  172:             if ($target eq 'web') {
  173:               $currentstring = $token->[2];    
  174:             } 
  175: 	   return $currentstring;
  176: 	}
  177: #-- <select> tag
  178:       sub start_select {
  179: 	    my ($target,$token) = @_;
  180:             my $currentstring = '';
  181:             if ($target eq 'web') {
  182:               $currentstring = $token->[4];     
  183: 	    } 
  184: 	   return $currentstring;
  185: 	}
  186:         sub end_select {
  187: 	    my ($target,$token) = @_;
  188:             my $currentstring = '';
  189:             if ($target eq 'web') {
  190:               $currentstring = $token->[2];    
  191:             } 
  192: 	   return $currentstring;
  193: 	}
  194: #-- <option> tag
  195:       sub start_option {
  196: 	    my ($target,$token) = @_;
  197:             my $currentstring = '';
  198:             if ($target eq 'web') {
  199:               $currentstring = $token->[4];     
  200: 	    } 
  201: 	   return $currentstring;
  202: 	}
  203:         sub end_option {
  204: 	    my ($target,$token) = @_;
  205:             my $currentstring = '';
  206:             if ($target eq 'web') {
  207:               $currentstring = $token->[2];    
  208:             } 
  209: 	   return $currentstring;
  210: 	}
  211: #-- <input> tag
  212:       sub start_input {
  213: 	    my ($target,$token) = @_;
  214:             my $currentstring = '';
  215:             if ($target eq 'web') {
  216:               $currentstring = $token->[4];     
  217: 	    } 
  218: 	   return $currentstring;
  219: 	}
  220:         sub end_input {
  221: 	    my ($target,$token) = @_;
  222:             my $currentstring = '';
  223:             if ($target eq 'web') {
  224:               $currentstring = $token->[2];    
  225:             } 
  226: 	   return $currentstring;
  227: 	}
  228: #-- <textarea> tag
  229:       sub start_textarea {
  230: 	    my ($target,$token) = @_;
  231:             my $currentstring = '';
  232:             if ($target eq 'web') {
  233:               $currentstring = $token->[4];     
  234: 	    } 
  235: 	   return $currentstring;
  236: 	}
  237:         sub end_textarea {
  238: 	    my ($target,$token) = @_;
  239:             my $currentstring = '';
  240:             if ($target eq 'web') {
  241:               $currentstring = $token->[2];    
  242:             } 
  243: 	   return $currentstring;
  244: 	}
  245: #-- <form> tag
  246:       sub start_form {
  247: 	    my ($target,$token) = @_;
  248:             my $currentstring = '';
  249:             if ($target eq 'web') {
  250:               $currentstring = $token->[4];     
  251: 	    } 
  252: 	   return $currentstring;
  253: 	}
  254:         sub end_form {
  255: 	    my ($target,$token) = @_;
  256:             my $currentstring = '';
  257:             if ($target eq 'web') {
  258:               $currentstring = $token->[2];    
  259:             } 
  260: 	   return $currentstring;
  261: 	}
  262: #-- <title> tag
  263:       sub start_title {
  264: 	    my ($target,$token) = @_;
  265:             my $currentstring = '';
  266:             if ($target eq 'web') {
  267:               $currentstring = $token->[4];     
  268: 	    } elsif ($target eq 'tex') {
  269:               $currentstring .= '\keephidden{' 
  270: 	    }
  271:             if ($target eq 'meta') {
  272: 		$currentstring='<title>';
  273:                 &start_output();
  274:             }
  275: 	   return $currentstring;
  276: 	}
  277:         sub end_title {
  278: 	    my ($target,$token) = @_;
  279:             my $currentstring = '';
  280:             if ($target eq 'web') {
  281:               $currentstring = $token->[2];    
  282:             } elsif ($target eq 'tex') {
  283:               $currentstring .= '}';
  284: 	    }  
  285:             if ($target eq 'meta') {
  286:                &end_output();
  287:                $currentstring='</title>';
  288:             } 
  289: 	   return $currentstring;
  290: 	}
  291: #-- <meta> tag
  292:       sub start_meta {
  293: 	    my ($target,$token,$tagstack,$parstack,$parser) = @_;
  294:             my $currentstring = '';
  295:             if ($target eq 'web') {
  296: 	      my $args='';
  297: 	      if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; }
  298: 	      if ($args eq '') {
  299: 		&Apache::lonxml::get_all_text("/meta",$$parser[$#$parser]);
  300: 	      } else {
  301: 		$currentstring = $token->[4];
  302: 	      }
  303: 	    }
  304:             if ($target eq 'meta') {
  305: 		unless ($token->[2]->{'http-equiv'}) {
  306: 		    my $name=$token->[2]->{'name'};
  307:                     $name=~tr/A-Z/a-z/;
  308:                     $name=~s/\s/\_/g;
  309:                     if ($name) {
  310:                        $currentstring='<'.$name.'>'.
  311:                                          $token->[2]->{'content'}.
  312: 			              '</'.$name.'>';
  313: 		    }
  314:                 }
  315: 	    }
  316: 	   return $currentstring;
  317: 	}
  318:       sub end_meta {
  319: 	my ($target,$token,$tagstack,$parstack,$parser) = @_;
  320: 	my $currentstring = '';
  321: 	if ($target eq 'web') {
  322: 	  my $args='';
  323: 	  if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; }
  324: 	  if ($args ne '') {
  325: 	    $currentstring = $token->[4];
  326: 	  }
  327: 	} 
  328: 	return $currentstring;
  329:       }
  330: #-- <body> tag
  331:         sub start_body {
  332:             my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
  333:             my $currentstring = '';
  334:             if ($target eq 'web') {
  335: 	      if (!$Apache::lonxml::registered) {
  336: 		$currentstring.='<head>'.
  337: 		    &Apache::lonxml::registerurl(undef,$target).'</head>';
  338: 	      }
  339: 	      my $onLoad='';
  340: 	      foreach my $key (keys(%{$token->[2]})) {
  341: 		if ($key =~ /^onload$/i) {
  342: 		  $onLoad.=$token->[2]->{$key}.';';
  343: 		  delete($token->[2]->{$key});
  344: 		}
  345: 	      }
  346: 	      $token->[2]->{'onLoad'}=&Apache::lonxml::loadevents().
  347: 		                       ';'.$onLoad;
  348: 	      my $onUnload='';
  349: 	      foreach my $key (keys(%{$token->[2]})) {
  350: 		if ($key =~ /^onunload$/i) {
  351: 		  $onUnload.=$token->[2]->{$key}.';';
  352: 		  delete($token->[2]->{$key});
  353: 		}
  354: 	      }
  355: 	      $token->[2]->{'onUnload'}=&Apache::lonxml::unloadevents().
  356: 		                         ';'.$onUnload;
  357: 
  358: 	      $currentstring .= '<'.$token->[1];
  359: 	      foreach (keys %{$token->[2]}) {
  360: 	      	$currentstring.=' '.$_.'="'.$token->[2]->{$_}.'"';
  361: 	      }
  362: 	      $currentstring.='>';
  363: 	      if ($ENV{'request.state'} ne 'published') {
  364: 		$currentstring.=(<<EDITBUTTON);
  365: 		<form method="post">
  366: 		<input type="submit" name="editmode" value="Edit" />
  367: 		</form>
  368: EDITBUTTON
  369: 	      }
  370:        	    } elsif ($target eq 'tex') {
  371:               $currentstring = '\begin{document}';  
  372: 	    } 
  373: 	   return $currentstring;
  374: 	}
  375:         sub end_body {
  376: 	    my ($target,$token) = @_;
  377:             my $currentstring = '';
  378:             if ($target eq 'web') {
  379:               $currentstring = $token->[2];     
  380: 	    } elsif ($target eq 'tex') {
  381:               $currentstring = '\end{document}';  
  382: 	    } 
  383: 	   return $currentstring;
  384: 	}
  385: #-- <center> tag
  386:         sub start_center {
  387: 	    my ($target,$token) = @_;
  388:             my $currentstring = '';
  389:             if ($target eq 'web') {
  390:               $currentstring = $token->[4];     
  391: 	    } elsif ($target eq 'tex') {
  392:               $currentstring = '\begin{center}';  
  393: 	    }  elsif ($target eq 'latexsource') {
  394:               $currentstring = '\begin{center}';  
  395: 	    } 
  396: 	   return $currentstring;
  397: 	}
  398:         sub end_center {
  399: 	    my ($target,$token) = @_;
  400:             my $currentstring = '';
  401:             if ($target eq 'web') {
  402:               $currentstring = $token->[2];     
  403: 	    } elsif ($target eq 'tex') {
  404:               $currentstring = '\end{center}';  
  405: 	    }  elsif ($target eq 'latexsource') {
  406:               $currentstring = '\end{center}';  
  407: 	    } 
  408: 	   return $currentstring;
  409: 	}
  410: #-- <b> tag
  411:         sub start_b {
  412: 	    my ($target,$token) = @_;
  413:             my $currentstring = '';
  414:             if ($target eq 'web') {
  415:               $currentstring = $token->[4];     
  416: 	    } elsif ($target eq 'tex') {
  417:               $currentstring = '\textbf{';  
  418: 	    }  elsif ($target eq 'latexsource') {
  419:               $currentstring = '\textbf{';  
  420: 	    } 
  421: 	   return $currentstring;
  422: 	}
  423:         sub end_b {
  424: 	    my ($target,$token) = @_;
  425:             my $currentstring = '';
  426:             if ($target eq 'web') {
  427:               $currentstring = $token->[2];     
  428: 	    } elsif ($target eq 'tex') {
  429:               $currentstring = '}';  
  430: 
  431: 	    } elsif ($target eq 'latexsource') {
  432:               $currentstring = '}';  
  433: 	    } 
  434: 	   return $currentstring;
  435: 	}
  436: #-- <strong> tag
  437:         sub start_strong {
  438: 	    my ($target,$token) = @_;
  439:             my $currentstring = '';
  440:             if ($target eq 'web') {
  441:               $currentstring = $token->[4];     
  442: 	    } elsif ($target eq 'tex') {
  443:               $currentstring = '\textbf{';  
  444: 	    } elsif ($target eq 'latexsource') {
  445:               $currentstring = '\textbf{';  
  446: 	    } 
  447: 	   return $currentstring;
  448: 	}
  449:         sub end_strong {
  450: 	    my ($target,$token) = @_;
  451:             my $currentstring = '';
  452:             if ($target eq 'web') {
  453: 
  454:               $currentstring = $token->[2];     
  455: 	    } elsif ($target eq 'tex') {
  456:               $currentstring = '}';  
  457: 	    }  elsif ($target eq 'latexsource') {
  458:               $currentstring = '}';  
  459: 	    } 
  460: 	   return $currentstring;
  461: 	}
  462: #-- <h1> tag
  463:         sub start_h1 {
  464: 	    my ($target,$token) = @_;
  465:             my $currentstring = '';
  466:             if ($target eq 'web') {
  467: 	       $currentstring .= $token->[4];
  468: 	    } elsif ($target eq 'tex') {
  469: 		$currentstring .= '{\large \textbf{';
  470: 	    } elsif ($target eq 'meta') {
  471: 		$currentstring='<subject>';
  472:                 &start_output();
  473:             }
  474:            return $currentstring;
  475: 	}
  476:         sub end_h1 {
  477: 	    my ($target,$token) = @_;
  478:             my $currentstring = '';
  479:             if ($target eq 'web') {
  480: 	       $currentstring .= $token->[2];
  481: 	    } elsif ($target eq 'tex') {
  482: 		$currentstring .= '}}';
  483: 	    } elsif ($target eq 'meta') {
  484:                 &end_output();
  485: 		$currentstring='</subject>';
  486:             } 
  487:            return $currentstring;
  488: 	}
  489: #-- <h2> tag
  490:         sub start_h2 {
  491: 	    my ($target,$token) = @_;
  492:             my $currentstring = '';
  493:             if ($target eq 'web') {
  494: 	       $currentstring .= $token->[4];
  495: 	    } elsif ($target eq 'tex') {
  496: 		$currentstring .= '{\large \textbf{';
  497: 	    } 
  498:            return $currentstring;
  499: 	}
  500:         sub end_h2 {
  501: 	    my ($target,$token) = @_;
  502:             my $currentstring = '';
  503:             if ($target eq 'web') {
  504: 	       $currentstring .= $token->[2];
  505: 	    } elsif ($target eq 'tex') {
  506: 		$currentstring .= '}}';
  507: 	    } 
  508:            return $currentstring;
  509: 	}
  510: #-- <h3> tag
  511:         sub start_h3 {
  512: 	    my ($target,$token) = @_;
  513:             my $currentstring = '';
  514:             if ($target eq 'web') {
  515: 	       $currentstring .= $token->[4];
  516: 	    } elsif ($target eq 'tex') {
  517: 		$currentstring .= '{\large \textbf{';
  518: 	    } 
  519:            return $currentstring;
  520: 	}
  521:         sub end_h3 {
  522: 	    my ($target,$token) = @_;
  523:             my $currentstring = '';
  524:             if ($target eq 'web') {
  525: 	       $currentstring .= $token->[2];
  526: 	    } elsif ($target eq 'tex') {
  527: 		$currentstring .= '}}';
  528: 	    } 
  529:            return $currentstring;
  530: 	}
  531: #-- <h4> tag
  532:         sub start_h4 {
  533: 	    my ($target,$token) = @_;
  534:             my $currentstring = '';
  535:             if ($target eq 'web') {
  536: 	       $currentstring .= $token->[4];
  537: 	    } elsif ($target eq 'tex') {
  538: 		$currentstring .= '{\large \textbf{';
  539: 	    } 
  540:            return $currentstring;
  541: 	}
  542:         sub end_h4 {
  543: 	    my ($target,$token) = @_;
  544:             my $currentstring = '';
  545:             if ($target eq 'web') {
  546: 	       $currentstring .= $token->[2];
  547: 	    } elsif ($target eq 'tex') {
  548: 		$currentstring .= '}}';
  549: 	    } 
  550:            return $currentstring;
  551: 	}
  552: #-- <h5> tag
  553:         sub start_h5 {
  554: 	    my ($target,$token) = @_;
  555:             my $currentstring = '';
  556:             if ($target eq 'web') {
  557: 	       $currentstring .= $token->[4];
  558: 	    } elsif ($target eq 'tex') {
  559: 		$currentstring .= '{\large \textbf{';
  560: 	    } 
  561:            return $currentstring;
  562: 	}
  563:         sub end_h5 {
  564: 	    my ($target,$token) = @_;
  565:             my $currentstring = '';
  566:             if ($target eq 'web') {
  567: 	       $currentstring .= $token->[2];
  568: 	    } elsif ($target eq 'tex') {
  569: 		$currentstring .= '}}';
  570: 	    } 
  571:            return $currentstring;
  572: 	}
  573: #-- <h6> tag
  574:         sub start_h6 {
  575: 	    my ($target,$token) = @_;
  576:             my $currentstring = '';
  577:             if ($target eq 'web') {
  578: 	       $currentstring .= $token->[4];
  579: 	    } elsif ($target eq 'tex') {
  580: 		$currentstring .= '{\large \textbf{';
  581: 	    } 
  582:            return $currentstring;
  583: 	}
  584:         sub end_h6 {
  585: 	    my ($target,$token) = @_;
  586:             my $currentstring = '';
  587:             if ($target eq 'web') {
  588: 	       $currentstring .= $token->[2];
  589: 	    } elsif ($target eq 'tex') {
  590: 		$currentstring .= '}}';
  591: 	    } 
  592:            return $currentstring;
  593: 	}
  594: #--- <cite> tag
  595:         sub start_cite {
  596: 	    my ($target,$token) = @_;
  597:             my $currentstring = '';
  598:             if ($target eq 'web') {
  599: 	       $currentstring .= $token->[4];
  600: 	    } elsif ($target eq 'tex') {
  601: 		$currentstring .= "\\textit{";
  602: 	    }  elsif ($target eq 'latexsource') {
  603: 		$currentstring .= "\\textit{";
  604: 	    } 
  605:            return $currentstring;
  606: 	}
  607:         sub end_cite {
  608: 	    my ($target,$token) = @_;
  609:             my $currentstring = '';
  610:             if ($target eq 'web') {
  611: 	       $currentstring .= $token->[2];
  612: 	    } elsif ($target eq 'tex') {
  613: 		$currentstring .= "}";
  614: 	    }  elsif ($target eq 'latexsource') {
  615: 		$currentstring .= "}";
  616: 	    } 
  617:            return $currentstring;
  618: 	}
  619: #-- <i> tag
  620:         sub start_i {
  621: 	    my ($target,$token) = @_;
  622:             my $currentstring = '';
  623:             if ($target eq 'web') {
  624: 	       $currentstring .= $token->[4];
  625: 	    } elsif ($target eq 'tex') {
  626: 		$currentstring .= '\textit{';
  627: 	    }  elsif ($target eq 'latexsource') {
  628: 		$currentstring .= '\textit{';
  629: 	    } 
  630:            return $currentstring;
  631: 	}
  632:         sub end_i {
  633: 	    my ($target,$token) = @_;
  634:             my $currentstring = '';
  635:             if ($target eq 'web') {
  636: 	       $currentstring .= $token->[2];
  637: 	    } elsif ($target eq 'tex') {
  638: 		$currentstring .= '}';
  639: 	    } elsif ($target eq 'latexsource') {
  640: 		$currentstring .= '}';
  641: 	    } 
  642:            return $currentstring;
  643: 	}
  644: #-- <address> tag
  645:         sub start_address {
  646: 	    my ($target,$token) = @_;
  647:             my $currentstring = '';
  648:             if ($target eq 'web') {
  649: 	       $currentstring .= $token->[4];
  650: 	    } elsif ($target eq 'tex') {
  651: 		$currentstring .= "\\textit{";
  652: 	    } elsif ($target eq 'latexsource') {
  653: 		$currentstring .= "\\textit{";
  654: 	    } 
  655:            return $currentstring;
  656: 	}
  657:         sub end_address {
  658: 	    my ($target,$token) = @_;
  659:             my $currentstring = '';
  660:             if ($target eq 'web') {
  661: 	       $currentstring .= $token->[2];
  662: 	    } elsif ($target eq 'tex') {
  663: 		$currentstring .= "}";
  664: 	    } elsif ($target eq 'latexsource') {
  665: 		$currentstring .= "}";
  666: 	    }
  667:            return $currentstring;
  668: 	}
  669: #-- <dfn> tag
  670:         sub start_dfn {
  671: 	    my ($target,$token) = @_;
  672:             my $currentstring = '';
  673:             if ($target eq 'web') {
  674: 	       $currentstring .= $token->[4];
  675: 	    } elsif ($target eq 'tex') {
  676: 		$currentstring .= "\\textit{";
  677: 	    } elsif ($target eq 'latexsource') {
  678: 		$currentstring .= "\\textit{";
  679: 	    } 
  680:            return $currentstring;
  681: 	}
  682:         sub end_dfn {
  683: 	    my ($target,$token) = @_;
  684:             my $currentstring = '';
  685:             if ($target eq 'web') {
  686: 	       $currentstring .= $token->[2];
  687: 	    } elsif ($target eq 'tex') {
  688: 		$currentstring .= "}";
  689: 	    } elsif ($target eq 'latexsource') {
  690: 		$currentstring .= "}";
  691: 	    } 
  692:            return $currentstring;
  693: 	}
  694: #-- <tt> tag
  695:         sub start_tt {
  696: 	    my ($target,$token) = @_;
  697:             my $currentstring = '';
  698:             if ($target eq 'web') {
  699: 	       $currentstring .= $token->[4];
  700: 	    } elsif ($target eq 'tex') {
  701: 		$currentstring .= '\texttt{';
  702: 	    } elsif ($target eq 'latexsource') {
  703: 		$currentstring .= '\texttt{';
  704: 	    } 
  705:            return $currentstring;
  706: 	}
  707:         sub end_tt {
  708: 	    my ($target,$token) = @_;
  709:             my $currentstring = '';
  710:             if ($target eq 'web') {
  711: 	       $currentstring .= $token->[2];
  712: 	    } elsif ($target eq 'tex') {
  713: 		$currentstring .= '}';
  714: 	    } elsif ($target eq 'latexsource') {
  715: 		$currentstring .= '}';
  716: 	    }
  717:            return $currentstring;
  718: 	}
  719: #-- <kbd> tag
  720:         sub start_kbd {
  721: 	    my ($target,$token) = @_;
  722:             my $currentstring = '';
  723:             if ($target eq 'web') {
  724: 	       $currentstring .= $token->[4];
  725: 	    } elsif ($target eq 'tex') {
  726: 		$currentstring .= "\\texttt";
  727: 	    } elsif ($target eq 'latexsource') {
  728: 		$currentstring .= "\\texttt{";
  729: 	    } 
  730:            return $currentstring;
  731: 	}
  732:         sub end_kbd {
  733: 	    my ($target,$token) = @_;
  734:             my $currentstring = '';
  735:             if ($target eq 'web') {
  736: 	       $currentstring .= $token->[2];
  737: 	    } elsif ($target eq 'tex') {
  738: 		$currentstring .= "}";
  739: 	    } elsif ($target eq 'latexsource') {
  740: 		$currentstring .= "}";
  741: 	    } 
  742:            return $currentstring;
  743: 	}
  744: #-- <code> tag
  745:         sub start_code {
  746: 	    my ($target,$token) = @_;
  747:             my $currentstring = '';
  748:             if ($target eq 'web') {
  749: 	       $currentstring .= $token->[4];
  750: 	    } elsif ($target eq 'tex') {
  751: 		$currentstring .= '\texttt{';
  752: 	    } 
  753:            return $currentstring;
  754: 	}
  755:         sub end_code {
  756: 	    my ($target,$token) = @_;
  757:             my $currentstring = '';
  758:             if ($target eq 'web') {
  759: 	       $currentstring .= $token->[2];
  760: 	    } elsif ($target eq 'tex') {
  761: 		$currentstring .= '}';
  762: 	    } 
  763:            return $currentstring;
  764: 	}
  765: #-- <em> tag
  766:         sub start_em {
  767: 	    my ($target,$token) = @_;
  768:             my $currentstring = '';
  769:             if ($target eq 'web') {
  770: 	       $currentstring .= $token->[4];
  771: 	    } elsif ($target eq 'tex') {
  772: 		$currentstring .= '\emph{';
  773: 	    } elsif ($target eq 'latexsource') {
  774: 		$currentstring .= '\emph{';
  775: 	    } 
  776:            return $currentstring;
  777: 	}
  778:         sub end_em {
  779: 	    my ($target,$token) = @_;
  780:             my $currentstring = '';
  781:             if ($target eq 'web') {
  782: 	       $currentstring .= $token->[2];
  783: 	    } elsif ($target eq 'tex') {
  784: 		$currentstring .= '}';
  785: 	    } elsif ($target eq 'latexsource') {
  786: 		$currentstring .= '}';
  787: 	    }  
  788:            return $currentstring;
  789: 	}
  790: #-- <q> tag
  791:         sub start_q {
  792: 	    my ($target,$token) = @_;
  793:             my $currentstring = '';
  794:             if ($target eq 'web') {
  795: 	       $currentstring .= $token->[4];
  796: 	    } elsif ($target eq 'tex') {
  797: 		$currentstring .= "\\emph{";
  798: 	    }  elsif ($target eq 'latexsource') {
  799: 		$currentstring .= "\\emph{";
  800: 	    }
  801:            return $currentstring;
  802: 	}
  803:         sub end_q {
  804: 	    my ($target,$token) = @_;
  805:             my $currentstring = '';
  806:             if ($target eq 'web') {
  807: 	       $currentstring .= $token->[2];
  808: 	    } elsif ($target eq 'tex') {
  809: 		$currentstring .= "}";
  810: 	    } elsif ($target eq 'latexsource') {
  811: 		$currentstring .= "}";
  812: 	    }  
  813:            return $currentstring;
  814: 	}
  815: #-- <p> tag
  816:         sub start_p {
  817: 	    my ($target,$token) = @_;
  818:             my $currentstring = '';
  819:             if ($target eq 'web') {
  820: 	       $currentstring .= $token->[4];
  821: 	    } elsif ($target eq 'tex') {
  822: 		$currentstring .= '{\par ';
  823: 	    } elsif ($target eq 'latexsource') {
  824: 		$currentstring .= '{\par ';
  825: 	    } 
  826:            return $currentstring;
  827: 	}
  828:         sub end_p {
  829: 	    my ($target,$token) = @_;
  830:             my $currentstring = '';
  831:             if ($target eq 'web') {
  832: 	       $currentstring .= $token->[2];
  833: 	    } elsif ($target eq 'tex') {
  834: 	        $currentstring .= '}';
  835:             } elsif ($target eq 'latexsource') {
  836: 	        $currentstring .= '}';
  837:             }
  838:            return $currentstring;
  839: 	}
  840: #-- <br> tag
  841:         sub start_br {
  842: 	    my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
  843:             my $currentstring = '';
  844:             if ($target eq 'web') {
  845: 	       $currentstring .= $token->[4];
  846: 	    } elsif ($target eq 'tex') {
  847: 		if ($$tagstack[-2] ne 'sub' && $$tagstack[-2] ne 'sup') {
  848: 		    $currentstring .= '\vskip 0 mm';
  849: 		}
  850: 	    } elsif ($target eq 'latexsource') {
  851: 		$currentstring .= '\\';
  852: 	    } 
  853:            return $currentstring;
  854: 	}
  855:         sub end_br {
  856: 	    my ($target,$token) = @_;
  857:             my $currentstring = '';
  858:             if ($target eq 'web') {
  859: 	       $currentstring .= $token->[2];
  860: 	    }
  861:            return $currentstring;
  862: 	}
  863: #-- <big> tag
  864:         sub start_big {
  865: 	    my ($target,$token) = @_;
  866:             my $currentstring = '';
  867:             if ($target eq 'web') {
  868: 	       $currentstring .= $token->[4];
  869: 	    } elsif ($target eq 'tex') {
  870: 		$currentstring .= '\large{';
  871: 	    } elsif ($target eq 'latexsource') {
  872: 		$currentstring .= '{\Large ';
  873: 	    }  
  874:            return $currentstring;
  875: 	}
  876:         sub end_big {
  877: 	    my ($target,$token) = @_;
  878:             my $currentstring = '';
  879:             if ($target eq 'web') {
  880: 	       $currentstring .= $token->[2];
  881: 	    } elsif ($target eq 'tex') {
  882: 	        $currentstring .= '}';
  883:             } elsif ($target eq 'latexsource') {
  884: 	        $currentstring .= '}';
  885:             }
  886:            return $currentstring;
  887: 	}
  888: #-- <small> tag
  889:         sub start_small {
  890: 	    my ($target,$token) = @_;
  891:             my $currentstring = '';
  892:             if ($target eq 'web') {
  893: 	       $currentstring .= $token->[4];
  894: 	    } elsif ($target eq 'tex') {
  895: 		$currentstring .= '{\footnotesize ';
  896: 	    } elsif ($target eq 'latexsource') {
  897: 		$currentstring .= '{\footnotesize ';
  898: 	    } 
  899:            return $currentstring;
  900: 	}
  901:         sub end_small {
  902: 	    my ($target,$token) = @_;
  903:             my $currentstring = '';
  904:             if ($target eq 'web') {
  905: 	       $currentstring .= $token->[2];
  906: 	    } elsif ($target eq 'tex') {
  907: 	        $currentstring .= '}';
  908:             } elsif ($target eq 'latexsource') {
  909: 	        $currentstring .= '}';
  910:             }
  911:            return $currentstring;
  912: 	}
  913: #-- <basefont> tag
  914:       sub start_basefont {
  915: 	my ($target,$token) = @_;
  916: 	my $currentstring = '';
  917: 	if ($target eq 'web') {
  918: 	  $currentstring = $token->[4];     
  919: 	} 
  920: 	return $currentstring;
  921:       }
  922:       sub end_basefont {
  923: 	my ($target,$token) = @_;
  924: 	my $currentstring = '';
  925: 	if ($target eq 'web') {
  926: 	  $currentstring = $token->[4];     
  927: 	} 
  928: 	return $currentstring;
  929:       }
  930: #-- <font> tag
  931:          sub start_font {
  932: 	    my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
  933:             my $currentstring = '';
  934:             if ($target eq 'web') {
  935: 	      my $face=&Apache::lonxml::get_param('face',$parstack,$safeeval);
  936: 	      if ($face=~/symbol/i) {$Apache::lonxml::prevent_entity_encode++;}
  937:               $currentstring = $token->[4];     
  938: 	    } 
  939: 	   return $currentstring;
  940: 	}
  941:         sub end_font {
  942: 	    my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
  943:             my $currentstring = '';
  944:             if ($target eq 'web') {
  945: 	      my $face=&Apache::lonxml::get_param('face',$parstack,$safeeval);
  946: 	      if ($face=~/symbol/i) {$Apache::lonxml::prevent_entity_encode--;}
  947:               $currentstring = $token->[2];    
  948:             } 
  949: 	   return $currentstring;
  950: 	} 
  951: #-- <strike> tag
  952:         sub start_strike {
  953: 	    my ($target,$token) = @_;
  954:             my $currentstring = '';
  955:             if ($target eq 'web') {
  956: 	       $currentstring .= $token->[4];
  957: 	    } elsif ($target eq 'tex') {
  958: 		$currentstring .= '\underline{';
  959: 	    } 
  960:            return $currentstring;
  961: 	}
  962:         sub end_strike {
  963: 	    my ($target,$token) = @_;
  964:             my $currentstring = '';
  965:             if ($target eq 'web') {
  966: 	       $currentstring .= $token->[2];
  967: 	    } elsif ($target eq 'tex') {
  968: 	        $currentstring .= '}';
  969:             }
  970:            return $currentstring;
  971: 	}
  972: #-- <s> tag
  973:         sub start_s {
  974: 	    my ($target,$token) = @_;
  975:             my $currentstring = '';
  976:             if ($target eq 'web') {
  977: 	       $currentstring .= $token->[4];
  978: 	    } elsif ($target eq 'tex') {
  979: 		$currentstring .= '\underline{';
  980: 	    } 
  981:            return $currentstring;
  982: 	}
  983:         sub end_s {
  984: 	    my ($target,$token) = @_;
  985:             my $currentstring = '';
  986:             if ($target eq 'web') {
  987: 	       $currentstring .= $token->[2];
  988: 	    } elsif ($target eq 'tex') {
  989: 	        $currentstring .= '}';
  990:             }
  991:            return $currentstring;
  992: 	}
  993: #-- <sub> tag
  994:         sub start_sub {
  995: 	    my ($target,$token) = @_;
  996:             my $currentstring = '';
  997:             if ($target eq 'web') {
  998: 	       $currentstring .= $token->[4];
  999: 	    } elsif ($target eq 'tex') {
 1000: 		$currentstring .= "\$_{ ";
 1001: 	    } 
 1002:            return $currentstring;
 1003: 	}
 1004:         sub end_sub {
 1005: 	    my ($target,$token) = @_;
 1006:             my $currentstring = '';
 1007:             if ($target eq 'web') {
 1008: 	       $currentstring .= $token->[2];
 1009: 	    } elsif ($target eq 'tex') {
 1010: 	        $currentstring .= " }\$";
 1011:             }
 1012:            return $currentstring;
 1013: 	}
 1014: #-- <sup> tag
 1015:         sub start_sup {
 1016: 	    my ($target,$token) = @_;
 1017:             my $currentstring = '';
 1018:             if ($target eq 'web') {
 1019: 	       $currentstring .= $token->[4];
 1020: 	    } elsif ($target eq 'tex') {
 1021: 		$currentstring .= "\$^{ ";
 1022: 	    } 
 1023:            return $currentstring;
 1024: 	}
 1025:         sub end_sup {
 1026: 	    my ($target,$token) = @_;
 1027:             my $currentstring = '';
 1028:             if ($target eq 'web') {
 1029: 	       $currentstring .= $token->[2];
 1030: 	    } elsif ($target eq 'tex') {
 1031: 	        $currentstring .= " }\$";
 1032:             }
 1033:            return $currentstring;
 1034: 	}
 1035: #-- <hr> tag
 1036:         sub start_hr {
 1037: 	    my ($target,$token) = @_;
 1038:             my $currentstring = '';
 1039:             if ($target eq 'web') {
 1040: 	       $currentstring .= $token->[4];
 1041: 	    } elsif ($target eq 'tex') {
 1042: 		$currentstring .= '\vskip 0 mm \noindent\makebox[\textwidth/2 ][b]{\hrulefill}\vskip 0 mm ';
 1043: 	    } 
 1044:            return $currentstring;
 1045: 	}
 1046:         sub end_hr {
 1047: 	    my ($target,$token) = @_;
 1048:             my $currentstring = '';
 1049:             if ($target eq 'web') {
 1050: 	       $currentstring .= $token->[2];
 1051: 	    } elsif ($target eq 'tex') {
 1052: 	    } 
 1053:            return $currentstring;
 1054: 	}
 1055: #-- <div> tag
 1056:         sub start_div {
 1057: 	    my ($target,$token) = @_;
 1058:             my $currentstring = '';
 1059:             if ($target eq 'web') {
 1060: 	       $currentstring .= $token->[4];
 1061: 	    } 
 1062:            return $currentstring;
 1063: 	}
 1064:         sub end_div {
 1065: 	    my ($target,$token) = @_;
 1066:             my $currentstring = '';
 1067:             if ($target eq 'web') {
 1068: 	       $currentstring .= $token->[2];
 1069: 	    } 
 1070:            return $currentstring;
 1071: 	}
 1072: #-- <a> tag
 1073:         sub start_a {
 1074: 	    my ($target,$token) = @_;
 1075:             my $currentstring = '';
 1076:             if ($target eq 'web') {
 1077: 	       $currentstring .= $token->[4];
 1078: 	    } elsif ($target eq 'tex') {
 1079: 	    }
 1080:            return $currentstring;
 1081: 	}
 1082:         sub end_a {
 1083: 	    my ($target,$token,$tagstack,$stackref) = @_;
 1084:             my $currentstring = '';
 1085:             if ($target eq 'web') {
 1086: 	       $currentstring .= $token->[2];
 1087: 	    } elsif ($target eq 'tex') {
 1088:                 my  $tempor_var = $stackref->[$#$stackref];
 1089: 		if (index($tempor_var,'name') != -1 ) {
 1090: 		    $tempor_var =~ s/name=([^,]*),/$1/g;
 1091: 	        } elsif (index($tempor_var,'href') != -1 ) {
 1092: 		    $tempor_var =~ s/href=([^,]*),/$1/g;
 1093: 	        $currentstring .= " \\ref{$tempor_var}";
 1094: 	        }
 1095:             }
 1096:            return $currentstring;
 1097: 	}
 1098: #-- <li> tag
 1099:         sub start_li {
 1100: 	    my ($target,$token,$tagstack,$stackref) = @_;
 1101:             my $currentstring = '';
 1102:             if ($target eq 'web') {
 1103:               $currentstring = $token->[4];     
 1104: 	    } elsif ($target eq 'tex') {
 1105:                 my  $tempor_var = $stackref->[$#$stackref];
 1106:                 if (index($tempor_var,'circle') != -1 ) {
 1107: 	          $currentstring .= " \\item[o] ";
 1108: 	        } elsif (index($tempor_var,'square') != -1 ) {
 1109: 	               $currentstring .= " \\item[$\Box$] ";
 1110: 	        } elsif ($tempor_var ne '') { 
 1111: 		       $_ = $tempor_var;
 1112:                        m/my\s*([^=]*)=/;
 1113: 		       $currentstring .= " \\item[$1] ";
 1114: 		} else {
 1115: 		    $currentstring .= " \\item ";
 1116: 	        }  
 1117: 	    } 
 1118: 	   return $currentstring;
 1119: 	}
 1120:         sub end_li {
 1121: 	    my ($target,$token) = @_;
 1122:             my $currentstring = '';
 1123:             if ($target eq 'web') {
 1124:               $currentstring = $token->[2];     
 1125: 	    } 
 1126: 	   return $currentstring;
 1127: 	}
 1128: #-- <u> tag
 1129:         sub start_u {
 1130: 	    my ($target,$token) = @_;
 1131:             my $currentstring = '';
 1132:             if ($target eq 'web') {
 1133: 	       $currentstring .= $token->[4];
 1134: 	    } elsif ($target eq 'tex') {
 1135: 		$currentstring .= '\underline{';
 1136: 	    } 
 1137:            return $currentstring;
 1138: 	}
 1139:         sub end_u {
 1140: 	    my ($target,$token) = @_;
 1141:             my $currentstring = '';
 1142:             if ($target eq 'web') {
 1143: 	       $currentstring .= $token->[2];
 1144: 	    } elsif ($target eq 'tex') {
 1145: 	        $currentstring .= '}';
 1146:             }
 1147:            return $currentstring;
 1148: 	}
 1149: #-- <ul> tag
 1150:         sub start_ul {
 1151: 	    my ($target,$token) = @_;
 1152:             my $currentstring = '';
 1153:             if ($target eq 'web') {
 1154:               $currentstring = $token->[4];     
 1155: 	    } elsif ($target eq 'tex') {
 1156:               $currentstring = '\begin{itemize}';  
 1157: 	    } 
 1158: 	   return $currentstring;
 1159: 	}
 1160:         sub end_ul {
 1161: 	    my ($target,$token) = @_;
 1162:             my $currentstring = '';
 1163:             if ($target eq 'web') {
 1164:               $currentstring = $token->[2];     
 1165: 	    } elsif ($target eq 'tex') {
 1166:               $currentstring = '\end{itemize}';  
 1167: 	    } 
 1168: 	   return $currentstring;
 1169: 	}
 1170: #-- <menu> tag
 1171:         sub start_menu {
 1172: 	    my ($target,$token) = @_;
 1173:             my $currentstring = '';
 1174:             if ($target eq 'web') {
 1175:               $currentstring = $token->[4];     
 1176: 	    } elsif ($target eq 'tex') {
 1177:               $currentstring = " \\begin{itemize} ";  
 1178: 	    } 
 1179: 	   return $currentstring;
 1180: 	}
 1181:         sub end_menu {
 1182: 	    my ($target,$token) = @_;
 1183:             my $currentstring = '';
 1184:             if ($target eq 'web') {
 1185:               $currentstring = $token->[2];     
 1186: 	    } elsif ($target eq 'tex') {
 1187:               $currentstring = " \\end{itemize}";  
 1188: 	    } 
 1189: 	   return $currentstring;
 1190: 	}
 1191: #-- <dir> tag
 1192:         sub start_dir {
 1193: 	    my ($target,$token) = @_;
 1194:             my $currentstring = '';
 1195:             if ($target eq 'web') {
 1196:               $currentstring = $token->[4];     
 1197: 	    } elsif ($target eq 'tex') {
 1198:               $currentstring = " \\begin{itemize} ";  
 1199: 	    } 
 1200: 	   return $currentstring;
 1201: 	}
 1202:         sub end_dir {
 1203: 	    my ($target,$token) = @_;
 1204:             my $currentstring = '';
 1205:             if ($target eq 'web') {
 1206:               $currentstring = $token->[2];     
 1207: 	    } elsif ($target eq 'tex') {
 1208:               $currentstring = " \\end{itemize}";  
 1209: 	    } 
 1210: 	   return $currentstring;
 1211: 	}
 1212: #-- <ol> tag
 1213:         sub start_ol {
 1214: 	    my ($target,$token) = @_;
 1215:             my $currentstring = '';
 1216:             if ($target eq 'web') {
 1217:               $currentstring = $token->[4];     
 1218: 	    } elsif ($target eq 'tex') {
 1219:               $currentstring = '\begin{enumerate}';  
 1220: 	    } 
 1221: 	   return $currentstring;
 1222: 	}
 1223:         sub end_ol {
 1224: 	    my ($target,$token) = @_;
 1225:             my $currentstring = '';
 1226:             if ($target eq 'web') {
 1227:               $currentstring = $token->[2];     
 1228: 	    } elsif ($target eq 'tex') {
 1229:               $currentstring = '\end{enumerate}';  
 1230: 	    } 
 1231: 	   return $currentstring;
 1232: 	}
 1233: #-- <dl> tag
 1234:         sub start_dl {
 1235: 	    my ($target,$token) = @_;
 1236:             my $currentstring = '';
 1237:             if ($target eq 'web') {
 1238:               $currentstring = $token->[4];     
 1239: 	    } elsif ($target eq 'tex') {
 1240:               $currentstring = '\begin{description}';  
 1241: 	    } 
 1242: 	   return $currentstring;
 1243: 	}
 1244:         sub end_dl {
 1245: 	    my ($target,$token) = @_;
 1246:             my $currentstring = '';
 1247:             if ($target eq 'web') {
 1248:               $currentstring = $token->[2];     
 1249: 	    } elsif ($target eq 'tex') {
 1250:               $currentstring = '\end{description}';  
 1251: 	    } 
 1252: 	   return $currentstring;
 1253: 	}
 1254: #-- <dt> tag
 1255:         sub start_dt {
 1256: 	    my ($target,$token) = @_;
 1257:             my $currentstring = '';
 1258:             if ($target eq 'web') {
 1259:               $currentstring = $token->[4];     
 1260: 	    } elsif ($target eq 'tex') {
 1261:               $currentstring = '\item[';  
 1262: 	    } 
 1263: 	   return $currentstring;
 1264: 	}
 1265:         sub end_dt {
 1266: 	    my ($target,$token) = @_;
 1267:             my $currentstring = '';
 1268:             if ($target eq 'web') {
 1269:               $currentstring = $token->[2];    
 1270:             } elsif ($target eq 'tex') {
 1271:               $currentstring = ']';  
 1272: 	    } 
 1273: 	   return $currentstring;
 1274: 	}
 1275: #-- <dd> tag
 1276:         sub start_dd {
 1277: 	    my ($target,$token) = @_;
 1278:             my $currentstring = '';
 1279:             if ($target eq 'web') {
 1280:               $currentstring = $token->[4];     
 1281: 	    } 
 1282: 	   return $currentstring;
 1283: 	}
 1284:         sub end_dd {
 1285: 	    my ($target,$token) = @_;
 1286:             my $currentstring = '';
 1287:             if ($target eq 'web') {
 1288:               $currentstring = $token->[2];    
 1289:             } 
 1290: 	   return $currentstring;
 1291: 	}
 1292: #-- <table> tag
 1293: sub start_table {
 1294:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
 1295:     my $currentstring = '';
 1296:     if ($target eq 'web') {
 1297: 	$currentstring = $token->[4];     
 1298:     } elsif ($target eq 'tex') {
 1299: 	my $aa = {};
 1300: 	push @Apache::londefdef::table, $aa; 
 1301: 	$Apache::londefdef::table[-1]{'row_number'} = -1;
 1302: 	$Apache::londefdef::table[-1]{'output'} = ' \noindent \begin{tabular} ';
 1303: 	my $border = &Apache::lonxml::get_param('border',$parstack,$safeeval);
 1304: 	unless (defined $border) { $border = 0; }
 1305: 	if ($border) { 
 1306: 	    $Apache::londefdef::table[-1]{'hinc'} = '\hline '; 
 1307: 	    $Apache::londefdef::table[-1]{'vinc'} = '&'; 
 1308: 	    $Apache::londefdef::table[-1]{'vvinc'} = '|';
 1309: 	} else {
 1310: 	    $Apache::londefdef::table[-1]{'hinc'} = ''; 
 1311: 	    $Apache::londefdef::table[-1]{'vinc'} = '&'; 
 1312: 	    $Apache::londefdef::table[-1]{'vvinc'} = '';
 1313: 	}
 1314: 	my $width;
 1315: 	foreach my $key (keys(%{$token->[2]})) {
 1316: 	    if ($key =~ /^width$/i) {
 1317: 		$width = &Apache::lonxml::get_param($key,$parstack,$safeeval);
 1318: 	    }
 1319: 	}
 1320: 	if (defined($width)) { $Apache::londefdef::table[-1]{'width'}=$width; }
 1321:     }
 1322:     return $currentstring;
 1323: }
 1324:         sub end_table {
 1325: 	    my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
 1326:             my $currentstring = '';
 1327:             if ($target eq 'web') {
 1328:               $currentstring = $token->[2];     
 1329: 	    } elsif ($target eq 'tex') {
 1330: 		my $inmemory = '';
 1331: 		my $output = '';
 1332:                 #construct header of the table
 1333: 		my $header_of_table = '{'.$Apache::londefdef::table[-1]{'vvinc'};
 1334: 		my $in;
 1335: 		for ($in=0;$in<=$Apache::londefdef::table[-1]{'counter_columns'};$in++) {
 1336: 		    $header_of_table .= $Apache::londefdef::table[-1]{'columns'}[$in].$Apache::londefdef::table[-1]{'vvinc'};
 1337: 		}
 1338: 		$header_of_table .= '}';
 1339:                 #fill the table
 1340: 		for ($in=0;$in<=$Apache::londefdef::table[-1]{'row_number'};$in++) {
 1341: 		    $output .=  $Apache::londefdef::table[-1]{'rowdata'}[$in];
 1342: 		    chop $output;
 1343: 		    $output .= ' \\\\ ';
 1344: 		}
 1345:                 #define the length of the table cells
 1346: 		my @lengthforoutput = split(/,/,$Apache::londefdef::table[-1]{'lengthrow'}[0]);
 1347: 		my $how_many_columns = $#lengthforoutput + 1; #total number of columns in the table 
 1348: 		my $filled_columns = 0; #number of columns with information about width
 1349: 		my $available_space = ' ';
 1350: 		foreach my $tempo_length (@{ $Apache::londefdef::table[-1]{'lengthrow'} }) {
 1351: 		    my @length = split(/,/,$tempo_length);
 1352: 		    for (my $ico=0;$ico<=$#lengthforoutput;$ico++) {
 1353: 			$lengthforoutput[$ico] =~ m/(\d*\.?\d*)\s*(\w+)/;
 1354: 			my $old_value = $1;
 1355: 			my $old_unit = $2; 
 1356: 			if ($old_unit eq 'cm') { 
 1357: 			    $old_value = $old_value * 10;
 1358: 			} elsif ($old_unit eq 'in') { 
 1359: 			    $old_value = $old_value * 25.4;
 1360: 			} elsif ($old_unit eq 'pt') {
 1361: 			    $old_value = $old_value * 25.4/72.27;
 1362: 			} elsif ($old_unit eq 'pc') {
 1363: 			    $old_value = $old_value * 25.4/6.022;
 1364: 			}
 1365: 			$old_unit = 'mm';
 1366:  			$length[$ico] =~ m/(\d*\.?\d*)\s*(\w+)/;
 1367: 			my $new_value = $1;
 1368: 			my $new_unit = $2;
 1369: 			if ($new_unit eq 'cm') { 
 1370: 			    $new_value = $new_value * 10;
 1371: 			} elsif ($old_unit eq 'in') { 
 1372: 			    $new_value = $new_value * 25.4;
 1373: 			} elsif ($old_unit eq 'pt') {
 1374: 			    $new_value = $new_value * 25.4/72.27;
 1375: 			} elsif ($old_unit eq 'pc') {
 1376: 			    $new_value = $new_value * 25.4/6.022;
 1377: 			}
 1378: 			$new_unit = 'mm';
 1379: 			if ($old_value < $new_value) {
 1380: 			    $lengthforoutput[$ico] = $new_value.' mm';
 1381: 			} else {
 1382: 			    $lengthforoutput[$ico] = $old_value.' mm';
 1383: 			}		 
 1384: 		    }
 1385: 		}
 1386: 		for (my $ico=0;$ico<=$#lengthforoutput;$ico++) {
 1387: 		    if (not $lengthforoutput[$ico]=~m/^\s*0\s*\w*\s*$/) {
 1388: 			$filled_columns++;
 1389: 			$available_space = $available_space.' - '.$lengthforoutput[$ico];
 1390: 		    }
 1391: 		}
 1392: 		my $temp_file;
 1393: 		my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.tbl";
 1394: 		if (-e $filename) {
 1395: 		    $temp_file = Apache::File->new($filename); 
 1396: 		    my @tbl_file_content = <$temp_file>;
 1397: 		    my ($one,$two,$three) = split(/,/,$tbl_file_content[0]);
 1398: 		        $how_many_columns+=$one-1;
 1399: 		        $filled_columns+=$two;
 1400: 		    if($three=~/\S/) {$available_space = $available_space.' - '.$three;}
 1401: 		} else {
 1402: 		    $temp_file = Apache::File->new('>>'.$filename); 
 1403: 		}		
 1404: 		print $temp_file "$how_many_columns,$filled_columns,$available_space\n";
 1405: 		$output =~ s/\\parbox{TOBECHANGEDONNUMBER}{}/\\parbox{1 mm}{}/g;
 1406: 		$output =~ s/\\parbox{TOBECHANGEDONNUMBER}/\\parbox{\$SpacePerColumn}/g;
 1407: 		my @tagar = @$tagstack;
 1408: 		my $signature = 1;
 1409: 		for (my $ico=0;$ico<$#tagar;$ico++) {
 1410: 		     if ($tagar[$ico] eq 'table') { $signature = 0; }
 1411: 		}
 1412: 		if ($signature) {
 1413: 		    my $NumberEmptyLength = $how_many_columns - $filled_columns;		
 1414: 		    my $SpacePerColumn = '(\textwidth '.$available_space.')/'.$NumberEmptyLength;
 1415: 		    $output =~ s/\$SpacePerColumn/$SpacePerColumn/g;
 1416: 		}	
 1417: 		$Apache::londefdef::table[-1]{'output'} .= $header_of_table.$output.$Apache::londefdef::table[-1]{'hinc'}.'\end{tabular}\vskip 0 mm ';
 1418: 		if ($#Apache::londefdef::table > 0) {
 1419: 		    $inmemory = $Apache::londefdef::table[-1]{'output'};
 1420: 		    pop @Apache::londefdef::table;
 1421: 		    $Apache::londefdef::table[-1]{'rowdata'}[$Apache::londefdef::table[-1]{'row_number'}] .= $inmemory
 1422: 		} else {
 1423: 		    $currentstring = $Apache::londefdef::table[-1]{'output'};
 1424: 		    $currentstring =~ s/\\\\\s+\\\\/\\\\/g; 
 1425: 		    pop @Apache::londefdef::table;
 1426: 		    if (-e $filename) {
 1427: 			unlink $filename;
 1428: 		    }
 1429: 		}
 1430: 	    }
 1431: 	   return $currentstring;
 1432: 	}
 1433: #-- <tr> tag
 1434:         sub start_tr {
 1435: 	    my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
 1436:             my $currentstring = '';
 1437:             if ($target eq 'web') {
 1438:               $currentstring = $token->[4];     
 1439: 	    } elsif ($target eq 'tex') {
 1440: 		$Apache::londefdef::table[-1]{'row_number'}++;
 1441: 		my $alignchar = substr(&Apache::lonxml::get_param('align',$parstack,$safeeval),0,1);
 1442: 		if ($alignchar ne '') {
 1443: 		    push @ {$Apache::londefdef::table[-1]{'rows'} }, $alignchar;
 1444: 		} else {
 1445: 		    push @ {$Apache::londefdef::table[-1]{'rows'} }, 'l';
 1446: 		}
 1447: 		push ( @{ $Apache::londefdef::table[-1]{'rowdata'} }, $Apache::londefdef::table[-1]{'hinc'});
 1448: 		$Apache::londefdef::table[-1]{'counter_columns'} = -1;
 1449: 		$Apache::londefdef::table[-1]{'length'} = ''; 
 1450: 	    } 
 1451: 	   return $currentstring;
 1452: 	}        
 1453:         sub end_tr {
 1454: 	    my ($target,$token) = @_;
 1455:             my $currentstring = '';
 1456:             if ($target eq 'web') {
 1457: 		$currentstring = $token->[2];     
 1458: 	    } elsif ($target eq 'tex') {
 1459: 		push @{ $Apache::londefdef::table[-1]{'lengthrow'} },$Apache::londefdef::table[-1]{'length'};
 1460: 
 1461: 	    }
 1462: 	   return $currentstring;
 1463: 	}
 1464: #-- <td> tag
 1465:         sub start_td {
 1466: 	    my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
 1467:             my $currentstring = '';
 1468:             if ($target eq 'web') {
 1469:               $currentstring = $token->[4];     
 1470:     } elsif ($target eq 'tex') {
 1471: 		my $what_to_push = substr(&Apache::lonxml::get_param('align',$parstack,$safeeval),0,1);
 1472: 		if ($what_to_push eq '') {
 1473: 		    $what_to_push = substr($Apache::londefdef::table[-1]{'rows'}[0],0,1);;
 1474: 		}
 1475: 		    push @{ $Apache::londefdef::table[-1]{'columns'} }, $what_to_push;
 1476: 		$Apache::londefdef::table[-1]{'counter_columns'}++;
 1477: 		&Apache::lonxml::startredirection();
 1478: ;
 1479: 	    } 
 1480: 	   return $currentstring;
 1481: 	}        
 1482:         sub end_td {
 1483: 	    my ($target,$token) = @_;
 1484:             my $currentstring = '';
 1485:             my $tempolen = '';
 1486:             if ($target eq 'web') {
 1487: 		$currentstring = $token->[2];     
 1488: 	    } elsif ($target eq 'tex') {
 1489: 		my $current_row = $Apache::londefdef::table[-1]{'row_number'};
 1490: 		my $data=&Apache::lonxml::endredirection();
 1491: 		if ($data=~m/width\s*=\s*(\d+\.?\d*\s*(mm|cm|in|pc|pt))/) {                 
 1492:                     $Apache::londefdef::table[-1]{'length'} .= $1.',';
 1493: 		    $tempolen = $1;         
 1494: 		} else {
 1495: 		    if (length($data)<5) {
 1496: 			$Apache::londefdef::table[-1]{'length'} .= '0 mm,';
 1497: 			$tempolen = '5 mm';
 1498: 		    } else {
 1499: 			$Apache::londefdef::table[-1]{'length'} .= '0 mm,';
 1500: 			$tempolen = 'TOBECHANGEDONNUMBER';
 1501: 		    }
 1502:                 }                                        
 1503: 		@{ $Apache::londefdef::table[-1]{'rowdata'} }[$current_row] .= '\parbox{'.$tempolen.'}{'.$data.'} '.$Apache::londefdef::table[-1]{'vinc'};
 1504: 	    }
 1505: 	   return $currentstring;
 1506: 	}
 1507: #-- <th> tag
 1508:         sub start_th {
 1509: 	    my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
 1510:             my $currentstring = '';
 1511:             if ($target eq 'web') {
 1512:               $currentstring = $token->[4];     
 1513: 	    } elsif ($target eq 'tex') {
 1514: 		my $what_to_push = substr(&Apache::lonxml::get_param('align',$parstack,$safeeval),0,1);
 1515: 		if ($what_to_push eq '') {
 1516: 		    $what_to_push = substr($Apache::londefdef::table[-1]{'rows'}[0],0,1);;
 1517: 		}
 1518: 		    push @{ $Apache::londefdef::table[-1]{'columns'} }, $what_to_push;
 1519: 		$Apache::londefdef::table[-1]{'counter_columns'}++;
 1520: 		&Apache::lonxml::startredirection();
 1521: ;
 1522: 	    } 
 1523: 	   return $currentstring;
 1524: 	}        
 1525:         sub end_th {
 1526: 	    my ($target,$token) = @_;
 1527:             my $currentstring = '';
 1528:             if ($target eq 'web') {
 1529: 		$currentstring = $token->[2];     
 1530: 	    } elsif ($target eq 'tex') {
 1531: 		my $current_row = $Apache::londefdef::table[-1]{'row_number'};
 1532: 		my $data=&Apache::lonxml::endredirection();
 1533: 		if ($data=~m/width\s*=\s*(\d+\.*\d*\s*(mm|cm))/) {                 
 1534:                     $Apache::londefdef::table[-1]{'length'} .= $1.',';             
 1535: 		} else {
 1536: 		    $Apache::londefdef::table[-1]{'length'} .= '0 mm,'; 
 1537:                 }                                                           
 1538: 		@{ $Apache::londefdef::table[-1]{'rowdata'} }[$current_row] .= '\parbox{'.$1.'}{\textbf{'.$data.'}} '.$Apache::londefdef::table[-1]{'vinc'};
 1539: 	    }
 1540: 	   return $currentstring;
 1541: 	}
 1542: #-- <img> tag
 1543:         sub start_img {
 1544: 	    my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
 1545:             $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=
 1546:                                         $token->[2]->{'src'};
 1547:             my $currentstring = '';
 1548: 	    my $width_param = '';
 1549: 	    my $height_param = '';
 1550: 	    my $scaling = .3;
 1551: 
 1552: 	    if ($target eq 'web') {
 1553:               $currentstring = $token->[4];     
 1554: 	    } elsif ($target eq 'tex') {
 1555: 		my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval);
 1556: 		if (not -e '/home/httpd/html'.$src) {
 1557: 		    #replicates image itself
 1558: 		    &Apache::lonnet::repcopy('/home/httpd/html'.$src);
 1559: 		    #replicates eps or ps 
 1560: 		    my $newsrc = $src;
 1561: 		    $newsrc =~ s/(.gif|.jpg)$/.eps/;
 1562: 		    if (not-e $newsrc && &Apache::lonnet::repcopy('/home/httpd/html'.$newsrc) ne 'OK') {
 1563: 			$newsrc =~ s/\.ps$/\.eps/;
 1564: 			&Apache::lonnet::repcopy('/home/httpd/html'.$newsrc);
 1565: 		    }
 1566: 		}
 1567: 	      $src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src);
 1568:               #if original gif/jpg file exist do following:
 1569:               if (-e $src) {          
 1570:                   #defines the default size of image
 1571: 		  my $image = Image::Magick->new;
 1572: 		  my $current_figure = $image->Read($src);
 1573: 		  $width_param = $image->Get('width') * $scaling;;
 1574: 		  $height_param = $image->Get('height') * $scaling;;
 1575: 		  undef $image;
 1576: 		  #do we have any specified size of the picture?
 1577: 		  my $TeXwidth = &Apache::lonxml::get_param('TeXwidth',$parstack,$safeeval); 
 1578: 		  my $TeXheight = &Apache::lonxml::get_param('TeXheight',$parstack,$safeeval); 
 1579: 		  my $width = &Apache::lonxml::get_param('width',$parstack,$safeeval);
 1580: 		  if ($TeXwidth ne '') {  
 1581: 		      if ($TeXwidth=~/(\d+)\s*\%/) {
 1582: 			  $width_param = $1*$ENV{'form.textwidth'}/100;
 1583: 		      } else { 
 1584: 			  $width_param = $TeXwidth;
 1585: 		      }
 1586: 		  } elsif ($TeXheight ne '') {
 1587: 			  $width_param = $TeXheight/$height_param*$width_param;
 1588: 		  } elsif ($width ne '') {
 1589: 		      $width_param = $width*$scaling;      
 1590: 		  }
 1591: 		  my $file;
 1592: 		  my $path;	
 1593: 		  if ($src =~ m!(.*)/([^/]*)$!) {
 1594: 		      $file = $2; 
 1595: 		      $path = $1.'/'; 
 1596: 		  } 
 1597: 		  my $newsrc = $src;
 1598: 		  $newsrc =~ s/(\.gif|\.jpg)$/\.eps/i;
 1599: 		  $file=~s/(\.gif|\.jpg)$/\.eps/i;
 1600: 		  #where can we find the picture?
 1601: 		  if (-e $newsrc) {
 1602:                       #eps counterpart for image exist 
 1603: 		      if ($path) {
 1604: 			  $currentstring .= '\noindent\graphicspath{{'.$path.'}}\fbox{\includegraphics[width='.$width_param.' mm]{'.$file.'}} ';
 1605: 		      }
 1606: 		  } else {
 1607:                       #there is no eps counterpart for image - check for ps one
 1608: 		      $newsrc =~ s/\.eps$/\.ps/;
 1609: 		      if (-e $newsrc) {
 1610: 			  #ps counterpart for image exist 
 1611: 			  $file =~ s/\.eps$/\.ps/;
 1612: 			  if ($path) {
 1613: 			      $currentstring .= '\noindent\graphicspath{{'.$path.'}}\fbox{\includegraphics[width='.$width_param.' mm]{'.$file.'}} ';
 1614: 			  }
 1615: 		      } else {
 1616: 			  #there aren't eps or ps - so create eps 
 1617: 			  my $temp_file;
 1618: 			  my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.dat";
 1619: 			  $temp_file = Apache::File->new('>>'.$filename); 
 1620: 			  print $temp_file "$src\n";
 1621: 			  $currentstring .= '\graphicspath{{/home/httpd/prtspool/}}\fbox{\includegraphics[width='.$width_param.' mm]{'.$file.'}} ';
 1622: 		      }
 1623: 		  }
 1624: 	      } else {
 1625: 		  #original image file doesn't exist so check the alt attribute
 1626: 		  my $alt = &Apache::lonxml::get_param('alt',$parstack,$safeeval);
 1627:                   if ($alt) {
 1628: 		      $currentstring .= ' '.$alt.' ';
 1629: 		  } else {
 1630:                      #<allow> tag will care about replication 
 1631: 		  }
 1632: 	      }
 1633: 	    }
 1634: 	    return $currentstring;
 1635: 	}
 1636:         sub end_img {
 1637: 	    my ($target,$token) = @_;
 1638:             my $currentstring = '';
 1639:             if ($target eq 'web') {
 1640:               $currentstring = $token->[2];
 1641: 	    } elsif ($target eq 'tex') {
 1642:               $currentstring = '';
 1643: 	    }
 1644: 	   return $currentstring;
 1645: 	}
 1646: #-- <applet> tag
 1647: 
 1648:         sub start_applet {
 1649: 	    my ($target,$token) = @_;
 1650:               $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=   
 1651:                                         $token->[2]->{'code'};
 1652:               $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=
 1653:                                         $token->[2]->{'archive'};
 1654:             my $currentstring = '';
 1655:             if ($target eq 'web') {
 1656:               $currentstring = $token->[4];
 1657: 	    } elsif ($target eq 'tex') {
 1658:               $currentstring = " \\begin{figure} ";
 1659: 	    } 
 1660: 	   return $currentstring;
 1661: 	}
 1662: sub end_applet {
 1663:     my ($target,$token) = @_;
 1664:     my $currentstring = '';
 1665:     if ($target eq 'web') {
 1666: 	$currentstring = $token->[2];
 1667:     } elsif ($target eq 'tex') {
 1668: 	$currentstring = " \\end{figure}";
 1669:     } 
 1670:     return $currentstring;
 1671: }
 1672: 
 1673: #-- <embed> tag
 1674: 
 1675: sub start_embed {    
 1676:     my ($target,$token) = @_;
 1677:     $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=
 1678: 	$token->[2]->{'src'};
 1679:     my $currentstring = '';
 1680:     if ($target eq 'web') {
 1681: 	$currentstring = $token->[4];
 1682:     } elsif ($target eq 'tex') {
 1683: 	$currentstring = " \\begin{figure} ";  
 1684:     } 
 1685:     return $currentstring;
 1686: }
 1687:         sub end_embed {
 1688: 	    my ($target,$token) = @_;
 1689:             my $currentstring = '';
 1690:             if ($target eq 'web') {
 1691:               $currentstring = $token->[2];     
 1692: 	    } elsif ($target eq 'tex') {
 1693:               $currentstring = " \\end{figure}";  
 1694: 	    } 
 1695: 	   return $currentstring;
 1696: 	}
 1697: 
 1698: #-- <param> tag
 1699: 
 1700:         sub start_param {
 1701: 	    my ($target,$token) = @_;
 1702: 	    if ($token->[2]->{'name'} eq 'cabbase') {
 1703:                       $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=
 1704: 					     $token->[2]->{'value'};
 1705:             }   
 1706:             $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=   
 1707:                                         $token->[2]->{'src'};
 1708:             my $currentstring = '';
 1709:             if ($target eq 'web') {
 1710:               $currentstring = $token->[4];     
 1711: 	    } elsif ($target eq 'tex') {
 1712:               $currentstring = " \\begin{figure} ";  
 1713: 	    } 
 1714: 	   return $currentstring;
 1715: 	}
 1716:         sub end_param {
 1717: 	    my ($target,$token) = @_;
 1718:             my $currentstring = '';
 1719:             if ($target eq 'web') {
 1720:               $currentstring = $token->[2];     
 1721: 	    } elsif ($target eq 'tex') {
 1722:               $currentstring = " \\end{figure}";  
 1723: 	    } 
 1724: 	   return $currentstring;
 1725: 	}
 1726: #-- <allow> tag
 1727:         sub start_allow {
 1728: 	    my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;	  
 1729:             $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=   
 1730:                                         $token->[2]->{'src'};
 1731: 	    my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval);
 1732: 	    if (not -e '/home/httpd/html'.$src) {
 1733:             #replicates image itself
 1734: 		&Apache::lonnet::repcopy('/home/httpd/html'.$src);
 1735: 	        #replicates eps or ps 
 1736: 		my $newsrc = $src;
 1737: 		$newsrc =~ s/(.gif|.jpg)$/.eps/;
 1738:  		if (not-e $newsrc && &Apache::lonnet::repcopy('/home/httpd/html'.$newsrc) ne 'OK') {
 1739: 		    $newsrc =~ s/\.ps$/\.eps/;
 1740: 		    &Apache::lonnet::repcopy('/home/httpd/html'.$newsrc);
 1741: 		}
 1742: 	    }
 1743: 	    return '';
 1744: 	}
 1745:         sub end_allow {
 1746: 	   return '';
 1747: 	}
 1748: #-- Frames
 1749: 	sub start_frameset {
 1750: 	  my ($target,$token) = @_;
 1751: 	  my $currentstring = '';
 1752: 	  if ($target eq 'web') { 
 1753: 	    if (!$Apache::lonxml::registered) {
 1754: 	      $currentstring.='<head>'.
 1755: 		  &Apache::lonxml::registerurl(undef,$target).'</head>';
 1756: 	    }
 1757: 	    $currentstring .= $token->[4];
 1758: 	  }
 1759: 	  return $currentstring;
 1760: 	}
 1761:         sub end_frameset {
 1762: 	  my ($target,$token) = @_;
 1763: 	  my $currentstring = '';
 1764: 	  if ($target eq 'web') {
 1765: 	    $currentstring = $token->[2];
 1766: 	  }
 1767: 	  return $currentstring;
 1768: 	}
 1769: #-- <pre>
 1770: 	sub start_pre {
 1771: 	    my ($target,$token) = @_;
 1772:             my $currentstring = '';
 1773:             if ($target eq 'web') {
 1774: 	       $currentstring .= $token->[4];
 1775: 	    } elsif ($target eq 'tex') {
 1776: 		$currentstring .= '\begin{verbatim}';
 1777: 	    } 
 1778:            return $currentstring;
 1779: 	}
 1780:         sub end_pre {
 1781: 	    my ($target,$token) = @_;
 1782:             my $currentstring = '';
 1783:             if ($target eq 'web') {
 1784: 	       $currentstring .= $token->[2];
 1785: 	    } elsif ($target eq 'tex') {
 1786: 		$currentstring .= '\end{verbatim}';
 1787: 	    }
 1788:            return $currentstring;
 1789: 	}
 1790: #-- <insert>
 1791: 	sub start_insert {
 1792: 	    my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
 1793:             my $currentstring = '';
 1794:             if ($target eq 'web') {
 1795: 		my $display = &Apache::lonxml::get_param('display',$parstack,$safeeval);
 1796: 	       $currentstring .= '<b>'.$display.'</b>';;
 1797: 	    }
 1798:            return $currentstring;
 1799: 	}
 1800:         sub end_insert {
 1801: 	    my ($target,$token) = @_;
 1802:             my $currentstring = '';
 1803:             if ($target eq 'web') {
 1804: 	       $currentstring .= '';
 1805: 	    }
 1806:            return $currentstring;
 1807: 	}
 1808: #-- <externallink>
 1809: 	sub start_externallink {
 1810: 	    my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
 1811:             my $currentstring = '';
 1812:             if ($target eq 'web') {
 1813: 		my $display = &Apache::lonxml::get_param('display',$parstack,$safeeval);
 1814: 	       $currentstring .= '<b>'.$display.'</b>';;
 1815: 	    }
 1816:            return $currentstring;
 1817: 	}
 1818:         sub end_externallink {
 1819: 	    my ($target,$token) = @_;
 1820:             my $currentstring = '';
 1821:             if ($target eq 'web') {
 1822: 	       $currentstring .= '';
 1823: 	    }
 1824:            return $currentstring;
 1825: 	}
 1826: #-- <blankspace heigth="">
 1827:         sub start_blankspace {
 1828: 	    my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
 1829:             my $currentstring = '';
 1830:             if ($target eq 'tex') {
 1831: 		my $howmuch = &Apache::lonxml::get_param('heigth',$parstack,$safeeval);
 1832: 		$currentstring .= '\vskip '.$howmuch.' ';
 1833: 	    }
 1834:            return $currentstring;
 1835: 	}
 1836:         sub end_blankspace {
 1837: 	    my ($target,$token) = @_;
 1838:             my $currentstring = '';
 1839:             if ($target eq 'tex') {
 1840: 	       $currentstring .= '';
 1841: 	    }
 1842:            return $currentstring;
 1843: 	}
 1844: #-- <abbr> tag
 1845:       sub start_abbr {
 1846: 	    my ($target,$token) = @_;
 1847:             my $currentstring = '';
 1848:             if ($target eq 'web') {
 1849:               $currentstring = $token->[4];     
 1850: 	    } 
 1851: 	   return $currentstring;
 1852: 	}
 1853:         sub end_abbr {
 1854: 	    my ($target,$token) = @_;
 1855:             my $currentstring = '';
 1856:             if ($target eq 'web') {
 1857:               $currentstring = $token->[2];    
 1858:             } 
 1859: 	   return $currentstring;
 1860: 	}
 1861: #-- <acronym> tag
 1862:       sub start_acronym {
 1863: 	    my ($target,$token) = @_;
 1864:             my $currentstring = '';
 1865:             if ($target eq 'web') {
 1866:               $currentstring = $token->[4];     
 1867: 	    } 
 1868: 	   return $currentstring;
 1869: 	}
 1870:         sub end_acronym {
 1871: 	    my ($target,$token) = @_;
 1872:             my $currentstring = '';
 1873:             if ($target eq 'web') {
 1874:               $currentstring = $token->[2];    
 1875:             } 
 1876: 	   return $currentstring;
 1877: 	}
 1878: #-- <area> tag
 1879:       sub start_area {
 1880: 	    my ($target,$token) = @_;
 1881:             my $currentstring = '';
 1882:             if ($target eq 'web') {
 1883:               $currentstring = $token->[4];     
 1884: 	    } 
 1885: 	   return $currentstring;
 1886: 	}
 1887:         sub end_area {
 1888: 	    my ($target,$token) = @_;
 1889:             my $currentstring = '';
 1890:             if ($target eq 'web') {
 1891:               $currentstring = $token->[2];    
 1892:             } 
 1893: 	   return $currentstring;
 1894: 	}
 1895: #-- <base> tag
 1896:       sub start_base {
 1897: 	    my ($target,$token) = @_;
 1898:             my $currentstring = '';
 1899:             if ($target eq 'web') {
 1900:               $currentstring = $token->[4];     
 1901: 	    } 
 1902: 	   return $currentstring;
 1903: 	}
 1904:         sub end_base {
 1905: 	    my ($target,$token) = @_;
 1906:             my $currentstring = '';
 1907:             if ($target eq 'web') {
 1908:               $currentstring = $token->[2];    
 1909:             } 
 1910: 	   return $currentstring;
 1911: 	}
 1912: #-- <bdo> tag
 1913:       sub start_bdo {
 1914: 	    my ($target,$token) = @_;
 1915:             my $currentstring = '';
 1916:             if ($target eq 'web') {
 1917:               $currentstring = $token->[4];     
 1918: 	    } 
 1919: 	   return $currentstring;
 1920: 	}
 1921:         sub end_bdo {
 1922: 	    my ($target,$token) = @_;
 1923:             my $currentstring = '';
 1924:             if ($target eq 'web') {
 1925:               $currentstring = $token->[2];    
 1926:             } 
 1927: 	   return $currentstring;
 1928: 	}
 1929: #-- <bgsound> tag
 1930:       sub start_bgsound {
 1931: 	    my ($target,$token) = @_;
 1932:             my $currentstring = '';
 1933:             if ($target eq 'web') {
 1934:               $currentstring = $token->[4];     
 1935: 	    } 
 1936: 	   return $currentstring;
 1937: 	}
 1938:         sub end_bgsound {
 1939: 	    my ($target,$token) = @_;
 1940:             my $currentstring = '';
 1941:             if ($target eq 'web') {
 1942:               $currentstring = $token->[2];    
 1943:             } 
 1944: 	   return $currentstring;
 1945: 	}
 1946: #-- <blink> tag
 1947:       sub start_blink {
 1948: 	    my ($target,$token) = @_;
 1949:             my $currentstring = '';
 1950:             if ($target eq 'web') {
 1951:               $currentstring = $token->[4];     
 1952: 	    } 
 1953: 	   return $currentstring;
 1954: 	}
 1955:         sub end_blink {
 1956: 	    my ($target,$token) = @_;
 1957:             my $currentstring = '';
 1958:             if ($target eq 'web') {
 1959:               $currentstring = $token->[2];    
 1960:             } 
 1961: 	   return $currentstring;
 1962: 	}
 1963: #-- <blockquote> tag
 1964:       sub start_blockquote {
 1965: 	    my ($target,$token) = @_;
 1966:             my $currentstring = '';
 1967:             if ($target eq 'web') {
 1968:               $currentstring = $token->[4];     
 1969: 	    } 
 1970: 	   return $currentstring;
 1971: 	}
 1972:         sub end_blockquote {
 1973: 	    my ($target,$token) = @_;
 1974:             my $currentstring = '';
 1975:             if ($target eq 'web') {
 1976:               $currentstring = $token->[2];    
 1977:             } 
 1978: 	   return $currentstring;
 1979: 	}
 1980: #-- <button> tag
 1981:       sub start_button {
 1982: 	    my ($target,$token) = @_;
 1983:             my $currentstring = '';
 1984:             if ($target eq 'web') {
 1985:               $currentstring = $token->[4];     
 1986: 	    } 
 1987: 	   return $currentstring;
 1988: 	}
 1989:         sub end_button {
 1990: 	    my ($target,$token) = @_;
 1991:             my $currentstring = '';
 1992:             if ($target eq 'web') {
 1993:               $currentstring = $token->[2];    
 1994:             } 
 1995: 	   return $currentstring;
 1996: 	}
 1997: #-- <caption> tag
 1998:       sub start_caption {
 1999: 	    my ($target,$token) = @_;
 2000:             my $currentstring = '';
 2001:             if ($target eq 'web') {
 2002:               $currentstring = $token->[4];     
 2003: 	    } 
 2004: 	   return $currentstring;
 2005: 	}
 2006:         sub end_caption {
 2007: 	    my ($target,$token) = @_;
 2008:             my $currentstring = '';
 2009:             if ($target eq 'web') {
 2010:               $currentstring = $token->[2];    
 2011:             } 
 2012: 	   return $currentstring;
 2013: 	}
 2014: #-- <col> tag
 2015:       sub start_col {
 2016: 	    my ($target,$token) = @_;
 2017:             my $currentstring = '';
 2018:             if ($target eq 'web') {
 2019:               $currentstring = $token->[4];     
 2020: 	    } 
 2021: 	   return $currentstring;
 2022: 	}
 2023:         sub end_col {
 2024: 	    my ($target,$token) = @_;
 2025:             my $currentstring = '';
 2026:             if ($target eq 'web') {
 2027:               $currentstring = $token->[2];    
 2028:             } 
 2029: 	   return $currentstring;
 2030: 	}
 2031: #-- <colgroup> tag
 2032:       sub start_colgroup {
 2033: 	    my ($target,$token) = @_;
 2034:             my $currentstring = '';
 2035:             if ($target eq 'web') {
 2036:               $currentstring = $token->[4];     
 2037: 	    } 
 2038: 	   return $currentstring;
 2039: 	}
 2040:         sub end_colgroup {
 2041: 	    my ($target,$token) = @_;
 2042:             my $currentstring = '';
 2043:             if ($target eq 'web') {
 2044:               $currentstring = $token->[2];    
 2045:             } 
 2046: 	   return $currentstring;
 2047: 	}
 2048: #-- <del> tag
 2049:       sub start_del {
 2050: 	    my ($target,$token) = @_;
 2051:             my $currentstring = '';
 2052:             if ($target eq 'web') {
 2053:               $currentstring = $token->[4];     
 2054: 	    } 
 2055: 	   return $currentstring;
 2056: 	}
 2057:         sub end_del {
 2058: 	    my ($target,$token) = @_;
 2059:             my $currentstring = '';
 2060:             if ($target eq 'web') {
 2061:               $currentstring = $token->[2];    
 2062:             } 
 2063: 	   return $currentstring;
 2064: 	}
 2065: #-- <fieldset> tag
 2066:       sub start_fieldset {
 2067: 	    my ($target,$token) = @_;
 2068:             my $currentstring = '';
 2069:             if ($target eq 'web') {
 2070:               $currentstring = $token->[4];     
 2071: 	    } 
 2072: 	   return $currentstring;
 2073: 	}
 2074:         sub end_fieldset {
 2075: 	    my ($target,$token) = @_;
 2076:             my $currentstring = '';
 2077:             if ($target eq 'web') {
 2078:               $currentstring = $token->[2];    
 2079:             } 
 2080: 	   return $currentstring;
 2081: 	}
 2082: #-- <frame> tag
 2083:       sub start_frame {
 2084: 	    my ($target,$token) = @_;
 2085:             my $currentstring = '';
 2086:             if ($target eq 'web') {
 2087:               $currentstring = $token->[4];     
 2088: 	    } 
 2089: 	   return $currentstring;
 2090: 	}
 2091:         sub end_frame {
 2092: 	    my ($target,$token) = @_;
 2093:             my $currentstring = '';
 2094:             if ($target eq 'web') {
 2095:               $currentstring = $token->[2];    
 2096:             } 
 2097: 	   return $currentstring;
 2098: 	}
 2099: #-- <iframe> tag
 2100:       sub start_iframe {
 2101: 	    my ($target,$token) = @_;
 2102:             my $currentstring = '';
 2103:             if ($target eq 'web') {
 2104:               $currentstring = $token->[4];     
 2105: 	    } 
 2106: 	   return $currentstring;
 2107: 	}
 2108:         sub end_iframe {
 2109: 	    my ($target,$token) = @_;
 2110:             my $currentstring = '';
 2111:             if ($target eq 'web') {
 2112:               $currentstring = $token->[2];    
 2113:             } 
 2114: 	   return $currentstring;
 2115: 	}
 2116: #-- <ins> tag
 2117:       sub start_ins {
 2118: 	    my ($target,$token) = @_;
 2119:             my $currentstring = '';
 2120:             if ($target eq 'web') {
 2121:               $currentstring = $token->[4];     
 2122: 	    } 
 2123: 	   return $currentstring;
 2124: 	}
 2125:         sub end_ins {
 2126: 	    my ($target,$token) = @_;
 2127:             my $currentstring = '';
 2128:             if ($target eq 'web') {
 2129:               $currentstring = $token->[2];    
 2130:             } 
 2131: 	   return $currentstring;
 2132: 	}
 2133: #-- <isindex> tag
 2134:       sub start_isindex {
 2135: 	    my ($target,$token) = @_;
 2136:             my $currentstring = '';
 2137:             if ($target eq 'web') {
 2138:               $currentstring = $token->[4];     
 2139: 	    } 
 2140: 	   return $currentstring;
 2141: 	}
 2142:         sub end_isindex {
 2143: 	    my ($target,$token) = @_;
 2144:             my $currentstring = '';
 2145:             if ($target eq 'web') {
 2146:               $currentstring = $token->[2];    
 2147:             } 
 2148: 	   return $currentstring;
 2149: 	}
 2150: #-- <keygen> tag
 2151:       sub start_keygen {
 2152: 	    my ($target,$token) = @_;
 2153:             my $currentstring = '';
 2154:             if ($target eq 'web') {
 2155:               $currentstring = $token->[4];     
 2156: 	    } 
 2157: 	   return $currentstring;
 2158: 	}
 2159:         sub end_keygen {
 2160: 	    my ($target,$token) = @_;
 2161:             my $currentstring = '';
 2162:             if ($target eq 'web') {
 2163:               $currentstring = $token->[2];    
 2164:             } 
 2165: 	   return $currentstring;
 2166: 	}
 2167: #-- <label> tag
 2168:       sub start_label {
 2169: 	    my ($target,$token) = @_;
 2170:             my $currentstring = '';
 2171:             if ($target eq 'web') {
 2172:               $currentstring = $token->[4];     
 2173: 	    } 
 2174: 	   return $currentstring;
 2175: 	}
 2176:         sub end_label {
 2177: 	    my ($target,$token) = @_;
 2178:             my $currentstring = '';
 2179:             if ($target eq 'web') {
 2180:               $currentstring = $token->[2];    
 2181:             } 
 2182: 	   return $currentstring;
 2183: 	}
 2184: #-- <layer> tag
 2185:       sub start_layer {
 2186: 	    my ($target,$token) = @_;
 2187:             my $currentstring = '';
 2188:             if ($target eq 'web') {
 2189:               $currentstring = $token->[4];     
 2190: 	    } 
 2191: 	   return $currentstring;
 2192: 	}
 2193:         sub end_layer {
 2194: 	    my ($target,$token) = @_;
 2195:             my $currentstring = '';
 2196:             if ($target eq 'web') {
 2197:               $currentstring = $token->[2];    
 2198:             } 
 2199: 	   return $currentstring;
 2200: 	}
 2201: #-- <legend> tag
 2202:       sub start_legend {
 2203: 	    my ($target,$token) = @_;
 2204:             my $currentstring = '';
 2205:             if ($target eq 'web') {
 2206:               $currentstring = $token->[4];     
 2207: 	    } 
 2208: 	   return $currentstring;
 2209: 	}
 2210:         sub end_legend {
 2211: 	    my ($target,$token) = @_;
 2212:             my $currentstring = '';
 2213:             if ($target eq 'web') {
 2214:               $currentstring = $token->[2];    
 2215:             } 
 2216: 	   return $currentstring;
 2217: 	}
 2218: #-- <link> tag
 2219:       sub start_link {
 2220: 	    my ($target,$token) = @_;
 2221:             my $currentstring = '';
 2222:             if ($target eq 'web') {
 2223:               $currentstring = $token->[4];     
 2224: 	    } 
 2225: 	   return $currentstring;
 2226: 	}
 2227:         sub end_link {
 2228: 	    my ($target,$token) = @_;
 2229:             my $currentstring = '';
 2230:             if ($target eq 'web') {
 2231:               $currentstring = $token->[2];    
 2232:             } 
 2233: 	   return $currentstring;
 2234: 	}
 2235: #-- <marquee> tag
 2236:       sub start_marquee {
 2237: 	    my ($target,$token) = @_;
 2238:             my $currentstring = '';
 2239:             if ($target eq 'web') {
 2240:               $currentstring = $token->[4];     
 2241: 	    } 
 2242: 	   return $currentstring;
 2243: 	}
 2244:         sub end_marquee {
 2245: 	    my ($target,$token) = @_;
 2246:             my $currentstring = '';
 2247:             if ($target eq 'web') {
 2248:               $currentstring = $token->[2];    
 2249:             } 
 2250: 	   return $currentstring;
 2251: 	}
 2252: #-- <malticol> tag
 2253:       sub start_malticol {
 2254: 	    my ($target,$token) = @_;
 2255:             my $currentstring = '';
 2256:             if ($target eq 'web') {
 2257:               $currentstring = $token->[4];     
 2258: 	    } 
 2259: 	   return $currentstring;
 2260: 	}
 2261:         sub end_malticol {
 2262: 	    my ($target,$token) = @_;
 2263:             my $currentstring = '';
 2264:             if ($target eq 'web') {
 2265:               $currentstring = $token->[2];    
 2266:             } 
 2267: 	   return $currentstring;
 2268: 	}
 2269: #-- <nobr> tag
 2270:       sub start_nobr {
 2271: 	    my ($target,$token) = @_;
 2272:             my $currentstring = '';
 2273:             if ($target eq 'web') {
 2274:               $currentstring = $token->[4];     
 2275: 	    } 
 2276: 	   return $currentstring;
 2277: 	}
 2278:         sub end_nobr {
 2279: 	    my ($target,$token) = @_;
 2280:             my $currentstring = '';
 2281:             if ($target eq 'web') {
 2282:               $currentstring = $token->[2];    
 2283:             } 
 2284: 	   return $currentstring;
 2285: 	}
 2286: #-- <noembed> tag
 2287:       sub start_noembed {
 2288: 	    my ($target,$token) = @_;
 2289:             my $currentstring = '';
 2290:             if ($target eq 'web') {
 2291:               $currentstring = $token->[4];     
 2292: 	    } 
 2293: 	   return $currentstring;
 2294: 	}
 2295:         sub end_noembed {
 2296: 	    my ($target,$token) = @_;
 2297:             my $currentstring = '';
 2298:             if ($target eq 'web') {
 2299:               $currentstring = $token->[2];    
 2300:             } 
 2301: 	   return $currentstring;
 2302: 	}
 2303: #-- <noframes> tag
 2304:       sub start_noframes {
 2305: 	    my ($target,$token) = @_;
 2306:             my $currentstring = '';
 2307:             if ($target eq 'web') {
 2308:               $currentstring = $token->[4];     
 2309: 	    } 
 2310: 	   return $currentstring;
 2311: 	}
 2312:         sub end_noframes {
 2313: 	    my ($target,$token) = @_;
 2314:             my $currentstring = '';
 2315:             if ($target eq 'web') {
 2316:               $currentstring = $token->[2];    
 2317:             } 
 2318: 	   return $currentstring;
 2319: 	}
 2320: #-- <nolayer> tag
 2321:       sub start_nolayer {
 2322: 	    my ($target,$token) = @_;
 2323:             my $currentstring = '';
 2324:             if ($target eq 'web') {
 2325:               $currentstring = $token->[4];     
 2326: 	    } 
 2327: 	   return $currentstring;
 2328: 	}
 2329:         sub end_nolayer {
 2330: 	    my ($target,$token) = @_;
 2331:             my $currentstring = '';
 2332:             if ($target eq 'web') {
 2333:               $currentstring = $token->[2];    
 2334:             } 
 2335: 	   return $currentstring;
 2336: 	}
 2337: #-- <noscript> tag
 2338:       sub start_noscript {
 2339: 	    my ($target,$token) = @_;
 2340:             my $currentstring = '';
 2341:             if ($target eq 'web') {
 2342:               $currentstring = $token->[4];     
 2343: 	    } 
 2344: 	   return $currentstring;
 2345: 	}
 2346:         sub end_noscript {
 2347: 	    my ($target,$token) = @_;
 2348:             my $currentstring = '';
 2349:             if ($target eq 'web') {
 2350:               $currentstring = $token->[2];    
 2351:             } 
 2352: 	   return $currentstring;
 2353: 	}
 2354: #-- <object> tag
 2355:       sub start_object {
 2356: 	    my ($target,$token) = @_;
 2357:             my $currentstring = '';
 2358:             if ($target eq 'web') {
 2359:               $currentstring = $token->[4];     
 2360: 	    } 
 2361: 	   return $currentstring;
 2362: 	}
 2363:         sub end_object {
 2364: 	    my ($target,$token) = @_;
 2365:             my $currentstring = '';
 2366:             if ($target eq 'web') {
 2367:               $currentstring = $token->[2];    
 2368:             } 
 2369: 	   return $currentstring;
 2370: 	}
 2371: #-- <optgroup> tag
 2372:       sub start_optgroup {
 2373: 	    my ($target,$token) = @_;
 2374:             my $currentstring = '';
 2375:             if ($target eq 'web') {
 2376:               $currentstring = $token->[4];     
 2377: 	    } 
 2378: 	   return $currentstring;
 2379: 	}
 2380:         sub end_optgroup {
 2381: 	    my ($target,$token) = @_;
 2382:             my $currentstring = '';
 2383:             if ($target eq 'web') {
 2384:               $currentstring = $token->[2];    
 2385:             } 
 2386: 	   return $currentstring;
 2387: 	}
 2388: #-- <samp> tag
 2389:       sub start_samp {
 2390: 	    my ($target,$token) = @_;
 2391:             my $currentstring = '';
 2392:             if ($target eq 'web') {
 2393:               $currentstring = $token->[4];     
 2394: 	    } 
 2395: 	   return $currentstring;
 2396: 	}
 2397:         sub end_samp {
 2398: 	    my ($target,$token) = @_;
 2399:             my $currentstring = '';
 2400:             if ($target eq 'web') {
 2401:               $currentstring = $token->[2];    
 2402:             } 
 2403: 	   return $currentstring;
 2404: 	}
 2405: #-- <server> tag
 2406:       sub start_server {
 2407: 	    my ($target,$token) = @_;
 2408:             my $currentstring = '';
 2409:             if ($target eq 'web') {
 2410:               $currentstring = $token->[4];     
 2411: 	    } 
 2412: 	   return $currentstring;
 2413: 	}
 2414:         sub end_server {
 2415: 	    my ($target,$token) = @_;
 2416:             my $currentstring = '';
 2417:             if ($target eq 'web') {
 2418:               $currentstring = $token->[2];    
 2419:             } 
 2420: 	   return $currentstring;
 2421: 	}
 2422: #-- <spacer> tag
 2423:       sub start_spacer {
 2424: 	    my ($target,$token) = @_;
 2425:             my $currentstring = '';
 2426:             if ($target eq 'web') {
 2427:               $currentstring = $token->[4];     
 2428: 	    } 
 2429: 	   return $currentstring;
 2430: 	}
 2431:         sub end_spacer {
 2432: 	    my ($target,$token) = @_;
 2433:             my $currentstring = '';
 2434:             if ($target eq 'web') {
 2435:               $currentstring = $token->[2];    
 2436:             } 
 2437: 	   return $currentstring;
 2438: 	}
 2439: #-- <span> tag
 2440:       sub start_span {
 2441: 	    my ($target,$token) = @_;
 2442:             my $currentstring = '';
 2443:             if ($target eq 'web') {
 2444:               $currentstring = $token->[4];     
 2445: 	    } 
 2446: 	   return $currentstring;
 2447: 	}
 2448:         sub end_span {
 2449: 	    my ($target,$token) = @_;
 2450:             my $currentstring = '';
 2451:             if ($target eq 'web') {
 2452:               $currentstring = $token->[2];    
 2453:             } 
 2454: 	   return $currentstring;
 2455: 	}
 2456: #-- <tbody> tag
 2457:       sub start_tbody {
 2458: 	    my ($target,$token) = @_;
 2459:             my $currentstring = '';
 2460:             if ($target eq 'web') {
 2461:               $currentstring = $token->[4];     
 2462: 	    } 
 2463: 	   return $currentstring;
 2464: 	}
 2465:         sub end_tbody {
 2466: 	    my ($target,$token) = @_;
 2467:             my $currentstring = '';
 2468:             if ($target eq 'web') {
 2469:               $currentstring = $token->[2];    
 2470:             } 
 2471: 	   return $currentstring;
 2472: 	}
 2473: #-- <tfoot> tag
 2474:       sub start_tfoot {
 2475: 	    my ($target,$token) = @_;
 2476:             my $currentstring = '';
 2477:             if ($target eq 'web') {
 2478:               $currentstring = $token->[4];     
 2479: 	    } 
 2480: 	   return $currentstring;
 2481: 	}
 2482:         sub end_tfoot {
 2483: 	    my ($target,$token) = @_;
 2484:             my $currentstring = '';
 2485:             if ($target eq 'web') {
 2486:               $currentstring = $token->[2];    
 2487:             } 
 2488: 	   return $currentstring;
 2489: 	}
 2490: #-- <thead> tag
 2491:       sub start_thead {
 2492: 	    my ($target,$token) = @_;
 2493:             my $currentstring = '';
 2494:             if ($target eq 'web') {
 2495:               $currentstring = $token->[4];     
 2496: 	    } 
 2497: 	   return $currentstring;
 2498: 	}
 2499:         sub end_thead {
 2500: 	    my ($target,$token) = @_;
 2501:             my $currentstring = '';
 2502:             if ($target eq 'web') {
 2503:               $currentstring = $token->[2];    
 2504:             } 
 2505: 	   return $currentstring;
 2506: 	}
 2507: #-- <var> tag
 2508:       sub start_var {
 2509: 	    my ($target,$token) = @_;
 2510:             my $currentstring = '';
 2511:             if ($target eq 'web') {
 2512:               $currentstring = $token->[4];     
 2513: 	    } 
 2514: 	   return $currentstring;
 2515: 	}
 2516:         sub end_var {
 2517: 	    my ($target,$token) = @_;
 2518:             my $currentstring = '';
 2519:             if ($target eq 'web') {
 2520:               $currentstring = $token->[2];    
 2521:             } 
 2522: 	   return $currentstring;
 2523: 	}
 2524: #-- <wbr> tag
 2525:       sub start_wbr {
 2526: 	    my ($target,$token) = @_;
 2527:             my $currentstring = '';
 2528:             if ($target eq 'web') {
 2529:               $currentstring = $token->[4];     
 2530: 	    } 
 2531: 	   return $currentstring;
 2532: 	}
 2533:         sub end_wbr {
 2534: 	    my ($target,$token) = @_;
 2535:             my $currentstring = '';
 2536:             if ($target eq 'web') {
 2537:               $currentstring = $token->[2];    
 2538:             } 
 2539: 	   return $currentstring;
 2540: 	}
 2541: 1;
 2542: __END__

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