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