File:  [LON-CAPA] / loncom / xml / londefdef.pm
Revision 1.91: download - view: text, annotated - select for diffs
Tue Oct 8 15:35:22 2002 UTC (21 years, 7 months ago) by sakharuk
Branches: MAIN
CVS tags: HEAD
Corrected <table> to adjust to a variety of courses on s10 (problems with nested tables).

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

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