Annotation of loncom/xml/londefdef.pm, revision 1.4
1.1 sakharuk 1: # The LearningOnline Network with CAPA
2: # Tags Default Definition Module
3: #
4: # last modified 06/26/00 by Alexander Sakharuk
5:
1.2 albertel 6: package Apache::londefdef;
1.1 sakharuk 7:
8: use strict;
1.3 sakharuk 9: use Apache::lonxml;
1.1 sakharuk 10:
1.3 sakharuk 11: sub BEGIN {
12: &Apache::lonxml::register('Apache::londefdef',('m','html','head','map','applet','select','option','input','textarea','form','meta','title','body','center','b','strong','table','dt','h1','h2','h3','h4','h5','h6','cite','i','address','dd','dl','dir','ol','ul','menu','dfn','kbd','tt','code','em','q','p','br','big','small','basefont','font','s','sub','strike','sup','hr','a','li','u'));
13: }
1.1 sakharuk 14:
15: #===================================================================== TAG SUBROUTINES
1.4 ! sakharuk 16: #-- <m> tag
1.1 sakharuk 17: sub start_m {
1.4 ! sakharuk 18: my ($target,$token,$parstack,$parser) = @_;
1.1 sakharuk 19: my $currentstring = '';
20: if ($target eq 'web') {
1.4 ! sakharuk 21: my $inside = $parser->get_text("/m");
! 22: $currentstring = &Apache::lontexconvert::converted('\\documentstyle{article}'.$inside);
1.1 sakharuk 23: } elsif ($target eq 'tex') {
24: $currentstring = "\$";
25: }
26: return $currentstring;
27: }
28: sub end_m {
29: my ($target,$token) = @_;
30: my $currentstring = '';
31: if ($target eq 'web') {
32: } elsif ($target eq 'tex') {
33: $currentstring = "\$";
34: }
35: return $currentstring;
36: }
37: #-------------------------------------------------------------------------- <html> tag
38: sub start_html {
39: my ($target,$token) = @_;
40: my $currentstring = '';
41: if ($target eq 'web') {
42: $currentstring = $token->[4];
43: }
44: return $currentstring;
45: }
46: sub end_html {
47: my ($target,$token) = @_;
48: my $currentstring = '';
49: if ($target eq 'web') {
50: $currentstring = $token->[2];
51: }
52: return $currentstring;
53: }
54: #-------------------------------------------------------------------------- <head> tag
55: sub start_head {
56: my ($target,$token) = @_;
57: my $currentstring = '';
58: if ($target eq 'web') {
59: $currentstring = $token->[4];
60: }
61: return $currentstring;
62: }
63: sub end_head {
64: my ($target,$token) = @_;
65: my $currentstring = '';
66: if ($target eq 'web') {
67: $currentstring = $token->[2];
68: }
69: return $currentstring;
70: }
71: #--------------------------------------------------------------------------- <map> tag
72: sub start_map {
73: my ($target,$token) = @_;
74: my $currentstring = '';
75: if ($target eq 'web') {
76: $currentstring = $token->[4];
77: }
78: return $currentstring;
79: }
80: sub end_map {
81: my ($target,$token) = @_;
82: my $currentstring = '';
83: if ($target eq 'web') {
84: $currentstring = $token->[2];
85: }
86: return $currentstring;
87: }
88: #------------------------------------------------------------------------ <applet> tag
89: sub start_applet {
90: my ($target,$token) = @_;
91: my $currentstring = '';
92: if ($target eq 'web') {
93: $currentstring = $token->[4];
94: }
95: return $currentstring;
96: }
97: sub end_applet {
98: my ($target,$token) = @_;
99: my $currentstring = '';
100: if ($target eq 'web') {
101: $currentstring = $token->[2];
102: }
103: return $currentstring;
104: }
105: #------------------------------------------------------------------------ <select> tag
106: sub start_select {
107: my ($target,$token) = @_;
108: my $currentstring = '';
109: if ($target eq 'web') {
110: $currentstring = $token->[4];
111: }
112: return $currentstring;
113: }
114: sub end_select {
115: my ($target,$token) = @_;
116: my $currentstring = '';
117: if ($target eq 'web') {
118: $currentstring = $token->[2];
119: }
120: return $currentstring;
121: }
122: #------------------------------------------------------------------------ <option> tag
123: sub start_option {
124: my ($target,$token) = @_;
125: my $currentstring = '';
126: if ($target eq 'web') {
127: $currentstring = $token->[4];
128: }
129: return $currentstring;
130: }
131: sub end_option {
132: my ($target,$token) = @_;
133: my $currentstring = '';
134: if ($target eq 'web') {
135: $currentstring = $token->[2];
136: }
137: return $currentstring;
138: }
139: #------------------------------------------------------------------------- <input> tag
140: sub start_input {
141: my ($target,$token) = @_;
142: my $currentstring = '';
143: if ($target eq 'web') {
144: $currentstring = $token->[4];
145: }
146: return $currentstring;
147: }
148: sub end_input {
149: my ($target,$token) = @_;
150: my $currentstring = '';
151: if ($target eq 'web') {
152: $currentstring = $token->[2];
153: }
154: return $currentstring;
155: }
156: #---------------------------------------------------------------------- <textarea> tag
157: sub start_textarea {
158: my ($target,$token) = @_;
159: my $currentstring = '';
160: if ($target eq 'web') {
161: $currentstring = $token->[4];
162: }
163: return $currentstring;
164: }
165: sub end_textarea {
166: my ($target,$token) = @_;
167: my $currentstring = '';
168: if ($target eq 'web') {
169: $currentstring = $token->[2];
170: }
171: return $currentstring;
172: }
173: #-------------------------------------------------------------------------- <form> tag
174: sub start_form {
175: my ($target,$token) = @_;
176: my $currentstring = '';
177: if ($target eq 'web') {
178: $currentstring = $token->[4];
179: }
180: return $currentstring;
181: }
182: sub end_form {
183: my ($target,$token) = @_;
184: my $currentstring = '';
185: if ($target eq 'web') {
186: $currentstring = $token->[2];
187: }
188: return $currentstring;
189: }
190: #------------------------------------------------------------------------- <title> tag
191: sub start_title {
192: my ($target,$token) = @_;
193: my $currentstring = '';
194: if ($target eq 'web') {
195: $currentstring = $token->[4];
196: }
197: return $currentstring;
198: }
199: sub end_title {
200: my ($target,$token) = @_;
201: my $currentstring = '';
202: if ($target eq 'web') {
203: $currentstring = $token->[2];
204: }
205: return $currentstring;
206: }
207: #-------------------------------------------------------------------------- <meta> tag
208: sub start_meta {
209: my ($target,$token) = @_;
210: my $currentstring = '';
211: if ($target eq 'web') {
212: $currentstring = $token->[4];
213: }
214: return $currentstring;
215: }
216: sub end_meta {
217: my ($target,$token) = @_;
218: my $currentstring = '';
219: if ($target eq 'web') {
220: $currentstring = $token->[2];
221: }
222: return $currentstring;
223: }
224: #-------------------------------------------------------------------------- <body> tag
225: sub start_body {
226: my ($target,$token) = @_;
227: my $currentstring = '';
228: if ($target eq 'web') {
229: $currentstring = $token->[4];
230: } elsif ($target eq 'tex') {
231: $currentstring = " \\begin{document} ";
232: }
233: return $currentstring;
234: }
235: sub end_body {
236: my ($target,$token) = @_;
237: my $currentstring = '';
238: if ($target eq 'web') {
239: $currentstring = $token->[2];
240: } elsif ($target eq 'tex') {
241: $currentstring = " \\end{document}";
242: }
243: return $currentstring;
244: }
245: #------------------------------------------------------------------------ <center> tag
246: sub start_center {
247: my ($target,$token) = @_;
248: my $currentstring = '';
249: if ($target eq 'web') {
250: $currentstring = $token->[4];
251: } elsif ($target eq 'tex') {
252: $currentstring = " \\begin{center} ";
253: }
254: return $currentstring;
255: }
256: sub end_center {
257: my ($target,$token) = @_;
258: my $currentstring = '';
259: if ($target eq 'web') {
260: $currentstring = $token->[2];
261: } elsif ($target eq 'tex') {
262: $currentstring = " \\end{center}";
263: }
264: return $currentstring;
265: }
266: #----------------------------------------------------------------------------- <b> tag
267: sub start_b {
268: my ($target,$token) = @_;
269: my $currentstring = '';
270: if ($target eq 'web') {
271: $currentstring = $token->[4];
272: } elsif ($target eq 'tex') {
273: $currentstring = " {\\bf ";
274: }
275: return $currentstring;
276: }
277: sub end_b {
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: return $currentstring;
286: }
287: #------------------------------------------------------------------------ <strong> tag
288: sub start_strong {
289: my ($target,$token) = @_;
290: my $currentstring = '';
291: if ($target eq 'web') {
292: $currentstring = $token->[4];
293: } elsif ($target eq 'tex') {
294: $currentstring = " {\\bf ";
295: }
296: return $currentstring;
297: }
298: sub end_strong {
299: my ($target,$token) = @_;
300: my $currentstring = '';
301: if ($target eq 'web') {
302:
303: $currentstring = $token->[2];
304: } elsif ($target eq 'tex') {
305: $currentstring = "}";
306: }
307: return $currentstring;
308: }
309: #---------------------------------------------------------------------------- <h1> tag
310: sub start_h1 {
311: my ($target,$token) = @_;
312: my $currentstring = '';
313: if ($target eq 'web') {
314: $currentstring .= $token->[4];
315: } elsif ($target eq 'tex') {
316: $currentstring .= "\\chapter{ ";
317: }
318: return $currentstring;
319: }
320: sub end_h1 {
321: my ($target,$token) = @_;
322: my $currentstring = '';
323: if ($target eq 'web') {
324: $currentstring .= $token->[2];
325: } elsif ($target eq 'tex') {
326: $currentstring .= "}";
327: }
328: return $currentstring;
329: }
330: #---------------------------------------------------------------------------- <h2> tag
331: sub start_h2 {
332: my ($target,$token) = @_;
333: my $currentstring = '';
334: if ($target eq 'web') {
335: $currentstring .= $token->[4];
336: } elsif ($target eq 'tex') {
337: $currentstring .= "\\section{ ";
338: }
339: return $currentstring;
340: }
341: sub end_h2 {
342: my ($target,$token) = @_;
343: my $currentstring = '';
344: if ($target eq 'web') {
345: $currentstring .= $token->[2];
346: } elsif ($target eq 'tex') {
347: $currentstring .= "}";
348: }
349: return $currentstring;
350: }
351: #---------------------------------------------------------------------------- <h3> tag
352: sub start_h3 {
353: my ($target,$token) = @_;
354: my $currentstring = '';
355: if ($target eq 'web') {
356: $currentstring .= $token->[4];
357: } elsif ($target eq 'tex') {
358: $currentstring .= "\\subsection{ ";
359: }
360: return $currentstring;
361: }
362: sub end_h3 {
363: my ($target,$token) = @_;
364: my $currentstring = '';
365: if ($target eq 'web') {
366: $currentstring .= $token->[2];
367: } elsif ($target eq 'tex') {
368: $currentstring .= "}";
369: }
370: return $currentstring;
371: }
372: #---------------------------------------------------------------------------- <h4> tag
373: sub start_h4 {
374: my ($target,$token) = @_;
375: my $currentstring = '';
376: if ($target eq 'web') {
377: $currentstring .= $token->[4];
378: } elsif ($target eq 'tex') {
379: $currentstring .= "\\subsubsection{ ";
380: }
381: return $currentstring;
382: }
383: sub end_h4 {
384: my ($target,$token) = @_;
385: my $currentstring = '';
386: if ($target eq 'web') {
387: $currentstring .= $token->[2];
388: } elsif ($target eq 'tex') {
389: $currentstring .= "}";
390: }
391: return $currentstring;
392: }
393: #---------------------------------------------------------------------------- <h5> tag
394: sub start_h5 {
395: my ($target,$token) = @_;
396: my $currentstring = '';
397: if ($target eq 'web') {
398: $currentstring .= $token->[4];
399: } elsif ($target eq 'tex') {
400: $currentstring .= "\\paragraph{ ";
401: }
402: return $currentstring;
403: }
404: sub end_h5 {
405: my ($target,$token) = @_;
406: my $currentstring = '';
407: if ($target eq 'web') {
408: $currentstring .= $token->[2];
409: } elsif ($target eq 'tex') {
410: $currentstring .= "}";
411: }
412: return $currentstring;
413: }
414: #---------------------------------------------------------------------------- <h6> tag
415: sub start_h6 {
416: my ($target,$token) = @_;
417: my $currentstring = '';
418: if ($target eq 'web') {
419: $currentstring .= $token->[4];
420: } elsif ($target eq 'tex') {
421: $currentstring .= "\\subparagraph{ ";
422: }
423: return $currentstring;
424: }
425: sub end_h6 {
426: my ($target,$token) = @_;
427: my $currentstring = '';
428: if ($target eq 'web') {
429: $currentstring .= $token->[2];
430: } elsif ($target eq 'tex') {
431: $currentstring .= "}";
432: }
433: return $currentstring;
434: }
435: #-------------------------------------------------------------------------- <cite> tag
436: sub start_cite {
437: my ($target,$token) = @_;
438: my $currentstring = '';
439: if ($target eq 'web') {
440: $currentstring .= $token->[4];
441: } elsif ($target eq 'tex') {
442: $currentstring .= "{ \\it ";
443: }
444: return $currentstring;
445: }
446: sub end_cite {
447: my ($target,$token) = @_;
448: my $currentstring = '';
449: if ($target eq 'web') {
450: $currentstring .= $token->[2];
451: } elsif ($target eq 'tex') {
452: $currentstring .= "}";
453: }
454: return $currentstring;
455: }
456: #----------------------------------------------------------------------------- <i> tag
457: sub start_i {
458: my ($target,$token) = @_;
459: my $currentstring = '';
460: if ($target eq 'web') {
461: $currentstring .= $token->[4];
462: } elsif ($target eq 'tex') {
463: $currentstring .= "{ \\it ";
464: }
465: return $currentstring;
466: }
467: sub end_i {
468: my ($target,$token) = @_;
469: my $currentstring = '';
470: if ($target eq 'web') {
471: $currentstring .= $token->[2];
472: } elsif ($target eq 'tex') {
473: $currentstring .= "}";
474: }
475: return $currentstring;
476: }
477: #----------------------------------------------------------------------- <address> tag
478: sub start_address {
479: my ($target,$token) = @_;
480: my $currentstring = '';
481: if ($target eq 'web') {
482: $currentstring .= $token->[4];
483: } elsif ($target eq 'tex') {
484: $currentstring .= "{ \\it ";
485: }
486: return $currentstring;
487: }
488: sub end_address {
489: my ($target,$token) = @_;
490: my $currentstring = '';
491: if ($target eq 'web') {
492: $currentstring .= $token->[2];
493: } elsif ($target eq 'tex') {
494: $currentstring .= "}";
495: }
496: return $currentstring;
497: }
498: #--------------------------------------------------------------------------- <dfn> tag
499: sub start_dfn {
500: my ($target,$token) = @_;
501: my $currentstring = '';
502: if ($target eq 'web') {
503: $currentstring .= $token->[4];
504: } elsif ($target eq 'tex') {
505: $currentstring .= "{ \\it ";
506: }
507: return $currentstring;
508: }
509: sub end_dfn {
510: my ($target,$token) = @_;
511: my $currentstring = '';
512: if ($target eq 'web') {
513: $currentstring .= $token->[2];
514: } elsif ($target eq 'tex') {
515: $currentstring .= "}";
516: }
517: return $currentstring;
518: }
519: #---------------------------------------------------------------------------- <tt> tag
520: sub start_tt {
521: my ($target,$token) = @_;
522: my $currentstring = '';
523: if ($target eq 'web') {
524: $currentstring .= $token->[4];
525: } elsif ($target eq 'tex') {
526: $currentstring .= "{ \\tt ";
527: }
528: return $currentstring;
529: }
530: sub end_tt {
531: my ($target,$token) = @_;
532: my $currentstring = '';
533: if ($target eq 'web') {
534: $currentstring .= $token->[2];
535: } elsif ($target eq 'tex') {
536: $currentstring .= "}";
537: }
538: return $currentstring;
539: }
540: #---------------------------------------------------------------------------- <kbd> tag
541: sub start_kbd {
542: my ($target,$token) = @_;
543: my $currentstring = '';
544: if ($target eq 'web') {
545: $currentstring .= $token->[4];
546: } elsif ($target eq 'tex') {
547: $currentstring .= "{ \\tt ";
548: }
549: return $currentstring;
550: }
551: sub end_kbd {
552: my ($target,$token) = @_;
553: my $currentstring = '';
554: if ($target eq 'web') {
555: $currentstring .= $token->[2];
556: } elsif ($target eq 'tex') {
557: $currentstring .= "}";
558: }
559: return $currentstring;
560: }
561: #-------------------------------------------------------------------------- <code> tag
562: sub start_code {
563: my ($target,$token) = @_;
564: my $currentstring = '';
565: if ($target eq 'web') {
566: $currentstring .= $token->[4];
567: } elsif ($target eq 'tex') {
568: $currentstring .= "{ \\tt ";
569: }
570: return $currentstring;
571: }
572: sub end_code {
573: my ($target,$token) = @_;
574: my $currentstring = '';
575: if ($target eq 'web') {
576: $currentstring .= $token->[2];
577: } elsif ($target eq 'tex') {
578: $currentstring .= "}";
579: }
580: return $currentstring;
581: }
582: #---------------------------------------------------------------------------- <em> tag
583: sub start_em {
584: my ($target,$token) = @_;
585: my $currentstring = '';
586: if ($target eq 'web') {
587: $currentstring .= $token->[4];
588: } elsif ($target eq 'tex') {
589: $currentstring .= "{ \\emph ";
590: }
591: return $currentstring;
592: }
593: sub end_em {
594: my ($target,$token) = @_;
595: my $currentstring = '';
596: if ($target eq 'web') {
597: $currentstring .= $token->[2];
598: } elsif ($target eq 'tex') {
599: $currentstring .= "}";
600: }
601: return $currentstring;
602: }
603: #----------------------------------------------------------------------------- <q> tag
604: sub start_q {
605: my ($target,$token) = @_;
606: my $currentstring = '';
607: if ($target eq 'web') {
608: $currentstring .= $token->[4];
609: } elsif ($target eq 'tex') {
610: $currentstring .= "{ \\emph ";
611: }
612: return $currentstring;
613: }
614: sub end_q {
615: my ($target,$token) = @_;
616: my $currentstring = '';
617: if ($target eq 'web') {
618: $currentstring .= $token->[2];
619: } elsif ($target eq 'tex') {
620: $currentstring .= "}";
621: }
622: return $currentstring;
623: }
624: #----------------------------------------------------------------------------- <p> tag
625: sub start_p {
626: my ($target,$token) = @_;
627: my $currentstring = '';
628: if ($target eq 'web') {
629: $currentstring .= $token->[4];
630: } elsif ($target eq 'tex') {
631: $currentstring .= "{\\par ";
632: }
633: return $currentstring;
634: }
635: sub end_p {
636: my ($target,$token) = @_;
637: my $currentstring = '';
638: if ($target eq 'web') {
639: $currentstring .= $token->[2];
640: } elsif ($target eq 'tex') {
641: $currentstring .= " }";
642: }
643: return $currentstring;
644: }
645: #---------------------------------------------------------------------------- <br> tag
646: sub start_br {
647: my ($target,$token) = @_;
648: my $currentstring = '';
649: if ($target eq 'web') {
650: $currentstring .= $token->[4];
651: } elsif ($target eq 'tex') {
652: $currentstring .= "\\\\";
653: }
654: return $currentstring;
655: }
656: sub end_br {
657: my ($target,$token) = @_;
658: my $currentstring = '';
659: if ($target eq 'web') {
660: $currentstring .= $token->[2];
661: }
662: return $currentstring;
663: }
664: #--------------------------------------------------------------------------- <big> tag
665: sub start_big {
666: my ($target,$token) = @_;
667: my $currentstring = '';
668: if ($target eq 'web') {
669: $currentstring .= $token->[4];
670: } elsif ($target eq 'tex') {
671: $currentstring .= "{\\large ";
672: }
673: return $currentstring;
674: }
675: sub end_big {
676: my ($target,$token) = @_;
677: my $currentstring = '';
678: if ($target eq 'web') {
679: $currentstring .= $token->[2];
680: } elsif ($target eq 'tex') {
681: $currentstring .= " }";
682: }
683: return $currentstring;
684: }
685: #------------------------------------------------------------------------- <small> tag
686: sub start_small {
687: my ($target,$token) = @_;
688: my $currentstring = '';
689: if ($target eq 'web') {
690: $currentstring .= $token->[4];
691: } elsif ($target eq 'tex') {
692: $currentstring .= "{\\footnotesize ";
693: }
694: return $currentstring;
695: }
696: sub end_small {
697: my ($target,$token) = @_;
698: my $currentstring = '';
699: if ($target eq 'web') {
700: $currentstring .= $token->[2];
701: } elsif ($target eq 'tex') {
702: $currentstring .= " }";
703: }
704: return $currentstring;
705: }
706: #---------------------------------------------------------------------- <basefont> tag
707: sub start_basefont {
708: my ($target,$token) = @_;
709: my $currentstring = '';
710: if ($target eq 'web') {
711: $currentstring = $token->[4];
712: }
713: return $currentstring;
714: }
715: #-------------------------------------------------------------------------- <font> tag
716: sub start_font {
717: my ($target,$token) = @_;
718: my $currentstring = '';
719: if ($target eq 'web') {
720: $currentstring = $token->[4];
721: }
722: return $currentstring;
723: }
724: sub end_font {
725: my ($target,$token) = @_;
726: my $currentstring = '';
727: if ($target eq 'web') {
728: $currentstring = $token->[2];
729: }
730: return $currentstring;
731: }
732: #------------------------------------------------------------------------ <strike> tag
733: sub start_strike {
734: my ($target,$token) = @_;
735: my $currentstring = '';
736: if ($target eq 'web') {
737: $currentstring .= $token->[4];
738: } elsif ($target eq 'tex') {
739: $currentstring .= "{\\underline ";
740: }
741: return $currentstring;
742: }
743: sub end_strike {
744: my ($target,$token) = @_;
745: my $currentstring = '';
746: if ($target eq 'web') {
747: $currentstring .= $token->[2];
748: } elsif ($target eq 'tex') {
749: $currentstring .= " }";
750: }
751: return $currentstring;
752: }
753: #----------------------------------------------------------------------------- <s> tag
754: sub start_s {
755: my ($target,$token) = @_;
756: my $currentstring = '';
757: if ($target eq 'web') {
758: $currentstring .= $token->[4];
759: } elsif ($target eq 'tex') {
760: $currentstring .= "{\\underline ";
761: }
762: return $currentstring;
763: }
764: sub end_s {
765: my ($target,$token) = @_;
766: my $currentstring = '';
767: if ($target eq 'web') {
768: $currentstring .= $token->[2];
769: } elsif ($target eq 'tex') {
770: $currentstring .= " }";
771: }
772: return $currentstring;
773: }
774: #--------------------------------------------------------------------------- <sub> tag
775: sub start_sub {
776: my ($target,$token) = @_;
777: my $currentstring = '';
778: if ($target eq 'web') {
779: $currentstring .= $token->[4];
780: } elsif ($target eq 'tex') {
781: $currentstring .= "\$_{ ";
782: }
783: return $currentstring;
784: }
785: sub end_sub {
786: my ($target,$token) = @_;
787: my $currentstring = '';
788: if ($target eq 'web') {
789: $currentstring .= $token->[2];
790: } elsif ($target eq 'tex') {
791: $currentstring .= " }\$";
792: }
793: return $currentstring;
794: }
795: #--------------------------------------------------------------------------- <sup> tag
796: sub start_sup {
797: my ($target,$token) = @_;
798: my $currentstring = '';
799: if ($target eq 'web') {
800: $currentstring .= $token->[4];
801: } elsif ($target eq 'tex') {
802: $currentstring .= "\$^{ ";
803: }
804: return $currentstring;
805: }
806: sub end_sup {
807: my ($target,$token) = @_;
808: my $currentstring = '';
809: if ($target eq 'web') {
810: $currentstring .= $token->[2];
811: } elsif ($target eq 'tex') {
812: $currentstring .= " }\$";
813: }
814: return $currentstring;
815: }
816: #---------------------------------------------------------------------------- <hr> tag
817: sub start_hr {
818: my ($target,$token) = @_;
819: my $currentstring = '';
820: if ($target eq 'web') {
821: $currentstring .= $token->[4];
822: } elsif ($target eq 'tex') {
823: $currentstring .= "\\hline ";
824: }
825: return $currentstring;
826: }
827: #----------------------------------------------------------------------------- <a> tag
828: sub start_a {
829: my ($target,$token) = @_;
830: my $currentstring = '';
831: if ($target eq 'web') {
832: $currentstring .= $token->[4];
833: } elsif ($target eq 'tex') {
834: }
835: return $currentstring;
836: }
837: sub end_a {
838: my ($target,$token,$stackref) = @_;
839: my $currentstring = '';
840: if ($target eq 'web') {
841: $currentstring .= $token->[2];
842: } elsif ($target eq 'tex') {
843: my $tempor_var = $stackref->[$#$stackref];
844: if (index($tempor_var,'name') != -1 ) {
845: $tempor_var =~ s/name=([^,]*),/$1/g;
846: $currentstring .= " \\label{$tempor_var}";
847: } elsif (index($tempor_var,'href') != -1 ) {
848: $tempor_var =~ s/href=([^,]*),/$1/g;
849: $currentstring .= " \\ref{$tempor_var}";
850: }
851: }
852: return $currentstring;
853: }
854: #---------------------------------------------------------------------------- <li> tag
855: sub start_li {
856: my ($target,$token,$stackref) = @_;
857: my $currentstring = '';
858: if ($target eq 'web') {
859: $currentstring = $token->[4];
860: } elsif ($target eq 'tex') {
861: my $tempor_var = $stackref->[$#$stackref-1];
862: if (index($tempor_var,'circle') != -1 ) {
863: $currentstring .= " \\item[o] ";
864: } elsif (index($tempor_var,'square') != -1 ) {
865: $currentstring .= " \\item[$\Box$] ";
866: } else {
867: $currentstring .= " \\item ";
868: }
869: }
870: return $currentstring;
871: }
872: sub end_li {
873: my ($target,$token) = @_;
874: my $currentstring = '';
875: if ($target eq 'web') {
876: $currentstring = $token->[2];
877: }
878: return $currentstring;
879: }
880: #----------------------------------------------------------------------------- <u> tag
881: sub start_u {
882: my ($target,$token) = @_;
883: my $currentstring = '';
884: if ($target eq 'web') {
885: $currentstring .= $token->[4];
886: } elsif ($target eq 'tex') {
887: $currentstring .= "{\\underline ";
888: }
889: return $currentstring;
890: }
891: sub end_u {
892: my ($target,$token) = @_;
893: my $currentstring = '';
894: if ($target eq 'web') {
895: $currentstring .= $token->[2];
896: } elsif ($target eq 'tex') {
897: $currentstring .= " }";
898: }
899: return $currentstring;
900: }
901: #---------------------------------------------------------------------------- <ul> tag
902: sub start_ul {
903: my ($target,$token) = @_;
904: my $currentstring = '';
905: if ($target eq 'web') {
906: $currentstring = $token->[4];
907: } elsif ($target eq 'tex') {
908: $currentstring = " \\begin{itemize} ";
909: }
910: return $currentstring;
911: }
912: sub end_ul {
913: my ($target,$token) = @_;
914: my $currentstring = '';
915: if ($target eq 'web') {
916: $currentstring = $token->[2];
917: } elsif ($target eq 'tex') {
918: $currentstring = " \\end{itemize}";
919: }
920: return $currentstring;
921: }
922: #-------------------------------------------------------------------------- <menu> tag
923: sub start_menu {
924: my ($target,$token) = @_;
925: my $currentstring = '';
926: if ($target eq 'web') {
927: $currentstring = $token->[4];
928: } elsif ($target eq 'tex') {
929: $currentstring = " \\begin{itemize} ";
930: }
931: return $currentstring;
932: }
933: sub end_menu {
934: my ($target,$token) = @_;
935: my $currentstring = '';
936: if ($target eq 'web') {
937: $currentstring = $token->[2];
938: } elsif ($target eq 'tex') {
939: $currentstring = " \\end{itemize}";
940: }
941: return $currentstring;
942: }
943: #--------------------------------------------------------------------------- <dir> tag
944: sub start_dir {
945: my ($target,$token) = @_;
946: my $currentstring = '';
947: if ($target eq 'web') {
948: $currentstring = $token->[4];
949: } elsif ($target eq 'tex') {
950: $currentstring = " \\begin{itemize} ";
951: }
952: return $currentstring;
953: }
954: sub end_dir {
955: my ($target,$token) = @_;
956: my $currentstring = '';
957: if ($target eq 'web') {
958: $currentstring = $token->[2];
959: } elsif ($target eq 'tex') {
960: $currentstring = " \\end{itemize}";
961: }
962: return $currentstring;
963: }
964: #---------------------------------------------------------------------------- <ol> tag
965: sub start_ol {
966: my ($target,$token) = @_;
967: my $currentstring = '';
968: if ($target eq 'web') {
969: $currentstring = $token->[4];
970: } elsif ($target eq 'tex') {
971: $currentstring = " \\begin{enumerate} ";
972: }
973: return $currentstring;
974: }
975: sub end_ol {
976: my ($target,$token) = @_;
977: my $currentstring = '';
978: if ($target eq 'web') {
979: $currentstring = $token->[2];
980: } elsif ($target eq 'tex') {
981: $currentstring = " \\end{enumerate}";
982: }
983: return $currentstring;
984: }
985: #---------------------------------------------------------------------------- <dl> tag
986: sub start_dl {
987: my ($target,$token) = @_;
988: my $currentstring = '';
989: if ($target eq 'web') {
990: $currentstring = $token->[4];
991: } elsif ($target eq 'tex') {
992: $currentstring = " \\begin{description} ";
993: }
994: return $currentstring;
995: }
996: sub end_dl {
997: my ($target,$token) = @_;
998: my $currentstring = '';
999: if ($target eq 'web') {
1000: $currentstring = $token->[2];
1001: } elsif ($target eq 'tex') {
1002: $currentstring = " \\end{description}";
1003: }
1004: return $currentstring;
1005: }
1006: #---------------------------------------------------------------------------- <dt> tag
1007: sub start_dt {
1008: my ($target,$token) = @_;
1009: my $currentstring = '';
1010: if ($target eq 'web') {
1011: $currentstring = $token->[4];
1012: } elsif ($target eq 'tex') {
1013: $currentstring = "\\item[ ";
1014: }
1015: return $currentstring;
1016: }
1017: sub end_dt {
1018: my ($target,$token) = @_;
1019: my $currentstring = '';
1020: if ($target eq 'web') {
1021: $currentstring = $token->[2];
1022: } elsif ($target eq 'tex') {
1023: $currentstring = "]";
1024: }
1025: return $currentstring;
1026: }
1027: #---------------------------------------------------------------------------- <dd> tag
1028: sub start_dd {
1029: my ($target,$token) = @_;
1030: my $currentstring = '';
1031: if ($target eq 'web') {
1032: $currentstring = $token->[4];
1033: }
1034: return $currentstring;
1035: }
1036: sub end_dd {
1037: my ($target,$token) = @_;
1038: my $currentstring = '';
1039: if ($target eq 'web') {
1040: $currentstring = $token->[2];
1041: }
1042: return $currentstring;
1043: }
1044: #------------------------------------------------------------------------- <table> tag
1045: sub start_table {
1046: my ($target,$token) = @_;
1047: my $currentstring = '';
1048: if ($target eq 'web') {
1049: $currentstring = $token->[4];
1050: } elsif ($target eq 'tex') {
1051: $currentstring = " \\begin{tabular} ";
1052: }
1053: return $currentstring;
1054: }
1055: sub end_table {
1056: my ($target,$token) = @_;
1057: my $currentstring = '';
1058: if ($target eq 'web') {
1059: $currentstring = $token->[2];
1060: } elsif ($target eq 'tex') {
1061: $currentstring = " \\end{tabular}";
1062: }
1063: return $currentstring;
1064: }
1065:
1066: 1;
1067: __END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>