home *** CD-ROM | disk | FTP | other *** search
/ Chip: Windows 2000 Professional Resource Kit / W2KPRK.iso / apps / perl / ActivePerl.exe / data.z / pod2latex.bat < prev    next >
Encoding:
DOS Batch File  |  1999-10-16  |  23.0 KB  |  528 lines

  1. @rem = '--*-Perl-*--
  2. @echo off
  3. if "%OS%" == "Windows_NT" goto WinNT
  4. perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
  5. goto endofperl
  6. :WinNT
  7. perl -x -S "%0" %*
  8. if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
  9. if %errorlevel% == 9009 echo You do not have Perl in your PATH.
  10. goto endofperl
  11. @rem ';
  12. #!perl
  13. #line 14
  14.     eval 'exec P:\Apps\ActivePerl\temp\bin\MSWin32-x86-object\perl.exe -S $0 ${1+"$@"}'
  15.     if $running_under_some_shell;
  16. #
  17. # pod2latex, version 1.1
  18. # by Taro Kawagish (kawagish@imslab.co.jp),  Jan 11, 1995.
  19. #
  20. # pod2latex filters Perl pod documents to LaTeX documents.
  21. #
  22. # What pod2latex does:
  23. # 1. Pod file 'perl_doc_entry.pod' is filtered to 'perl_doc_entry.tex'.
  24. # 2. Indented paragraphs are translated into
  25. #    '\begin{verbatim} ... \end{verbatim}'.
  26. # 3. '=head1 heading' command is translated into '\section{heading}'
  27. # 4. '=head2 heading' command is translated into '\subsection*{heading}'
  28. # 5. '=over N' command is translated into
  29. #        '\begin{itemize}'    if following =item starts with *,
  30. #        '\begin{enumerate}'    if following =item starts with 1.,
  31. #        '\begin{description}'    if else.
  32. #      (indentation level N is ignored.)
  33. # 6. '=item * heading' command is translated into '\item heading',
  34. #    '=item 1. heading' command is translated into '\item heading',
  35. #    '=item heading' command(other) is translated into '\item[heading]'.
  36. # 7. '=back' command is translated into
  37. #        '\end{itemize}'    if started with '\begin{itemize}',
  38. #        '\end{enumerate}'    if started with '\begin{enumerate}',
  39. #        '\end{description}'    if started with '\begin{description}'.
  40. # 8. other paragraphs are translated into strings with TeX special characters
  41. #    escaped.
  42. # 9. In heading text, and other paragraphs, the following translation of pod
  43. #    quotes are done, and then TeX special characters are escaped after that.
  44. #      I<text> to {\em text\/},
  45. #      B<text> to {\bf text},
  46. #      S<text> to text1,
  47. #        where text1 is a string with blank characters replaced with ~,
  48. #      C<text> to {\tt text2},
  49. #        where text2 is a string with TeX special characters escaped to
  50. #        obtain a literal printout,
  51. #      E<text> (HTML escape) to TeX escaped string,
  52. #      L<text> to referencing string as is done by pod2man,
  53. #      F<file> to {\em file\/},
  54. #      Z<> to a null string,
  55. # 10. those headings are indexed:
  56. #       '=head1 heading'   =>  \section{heading}\index{heading}
  57. #       '=head2 heading'   =>  \subsection*{heading}\index{heading}
  58. #                 only when heading does not match frequent patterns such as
  59. #                 DESCRIPTION, DIAGNOSTICS,...
  60. #       '=item heading'   =>  \item{heading}\index{heading}
  61. #
  62. # Usage:
  63. #     pod2latex perl_doc_entry.pod
  64. # this will write to a file 'perl_doc_entry.tex'.
  65. #
  66. # To LaTeX:
  67. # The following commands need to be defined in the preamble of the LaTeX
  68. # document:
  69. # \def\C++{{\rm C\kern-.05em\raise.3ex\hbox{\footnotesize ++}}}
  70. # \def\underscore{\leavevmode\kern.04em\vbox{\hrule width 0.4em height 0.3pt}}
  71. # and \parindent should be set zero:
  72. # \setlength{\parindent}{0pt}
  73. #
  74. # Note:
  75. # This script was written modifing pod2man.
  76. #
  77. # Bug:
  78. # If HTML escapes E<text> other than E<amp>,E<lt>,E<gt>,E<quot> are used
  79. # in C<>, translation will produce wrong character strings.
  80. # Translation of HTML escapes of various European accents might be wrong.
  81.  
  82.  
  83. $/ = "";            # record separator is blank lines
  84. # TeX special characters.
  85. ##$tt_ables = "!@*()-=+|;:'\"`,./?<>";
  86. $backslash_escapables = "#\$%&{}_";
  87. $backslash_escapables2 = "#\$%&{}";    # except _
  88. ##$nonverbables = "^\\~";
  89. ##$bracketesc = "[]";
  90. ##@tex_verb_fences = unpack("aaaaaaaaa","|#@!*+?:;");
  91.  
  92. @head1_freq_patterns        # =head1 patterns which need not be index'ed
  93.     = ("AUTHOR","Author","BUGS","DATE","DESCRIPTION","DIAGNOSTICS",
  94.        "ENVIRONMENT","EXAMPLES","FILES","INTRODUCTION","NAME","NOTE",
  95.        "SEE ALSO","SYNOPSIS","WARNING");
  96.  
  97. $indent = 0;
  98.  
  99. # parse the pods, produce LaTeX.
  100.  
  101. open(POD,"<$ARGV[0]") || die "cant open $ARGV[0]";
  102. ($pod=$ARGV[0]) =~ s/\.pod$//;
  103. open(LATEX,">$pod.tex");
  104. &do_hdr();
  105.  
  106. $cutting = 1;
  107. $begun = "";
  108. while (<POD>) {
  109.     if ($cutting) {
  110.     next unless /^=/;
  111.     $cutting = 0;
  112.     }
  113.     if ($begun) {
  114.        if (/^=end\s+$begun/) {
  115.            $begun = "";
  116.        }
  117.        elsif ($begun =~ /^(tex|latex)$/) {
  118.            print LATEX $_;
  119.        }
  120.        next;
  121.     }
  122.     chop;
  123.     length || (print LATEX  "\n") && next;
  124.  
  125.     # translate indented lines as a verabatim paragraph
  126.     if (/^\s/) {
  127.     @lines = split(/\n/);
  128.     print LATEX  "\\begin{verbatim}\n";
  129.     for (@lines) {
  130.         1 while s
  131.         {^( [^\t]* ) \t ( \t* ) }
  132.         { $1 . ' ' x (8 - (length($1)%8) + 8*(length($2))) }ex;
  133.         print LATEX  $_,"\n";
  134.     }
  135.     print LATEX  "\\end{verbatim}\n";
  136.     next;
  137.     }
  138.  
  139.     if (/^=for\s+(\S+)\s*/s) {
  140.     if ($1 eq "tex" or $1 eq "latex") {
  141.         print LATEX $',"\n";
  142.     } else {
  143.         # ignore unknown for
  144.     }
  145.     next;
  146.     }
  147.     elsif (/^=begin\s+(\S+)\s*/s) {
  148.     $begun = $1;
  149.     if ($1 eq "tex" or $1 eq "latex") {
  150.         print LATEX $'."\n";
  151.     }
  152.     next;
  153.     }
  154.  
  155.     # preserve '=item' line with pod quotes as they are.
  156.     if (/^=item/) {
  157.     ($bareitem = $_) =~ s/^=item\s*//;
  158.     }
  159.  
  160.     # check for things that'll hosed our noremap scheme; affects $_
  161.     &init_noremap();
  162.  
  163.     # expand strings "func()" as pod quotes.
  164.     if (!/^=item/) {
  165.     # first hide pod escapes.
  166.     # escaped strings are mapped into the ones with the MSB's on.
  167.     s/([A-Z]<[^<>]*>)/noremap($1)/ge;
  168.  
  169.     # func() is a reference to a perl function
  170.     s{\b([:\w]+\(\))}{I<$1>}g;
  171.     # func(n) is a reference to a man page
  172.     s{(\w+)(\([^\s,\051]+\))}{I<$1>$2}g;
  173.     # convert simple variable references
  174. #    s/([\$\@%][\w:]+)/C<$1>/g;
  175. #    s/\$[\w:]+\[[0-9]+\]/C<$&>/g;
  176.  
  177.     if (m{ ([\-\w]+\([^\051]*?[\@\$,][^\051]*?\))
  178.            }x && $` !~ /([LCI]<[^<>]*|-)$/ && !/^=\w/)
  179.     {
  180.         warn "``$1'' should be a [LCI]<$1> ref";
  181.     }
  182.     while (/(-[a-zA-Z])\b/g && $` !~ /[\w\-]$/) {
  183.         warn "``$1'' should be [CB]<$1> ref";
  184.     }
  185.  
  186.     # put back pod quotes so we get the inside of <> processed;
  187.     $_ = &clear_noremap($_);
  188.     }
  189.  
  190.  
  191.     # process TeX special characters
  192.  
  193.     # First hide HTML quotes E<> since they can be included in C<>.
  194.     s/(E<[^<>]+>)/noremap($1)/ge;
  195.  
  196.     # Then hide C<> type literal quotes.
  197.     # String inside of C<> will later be expanded into {\tt ..} strings
  198.     # with TeX special characters escaped as needed.
  199.     s/(C<[^<>]*>)/&noremap($1)/ge;
  200.  
  201.     # Next escape TeX special characters including other pod quotes B< >,...
  202.     #
  203.     # NOTE: s/re/&func($str)/e evaluates $str just once in perl5.
  204.     # (in perl4 evaluation takes place twice before getting passed to func().)
  205.  
  206.     # - hyphen => ---
  207.     s/(\S+)(\s+)-+(\s+)(\S+)/"$1".&noremap(" --- ")."$4"/ge;
  208.     # '-', '--', "-"  =>  '{\tt -}', '{\tt --}', "{\tt -}"
  209. ##    s/("|')(\s*)(-+)(\s*)\1/&noremap("$1$2\{\\tt $3\}$4$1")/ge;
  210. ## changed Wed Jan 25 15:26:39 JST 1995
  211.     # '-', '--', "-"  =>  '$-$', '$--$', "$-$"
  212.     s/(\s+)(['"])(-+)([^'"\-]*)\2(\s+|[,.])/"$1$2".&noremap("\$$3\$")."$4$2$5"/ge;
  213.     s/(\s+)(['"])([^'"\-]*)(-+)(\s*)\2(\s+|[,.])/"$1$2$3".&noremap("\$$4\$")."$5$2$6"/ge;
  214.     # (--|-)  =>  ($--$|$-$)
  215.     s/(\s+)\((-+)([=@%\$\+\\\|\w]*)(-*)([=@%\$\+\\\|\w]*)\)(\s+|[,.])/"$1\(".&noremap("\$$2\$")."$3".&noremap("\$$4\$")."$5\)$6"/ge;
  216.     # numeral -  =>  $-$
  217.     s/(\(|[0-9]+|\s+)-(\s*\(?\s*[0-9]+)/&noremap("$1\$-\$$2")/ge;
  218.     # -- in quotes  =>  two separate -
  219.     s/B<([^<>]*)--([^<>]*)>/&noremap("B<$1\{\\tt --\}$2>")/ge;
  220.  
  221.     # backslash escapable characters except _.
  222.     s/([$backslash_escapables2])/&noremap("\\$1")/ge;
  223.     s/_/&noremap("\\underscore{}")/ge;        # a litle thicker than \_.
  224.     # quote TeX special characters |, ^, ~, \.
  225.     s/\|/&noremap("\$|\$")/ge;
  226.     s/\^/&noremap("\$\\hat{\\hspace{0.4em}}\$")/ge;
  227.     s/\~/&noremap("\$\\tilde{\\hspace{0.4em}}\$")/ge;
  228.     s/\\/&noremap("\$\\backslash{}\$")/ge;
  229.     # quote [ and ] to be used in \item[]
  230.     s/([\[\]])/&noremap("{\\tt $1}")/ge;
  231.     # characters need to be treated differently in TeX
  232.     # keep * if an item heading
  233.     s/^(=item[ \t]+)[*]((.|\n)*)/"$1" . &noremap("*") . "$2"/ge;
  234.     s/[*]/&noremap("\$\\ast\$")/ge;    # other *
  235.  
  236.     # hide other pod quotes.
  237.     s/([ABD-Z]<[^<>]*>)/&noremap($1)/ge;
  238.  
  239.     # escape < and > as math strings,
  240.     # now that we are done with hiding pod <> quotes.
  241.     s/</&noremap("\$<\$")/ge;
  242.     s/>/&noremap("\$>\$")/ge;
  243.  
  244.     # put it back so we get the <> processed again;
  245.     $_ = &clear_noremap($_);
  246.  
  247.  
  248.     # Expand pod quotes recursively:
  249.     # (1) type face directives [BIFS]<[^<>]*> to appropriate TeX commands,
  250.     # (2) L<[^<>]*> to reference strings,
  251.     # (3) C<[^<>]*> to TeX literal quotes,
  252.     # (4) HTML quotes E<> inside of C<> quotes.
  253.  
  254.     # Hide E<> again since they can be included in C<>.
  255.     s/(E<[^<>]+>)/noremap($1)/ge;
  256.  
  257.     $maxnest = 10;
  258.     while ($maxnest-- && /[A-Z]</) {
  259.  
  260.     # bold and italic quotes
  261.     s/B<([^<>]*)>/"{\\bf $1}"/eg;
  262.     s#I<([^<>]*)>#"{\\em $1\\/}"#eg;
  263.  
  264.     # files and filelike refs in italics
  265.     s#F<([^<>]*)>#"{\\em $1\\/}"#eg;
  266.  
  267.     # no break quote -- usually we want C<> for this
  268.     s/S<([^<>]*)>/&nobreak($1)/eg;
  269.  
  270.     # LREF: a manpage(3f<([^eX
  271.    since_    s#([^eX
  272.    sincÄù]   ºeg;
  273.  
  274. [^
  275. [^
  276.   º\$"
  277.  
  278. $23f<([^eX:LREF: a manpage(
  279.   ing
  280. pla(
  281.  quotef<([^eX)(\([rn "``$e_    s^incÄ/\))}{I<($1>}g?ak# pu^
  282.  
  283. [^
  284.  
  285. 2s
  286. TeXr
  287.     
  288. [^;
  289.     #ef<([^eX}gxREF: a manpage(
  290.   ing
  291. plaS<([ef<([^eX)(\([rn "``((?ce_/\))}{I<($1>}g?ak# p"``$(,+)/<(ike\(?\?a?a+)# pu^
  292.  & ..otnal_ltali
  293.  
  294.      }gexREF: a manpage(      2$(    1?a,ef<yed pla(ef<([^eX,ef<yed righML rin: a m
  295. [^"
  296.  
  297.  "ncludd([ambigr ju)(\([rn "``$e_    ?c    s#([^eX
  298. .&n?a /a?"?(.*?a"?k# pu[rn "``$dowarn     
  299.  a mm hquo
  300. ,efun =>so w=>lus
  301. plaS<([e[^eX.rn     "``$?`$"
  302. [^sBIFSplaplaI
  303. 2s
  304.    
  305. [^;
  306.     #ef<([^eX"rn     "``$:`$"
  307. [^sBIFSplaplaI
  308. 2s"rn "``$} # pugexREF: as/Z<>map&/gtle t
  309. [^" hi't
  310.     sngsw=>"aS<(/^(=: a m
  311.  lel)/g weBIaitehqu wn bjBIFence s again;(/^(=\([rn "``$C>/&nobreak# pu[rn "``$dowarn     evalu   
  312.      =~difma200-\377ma000-\177m; #n    snglizeod <d
  313.  aluffrn     # into {tes E<and > sem heay;rn     # WARNING:em hes E<and > se quote
  314.     E<amp>,E<lt>,E<gt>,rn     # E<usua> with    s/, be inr be qu wed X cnrentge;[BIFly.rn     valu   &into {_es E_and > sevalua;rn     valuvotb   &antttevalua;n hide in votbes m and > aotea
  315.     #.rn     "$1\$-\$$2"aluvotb"a;rn "``$}# pugexREF: #    m h( /C>/&nobrea/  bold# "``$valu   
  316. ;ld# "``$m h(valu !~ map( bo    a mm hin C<>., \ld# as/C>/&nobreak("\\underscorvotb|valu|"    # LREF# "``$} altehold#     X cnr STDERR^"
  317. oe{} aph    s. ligsw
  318.    g  ph 
  319. .\n"REF# and f{} ars need to qu wconr th.
  320.    valu nceiteho wtriaEF# and-
  321.         s/ote
  322. [^rvotbEF# a(vs nes   
  323. alua =~d9]+|W)/;
  324.  /gREF# anL qvs nes   
  325. alua =~d9]+[e;
  326. >,ap"'\-^{}()*+?;
  327. ])/;
  328.  /gREF# a@fngs,
  329.   g s (!/[ vs nes]/,@ tx_votb_fngs,s);ld# as/C>/&nobreak("\\underscorvotb$fngs,[0]
  330. alu$fngs,[0]"    # LREF# "``$}EF# }le ($m} # Expand po again; eas es re
  331.     #xpand m h([ \=/( bo    a    a mm hae
  332.     #xpas/\n/ /gREFa(vsmd, vr/[Aa =chauot(' 
  333.   $_  2a;rn vr/[A =~d9]   */(;rn vr/[A =~d9]  *$/(;rnrn m h(defth.
  334. vr/[Aa [rn "``$&and > s;rn } # E vr/[A =oremap($_);
  335.  
  336.  
  337. r/[Aa;rn vr/[A = &into {_es E_and > sevr/[Aa;rnrn m h(vsmd eq 
  338. cut'a [rn "``$vsutt> qu  w;rn "``$$)/g smd = 
  339. cut';rn } #    altm h(vsmd eq 
  340.     1'a [a m    s/^e dire1rn "``$$r/[A =~d9]   */(;$$r/[A =~d9]  *$/(;rn "``$X cnr LATEX`$"\n\  ubsBIFSpl*{$r/[A}";rn "``$back so{}"x
  341. TeXr
  342. # p"``$($o{}"x
  343. = vr/[Aa =~d9] (An+)/<|T  \(?\/(i *
  344. ;
  345. ovre'A'like 'T  'rn "``$bao{}"x
  346. plt Cthoteh    s qu wngschs/^e 
  347. [^f;
  348. quTeXw
  349.  t.otn # H "``$
  350.     seas e$
  351.  t$(@    1_f;
  352. q_
  353.  t.otn a [rn  m h(vo{}"x
  354. =~ m^$
  355.  t/a [rn  "``$gu o^f;
  356. q
  357.  t.;rn     }rn "``$}# p"``$X cnr LATEX`$"%\n\ o{}"x{vo{}"x}\n" m h(vo{}"xa;rn "`f;
  358. q
  359.  t.:rn "``$$)/g smd = 
  360.     1';rn } #    altm h(vsmd eq 
  361.     2'a [a m    s/^e dire2rn "``$$r/[A =~d9]   */(;$$r/[A =~d9]  *$/(;rn "``$X cnr LATEX`$"\n\  ubsubsBIFSpl*{$r/[A}";rn "``$back so{}"x
  362. TeXr
  363. # p"``$($o{}"x
  364. = vr/[Aa =~d9] (An+)/<|T  \(?\/(i *
  365. ;
  366. ovre'A'like 'T  'rn "``$vo{}"x
  367. =~ 9] Exampl \(*[1-9][0-9]*\(*:  */(;$
  368. ;
  369. ovre'Exampl  :'rn "``$X cnr LATEX`$"%\n\ o{}"x{vo{}"x}\n"  m h(vo{}"xa;rn "``$$)/g smd = 
  370.     2';rn } #    altm h(vsmd eq 
  371. ovrr'a [a m1 l   #ing pila(elist> quenvironmTeXrn "``$Xush(@o{}"eX,vo{}"nta;rn "``$$o{}"nt
  372. = vr/[A + 0;rn "``$$)/g smd = 
  373. ovrr';rn } #    altm h(vsmd eq 
  374. e ge'a [a m1 l   #iok sotea
  375. list> quenvironmTeXrn "``$$o{}"nt
  376. = pop(@o{}"eXa;rn "``$warla"Unngsch.
  377. =e ge\n" unlin; defth.
  378. vo{}"eX;rn "``$$)ist> qsmd = pop(@)ist> qsmda;rn "``$X cnr LATEX`$"\n\ "ed{$)ist> qsmd}\n"  m h(v)ist> qsmda;rn "``$$)/g smd = 
  379. e ge';rn } #    altm h(vsmd eq 
  380. ing
  381. 'a [a ma
  382.     sg
  383.  
  384.    g  ph g   tsrn "``$m h(v)/g smd eq 
  385. ovrr'a [a mm h<> havreju[A e..ot.
  386. list> quenvrn     # se> fhate direotelistuenvironmTeXh<> with  .rn  m h(vr/[A =~d/^[0-9]\.?/a [a mm hn =>s,
  387.     s/^rn  "``$$)ist> qsmd = 'en =>s,.o';rn     } altm h(vr/[A =~d/^\*\(*/a [a mm h*
  388.     s/^rn  "``$$)ist> qsmd = '    sg
  389. ize';rn     } altm h(vr/[A =~d/^[^*][A =~d/^ =~d/ eq 
  390. Ks s/^rn  "``$$)ist> qsmdn CcripbsBI
  391. ize';rn     }e t/a [rn  "``$waunknownreotelhate his
  392. ma
  393.     m h(v"
  394.  t.;rn         "``$X cnr LATEX`$"beg`$d pla⌠╕ìcnr LATEX`$"beg`$d pla⌠╕ìcnr LATEX`$"beg`$,mda;rn "``$$)/g smd vr/[A =~d/q 
  395. ovrr'₧
  396.     m h(v"
  397.  tk s$o{}"ìIllcn/^r'aS<(['xpas/\n/(elis
  398. lispn     ere2rn[a mm :pla⌠╕ì$o{}"ìaS<([e$bn  S<([$back so{/[A =ov)/g smd edn Ccripbs'a [o';rn     } a"
  399.  tk sd9]   */(;$$/a [a+ mm
  400. ;
  401. ovre'A'like     s/^rn  "``$$)isTEX`$"beg`$d pla⌠╕S<([$backsTEX`$"beg`$d p{⌠╕ìf rn "``$g smrn "`$)/g smd vr/[A =~d/dn Ccripbs'a [;rn     } a"
  402.  tk sd9]   */(;$$[a mm /^" hiA'like ^rn  "``$$)isTEX`$"beg`$d pla⌠╕S<([$backsTEX`$"beg`$d p{⌠╕ìf rn "``$g smrn "`$)/g smd vr/[em hae
  403.  ize';rn     }e
  404.  t.;$)isTEX`$"beg`$d pla⌠╕S<([[rn "`]$d pla⌠╕S<([Ela⌠╕S<([[rn "`]$d pla p  tsrn "``$m Yvr/[A 4: sd9]   */(;$$[a mm /^" hiA'like{╛φ hlu ½hlu ½hlu   k sd9]   ([r$"ck t.;;
  405. q_ ½hlu  *$/(;r    #eshor"eXr|r"à>┬ hr"ù
  406. ovre'A'like 'Tr/[em (\S*)}/x_votb_} a"
  407.  tk lesh([r"à>┬ hr"ùli< 4'like ^rà>┬   *$/(ov"hlula p  tsrna
  408.     m h(v"
  409. rà>┬   *$/(ov"nola p  tsrn "``$m   wrà>┬] (An+)/<|T  \(?\/(k sd9e
  410.  ke "perl
  411. qag"d, vr/ithkip 'perl
  412. qag.e
  413. \n"     LATEXno (An+a p  tsrn "``$m   # pup"nt
  414. =([r$"ck t/[Ae
  415.  entgval⌠╕ì$ge(vsAel      =(n+t)/<|T  \(?\/( edn CcribsubsBI2a;rn     g`$d pla⌠╕Snewlist> havrej edn CcribsubsBIFSpl*{    g`$d pla⌠╕S|T  lisgrn ace havrej edn CcribsubsB[A-Z]$fngs,[0]"    x_vot`$d pla⌠╕Ss, entgva \(?\/(i *
  416. ;
  417. ovredn Ccrilike 'T TEX`+"beg`$d pla⌠╕Sl;;
  418. q_ ½'*]*\(*:  */(;$
  419. ;
  420. ovr 'rn "``$vo{}"x
  421. =~ 99] Exampl \(*[1-9][0-9]*\(*:  */(;$
  422. ;
  423. ovrl  :'rn "``$X cnr[.]IFSpl*{$"%\n\ o{}pla⌠╕S<(eXw
  424. *\(*:  */(;$
  425. ;
  426. ovrl  \wIFSpl*{    g`$d pla⌠╕S1o wtr(eXw
  427. 's<> witentgv ", @[1-9]!$o{}" "votbbebEF#/ote
  428. make/(;$
  429. or"eXr|*/(;$
  430. ;
  431. ov"v""rn     g`witentgv "r"eXr|*/(;$
  432. ;
  433. ov@v"@rn     g`witentgv @r"eXr|*/(;$
  434. ;
  435. ov!v"!rn     g`witentgv ! \(?\/(i e'A'2=re'A'like 'T TEX`+"beg$d pla⌠╕S<$/(;rn "``$X2
  436. ;
  437. ov"v""rn     g`witentgv "r"eXr|*``$X2
  438. ;
  439. ov@v"@rn     g`witentgv @r"eXr|*``$X2
  440. ;
  441. ov!v"!rn     g`witentgv ! \(?\/(k sd9e
  442.  ke "(perlfunc|perlvar)"mdn Ccwhen doc½hluperlfunc,perlvar<> wittakeTeXw
  443.  t.╕S1 "`wordt/[A"ck t.;;
  444. q_ (v"
  445. rà(;$
  446. ;
  447. ovr [^{}\s[0]({.*})? [^{}\s[0]X`+.*/\1\2\3*{$r/    *``$X2
  448. ;
  449. ovr [^{}\s[0]({.*})? [^{}\s[0]X`+.*/\1\2\3*{$r/ tsrn "``$m q
  450.  t.;rn     }rn "[A-Za-z\$@%] p"``$X cnr #  wrà>┬] /g smd el      _(n+t_/<|T @TeX_# pu_ _/<|T X`$"beg`$d pla⌠╕ìcn`$$)/g smd = 
  451.    \@*``$X2}% "``$$) tsrn "``$no (An+(vsmd eqg
  452.  
  453.    g  ph g   tsrn "`e
  454. \p"``$Xd eqgg$d pcogni    m t.╕Se
  455.  di pctive, a"``$ opg hs)
  456.  
  457.     g  ph g   tsrn "`e
  458. \p"``$ Xd eqgcnr #  pcogni    m t.╕Se
  459.  di pctive, a"``$ opg hs)
  460.  
  461.    g  pe"``$Xd eqvo{}"eX; pcognize
  462.  di pctive:   ts "``$$)    tsrn " tsrTEX`$"beg` = 'en $
  463.     :pla⌠╕ì$$)&plaappl`$$)$_
  464. ov&cl;;r_ $ plap  _)`$$)$_
  465. ov&exp⌠╕ì_HTML_plaappl  _)`$$$$)#]   ([r$([es?/a ovrr'a [asbegllowal⌠╕ /g smddpclvrr<([[,$$)#]~d9]p(@oS<(b[eakor"eu[A e..ot.
  466. list>[a mm &&/(;$$[a mm /^" hiA'like{ist>hlu  && rà>┬   *$/(ist"nolp"``$Xd eqpla⌠╕S<([Ela⌠╕S\hfilS\S\``$$) tsr mm /^" hiA'like{╛φ nosg
  467.  
  468.    gpla⌠╕S<([Ela⌠╕S<",$_;   tsrn ";rn     pla⌠╕S<([Ela⌠╕S<";  close(POD);  close(<([El)`$$$$$$#########################################################################$$$$sub do_hdr"``$  eqpla⌠╕S<([Ela"%S<aTeX docu.?/a plodu$bn bySe
  469. 2l
  470. ;
  471. x floe{\"9e
  472. .e
  473. \".S<";    eqpla⌠╕S<([Ela"%S0-9begllowrn     Snebn bep(@)ist>      =([r$([eamblvr/[A{}"s docu.?/a:S<";    eqpla⌠╕S<([Ela"%\\(@)\\C++{r/[re{C/[kern-.05em/[rai    m.3  \\hboxr/[egotntgvaize ++}}}S<";    eqpla⌠╕S<([Ela"%\\(@)\\u(Anrsc$ pr/[l;;vevm
  474. e/[kern.04em/[vboxr/[hrulvrwrd}" 0.4k t.;m /^ 0.3pt}}S<";    eqpla⌠╕S<([Ela"%\\    mtlesh([r/[ovrsmda;r}{0pt}S<";    eqpla⌠╕S<([Ela"S<";    eq9e
  475. q
  476. ov&elaapp_(n+_sppcials("SU9e
  477. \E");    eqpla⌠╕S<([Ela"S\    mc<([[{9e
  478. q}% "``$$  eqpla⌠╕S<([Ela"S\g smd =e
  479. q}";    eqpla⌠╕S<([Ela"S<";  }$$$$sub nob[eak"``$  eqmyq9# pu_ 
  480. ovshift;    eq9# pu_ 
  481. o
  482. ov +/~rn     g# TeX `$ @oS<(b[eak    eq9# pu_ ;  }$$$$sub no plap"``$  eqlocal(${}"_ _to_hism)
  483. ovshift;    eq9{}"_ _to_hism
  484. o
  485.  p/\000-\177/\200-\377/;    eq ptu{}"9{}"_ _to_hism;  }$$$$sub "_it_ $ plap"``$X# elaapp high(bito wtrachiAs      =     ~d9]# peam`$Xov([\200-\377])/"E<".ord($1).">"rnm;  }$$$$sub cl;;r_ $ plap"``$  eqlocal(${mp)
  486. ovshift;    eq9{mp
  487. o
  488.  p/\200-\377/\000-\177/;    eq ptu{}"9{mp;  }$$$$sub exp⌠╕ì_HTML_plaappl"``$  eqlocal($s)
  489. ov$_[0];    eq9#
  490. o
  491. o"` E<((\d+)|([A-Za-z]+))>rn " tsr``$Xdo"``$X (@)ist>($2)
  492. `$X ? do"`o wr($2)
  493. X`$"b: $$) tsrex   o"$HTML_Elaappl{$3n "``$m ? do"`o$HTML_Elaappl{$3nrn "``$m : do"``$X vo{}"eX;known elaapp:  &      =$_$g smr"E<$1>``$$) tsrn "`    tsrnegx;    eq ptu{}"9s;  }$$$$sub elaappl"``$  eq#
  494. make C++      otb\C++,cwhi w½hluotbbeb(@)ist> as`$  eq#
  495. \(@)\C++{r/re{C/kern-.05em/rai    m.3  \hboxr/egotntgvaize ++}}}`$  eqsBIbC/+/+/\\C++{}/ ;  }$$$$# Transl
  496. ;
  497. ]p(# pu_ 
  498.      otba TeX \tt(# pu_ 
  499. otbobt      =a verbr<(mqpla⌠╕Snt
  500. .$$# TeX sppcialo wtrachiAs dn  elaappn byS\.$$# T}"s aanbbebEF#/otesism
  501. /[A<aTeX :pla⌠╕ì dngu.?/as.$$# Web(on'tbEF#A<aTeX \verb stecr$"cb(oeln'tbworkotesism
  502. /[A:pla⌠╕ì dngu.?/as.$$sub alltt(``$  eqlocal($s p)
  503. ovshift;  X# o([rro wtrluowtnb#,\,$,%,&,{,},_,\,^,~ ([[1-9]]oteclusmd).    eq9# p
  504. o
  505. ov [^${backsl
  506. sh_plaapablvs}\S\^\~]+)/& $ plap "$&")/eg;  X#  wtrlu#,\,$,%,&,{,}eq=>] /# , ...    eq9# p
  507. o
  508. ov [$backsl
  509. sh_plaapablvs2])/& $ plap "S\$&")/eg;  X#  wtrlu_,\,^,~ q=>] / wtr`\_ , ...    eq9# p
  510. o
  511. ov_/& $ plap "S\ wtr`\\_")/eg;    eq9# p
  512. o
  513. ov\\/& $ plap "S\ wtr`\\S\`)rnm;    eq9# p
  514. o
  515. ov\^/S\ wtr`\\^/g;    eq9# p
  516. o
  517. ov\~/S\ wtr`\\~/g;      eq9# p
  518. o
  519.  p/\200-\377/\000-\177/;    )#]~d9]back    eq9# p
  520. o "r/[tt(".9# p."}";g` = make i9]p(\tt(# pu_     eq ptu{}"9s p;  }$$$$sub elaapp_(n+_sppcials(``$  eqlocal($s p)
  521. ovshift;  X# o([rro wtrluowtnb#,\,$,%,&,{,}, u_,\,^,~ ([[1-9]]oteclusmd).    eq# backsl
  522. sh plaapablvo wtrachiAs #,\,$,%,&,{,}en+cept(_.    eq9# p
  523. o
  524. ov [$backsl
  525. sh_plaapablvs2])/& $ plap "S\$1`)rnm;    eq9# p
  526. o
  527. ov_/& $ plap "S\u(Anrsc$ pr}`)rnm;X# \_ hluotoA{}"n.    eq# entgv TeX sppcialo wtrachiAs |, ^, ~,S\.$$  eq9# p
  528. o
  529. ov\|/& $ plap "S$|S$`)rnm;    eq9# p
  530. o
  531. ov\^/& $ plap "S$/[hatr/[hspacpr0.4k }}S$`)rnm;    eq9# p
  532. o
  533. ov\~/& $ plap "S$/[tilder/[hspacpr0.4k }}S$`)rnm;    eq9# p
  534. o
  535. ov\\/& $ plap "S$/[backsl
  536. sh{}S$`)rnm;    eq#o wtrachiAs nebn otbbeb peate
  537.  diffiA?/aly      =TeX    eq#o*    eq9# p
  538. o
  539. ov[*]/& $ plap "S$/[.otS$`)rnm;    eq#oelaapp <[1-9]> a"`la}" # pu_ ,    eq9# p
  540. o
  541. ov</& $ plap "S$<S$`)rnm;    eq9# p
  542. o
  543. ov>/& $ plap "S$>S$`)rnm;    eq9# p
  544. o
  545.  p/\200-\377/\000-\177/;    )#]~d9]back    eq ptu{}"9s p;  }$$$$sub a⌠╕ernal_l pfs(``$  eqlocal($_)
  546. ovshift;  `$  eqs{L<v [^>]+)>}{$1}g;    eqmy(@à>┬  )
  547. ovsplà>( v ?:,?\s+ ?:1-9\s+)?)r );    eqmyq9 pt# p
  548. o "([r$";    eqmyq9i;    eqfop
  549. ($i
  550. o 0;q9i <ov$#à>┬  ;q9i++p"``$X9 pt# p
  551. .o "C<rà>┬  [rà]>``$$)9 pt# p
  552. .o ", "]   @à>┬  ]> 2 && rà !ov$#à>┬  ;$$)9 pt# p
  553. .o "[1-9]"]   9i+2 == @à>┬  ;   tsrn " tsr mpt# p
  554. .o "[?/ar"[.
  555. ( @à>┬  ]> 1m ? "ies"[: "y"[)$$) tsr.
  556.  "[?lsew[rre      =(["s docu.?/a";  `$  eq ptu{}"9mpt# p;  }$$$$# lap"/[AHTML elaappl"otbTeX elaappl.$$BEGIN"``$%HTML_Elaappl
  557. o (`$  eq'amp'    =>    '&',)#]eqampiAs1-9`$  eq'lt'    =>    '<',)#]eqlefto wevron,qless-owtn`$  eq'gt'    =>    '>',)#]eqmm /^o wevron,qgpeater-owtn`$  eq'entg'    =>    '"',)#]eqdoublvoentgv  `$  eq"Aacugv"    =>    "S\'{A}",)#]eqaapitaloA,qacugvqacc?/a`$  eq"aacugv"    =>    "S\'{a}",)#]eqsmallqa,qacugvqacc?/a`$  eq"Acirc"    =>    "S\^{A}",)#]eqaapitaloA,qcircumfl
  558. x acc?/a`$  eq"acirc"    =>    "S\^{a}",)#]eqsmallqa,qcircumfl
  559. x acc?/a`$  eq"AElig"    =>    'S\AE',))#]eqaapitaloAE diphtho_ 
  560. (ligatu{e)`$  eq"aelig"    =>    'S\ae',))#]eqsmallqae diphtho_ 
  561. (ligatu{e)`$  eq"Agr;ve"    =>    "S\`{A}",)#]eqaapitaloA,qgr;ve acc?/a`$  eq"agr;ve"    =>    "S\`{a}",)#]eqsmallqa,qgr;ve acc?/a`$  eq"Apu_ "    =>    'S\u{A}',)#]eqaapitaloA,qpu_     eq"apu_ "    =>    'S\u{a}',)#]eqsmallqa,qpu_     eq"Atilde"    =>    'S\~{A}',)#]eqaapitaloA,qtilde    eq"atilde"    =>    'S\~{a}',)#]eqsmallqa,qtilde    eq"Auml"    =>    'S\"{A}',)#]eqaapitaloA,qdirres"s op
  562. umlad9]mark    eq"auml"    =>    'S\"{a}',)#]eqsmallqa,qdirres"s op
  563. umlad9]mark    eq"Ccedil"    =>    'S\c{C}',)#]eqaapitaloC,qcedilla    eq"ccedil"    =>    'S\c{c}',)#]eqsmallqc,qcedilla    eq"Eacugv"    =>    "S\'{E}",)#]eqaapitaloE,qacugvqacc?/a`$  eq"eacugv"    =>    "S\'{e}",)#]eqsmallqe,qacugvqacc?/a`$  eq"Ecirc"    =>    "S\^{E}",)#]eqaapitaloE,qcircumfl
  564. x acc?/a`$  eq"ecirc"    =>    "S\^{e}",)#]eqsmallqe,qcircumfl
  565. x acc?/a`$  eq"Egr;ve"    =>    "S\`{E}",)#]eqaapitaloE,qgr;ve acc?/a`$  eq"egr;ve"    =>    "S\`{e}",)#]eqsmallqe,qgr;ve acc?/a`$  eq"ETH"    =>    'S\OE',))#]eqaapitaloEth,qIc?l1-9ic`$  eq"eth"    =>    'S\oe',))#]eqsmallqeth,qIc?l1-9ic`$  eq"Euml"    =>    'S\"{E}',)#]eqaapitaloE,qdirres"s op
  566. umlad9]mark    eq"euml"    =>    'S\"{e}',)#]eqsmallqe,qdirres"s op
  567. umlad9]mark    eq"Iacugv"    =>    "S\'{I}",)#]eqaapitaloI,qacugvqacc?/a`$  eq"iacugv"    =>    "S\'{i}",)#]eqsmallqi,qacugvqacc?/a`$  eq"Icirc"    =>    "S\^{I}",)#]eqaapitaloI,qcircumfl
  568. x acc?/a`$  eq"icirc"    =>    "S\^{i}",)#]eqsmallqi,qcircumfl
  569. x acc?/a`$  eq"Igr;ve"    =>    "S\`{I}",)#]eqaapitaloI,qgr;ve acc?/a`$  eq"igr;ve"    =>    "S\`{i}",)#]eqsmallqi,qgr;ve acc?/a`$  eq"Iuml"    =>    'S\"{I}',)#]eqaapitaloI,qdirres"s op
  570. umlad9]mark    eq"iuml"    =>    'S\"{i}',)#]eqsmallqi,qdirres"s op
  571. umlad9]mark    eq"Ntilde"    =>    'S\~{N}',)#]eqaapitaloN,qtilde    eq"ntilde"    =>    'S\~{n}',)#]eqsmallqn,qtilde    eq"Oacugv"    =>    "S\'{O}",)#]eqaapitaloO,qacugvqacc?/a`$  eq"oacugv"    =>    "S\'{o}",)#]eqsmallqo,qacugvqacc?/a`$  eq"Ocirc"    =>    "S\^{O}",)#]eqaapitaloO,qcircumfl
  572. x acc?/a`$  eq"ocirc"    =>    "S\^{o}",)#]eqsmallqo,qcircumfl
  573. x acc?/a`$  eq"Ogr;ve"    =>    "S\`{O}",)#]eqaapitaloO,qgr;ve acc?/a`$  eq"ogr;ve"    =>    "S\`{o}",)#]eqsmallqo,qgr;ve acc?/a`$  eq"Osl
  574. sh"    =>    "S\O",))#]eqaapitaloO,qsl
  575. sh`$  eq"osl
  576. sh"    =>    "S\o",))#]eqsmallqo,qsl
  577. sh`$  eq"Otilde"    =>    "S\~{O}",)#]eqaapitaloO,qtilde    eq"otilde"    =>    "S\~{o}",)#]eqsmallqo,qtilde    eq"Ouml"    =>    'S\"{O}',)#]eqaapitaloO,qdirres"s op
  578. umlad9]mark    eq"ouml"    =>    'S\"{o}',)#]eqsmallqo,qdirres"s op
  579. umlad9]mark    eq"szlig"    =>    'S\ss{}',)#]eqsmallqswtrpqs,qGrrman (sz ligatu{e)`$  eq"THORN"    =>    'S\L',))#]eqaapitaloTHORN,qIc?l1-9ic`$  eq"thorn"    =>    'S\l',,))#]eqsmallqthorn,qIc?l1-9ic`$  eq"Uacugv"    =>    "S\'{U}",)#]eqaapitaloU,qacugvqacc?/a`$  eq"uacugv"    =>    "S\'{u}",)#]eqsmallqu,qacugvqacc?/a`$  eq"Ucirc"    =>    "S\^{U}",)#]eqaapitaloU,qcircumfl
  580. x acc?/a`$  eq"ucirc"    =>    "S\^{u}",)#]eqsmallqu,qcircumfl
  581. x acc?/a`$  eq"Ugr;ve"    =>    "S\`{U}",)#]eqaapitaloU,qgr;ve acc?/a`$  eq"ugr;ve"    =>    "S\`{u}",)#]eqsmallqu,qgr;ve acc?/a`$  eq"Uuml"    =>    'S\"{U}',)#]eqaapitaloU,qdirres"s op
  582. umlad9]mark    eq"uuml"    =>    'S\"{u}',)#]eqsmallqu,qdirres"s op
  583. umlad9]mark    eq"Yacugv"    =>    "S\'{Y}",)#]eqaapitaloY,qacugvqacc?/a`$  eq"yacugv"    =>    "S\'{y}",)#]eqsmallqy,qacugvqacc?/a`$  eq"yuml"    =>    'S\"{y}',)#]eqsmallqy,qdirres"s op
  584. umlad9]mark  );  }$$__END__$$:?/dofpiAl$$