<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package Pod::LaTeX;

# Copyright (C) 2000 by Tim Jenness &lt;t.jenness@jach.hawaii.edu&gt;
# All Rights Reserved.

=head1 NAME

Pod::LaTeX - Convert Pod data to formatted Latex

=head1 SYNOPSIS

  use Pod::LaTeX;
  my $parser = Pod::LaTeX-&gt;new ( );

  $parser-&gt;parse_from_filehandle;

  $parser-&gt;parse_from_file ('file.pod', 'file.tex');

=head1 DESCRIPTION

C&lt;Pod::LaTeX&gt; is a module to convert documentation in the Pod format
into Latex. The L&lt;B&lt;pod2latex&gt;|pod2latex&gt; X&lt;pod2latex&gt; command uses
this module for translation.

C&lt;Pod::LaTeX&gt; is a derived class from L&lt;Pod::Select|Pod::Select&gt;.

=cut


use strict;
require Pod::ParseUtils;
use base qw/ Pod::Select /;

# use Data::Dumper; # for debugging
use Carp;

use vars qw/ $VERSION %HTML_Escapes @LatexSections /;

$VERSION = '0.53';

# Definitions of =headN -&gt; latex mapping
@LatexSections = (qw/
		  chapter
		  section
		  subsection
		  subsubsection
		  paragraph
		  subparagraph
		  /);

# Standard escape sequences converted to Latex
# Up to "yuml" these are taken from the original pod2latex
# command written by Taro Kawagish (kawagish@imslab.co.jp)

%HTML_Escapes = (
    'amp'       =&gt;      '&amp;',      #   ampersand
    'lt'        =&gt;      '$&lt;$',    #   ' left chevron, less-than
    'gt'        =&gt;      '$&gt;$',    #   ' right chevron, greater-than
    'quot'      =&gt;      '"',      #   double quote
    'sol'       =&gt;      '/',
    'verbar'    =&gt;      '$|$',

    "Aacute"    =&gt;      "\\'{A}",       #   capital A, acute accent
    "aacute"    =&gt;      "\\'{a}",       #   small a, acute accent
    "Acirc"     =&gt;      "\\^{A}",       #   capital A, circumflex accent
    "acirc"     =&gt;      "\\^{a}",       #   small a, circumflex accent
    "AElig"     =&gt;      '\\AE',         #   capital AE diphthong (ligature)
    "aelig"     =&gt;      '\\ae',         #   small ae diphthong (ligature)
    "Agrave"    =&gt;      "\\`{A}",       #   capital A, grave accent
    "agrave"    =&gt;      "\\`{a}",       #   small a, grave accent
    "Aring"     =&gt;      '\\u{A}',       #   capital A, ring
    "aring"     =&gt;      '\\u{a}',       #   small a, ring
    "Atilde"    =&gt;      '\\~{A}',       #   capital A, tilde
    "atilde"    =&gt;      '\\~{a}',       #   small a, tilde
    "Auml"      =&gt;      '\\"{A}',       #   capital A, dieresis or umlaut mark
    "auml"      =&gt;      '\\"{a}',       #   small a, dieresis or umlaut mark
    "Ccedil"    =&gt;      '\\c{C}',       #   capital C, cedilla
    "ccedil"    =&gt;      '\\c{c}',       #   small c, cedilla
    "Eacute"    =&gt;      "\\'{E}",       #   capital E, acute accent
    "eacute"    =&gt;      "\\'{e}",       #   small e, acute accent
    "Ecirc"     =&gt;      "\\^{E}",       #   capital E, circumflex accent
    "ecirc"     =&gt;      "\\^{e}",       #   small e, circumflex accent
    "Egrave"    =&gt;      "\\`{E}",       #   capital E, grave accent
    "egrave"    =&gt;      "\\`{e}",       #   small e, grave accent
    "ETH"       =&gt;      '\\OE',         #   capital Eth, Icelandic
    "eth"       =&gt;      '\\oe',         #   small eth, Icelandic
    "Euml"      =&gt;      '\\"{E}',       #   capital E, dieresis or umlaut mark
    "euml"      =&gt;      '\\"{e}',       #   small e, dieresis or umlaut mark
    "Iacute"    =&gt;      "\\'{I}",       #   capital I, acute accent
    "iacute"    =&gt;      "\\'{i}",       #   small i, acute accent
    "Icirc"     =&gt;      "\\^{I}",       #   capital I, circumflex accent
    "icirc"     =&gt;      "\\^{i}",       #   small i, circumflex accent
    "Igrave"    =&gt;      "\\`{I}",       #   capital I, grave accent
    "igrave"    =&gt;      "\\`{i}",       #   small i, grave accent
    "Iuml"      =&gt;      '\\"{I}',       #   capital I, dieresis or umlaut mark
    "iuml"      =&gt;      '\\"{i}',       #   small i, dieresis or umlaut mark
    "Ntilde"    =&gt;      '\\~{N}',       #   capital N, tilde
    "ntilde"    =&gt;      '\\~{n}',       #   small n, tilde
    "Oacute"    =&gt;      "\\'{O}",       #   capital O, acute accent
    "oacute"    =&gt;      "\\'{o}",       #   small o, acute accent
    "Ocirc"     =&gt;      "\\^{O}",       #   capital O, circumflex accent
    "ocirc"     =&gt;      "\\^{o}",       #   small o, circumflex accent
    "Ograve"    =&gt;      "\\`{O}",       #   capital O, grave accent
    "ograve"    =&gt;      "\\`{o}",       #   small o, grave accent
    "Oslash"    =&gt;      "\\O",          #   capital O, slash
    "oslash"    =&gt;      "\\o",          #   small o, slash
    "Otilde"    =&gt;      "\\~{O}",       #   capital O, tilde
    "otilde"    =&gt;      "\\~{o}",       #   small o, tilde
    "Ouml"      =&gt;      '\\"{O}',       #   capital O, dieresis or umlaut mark
    "ouml"      =&gt;      '\\"{o}',       #   small o, dieresis or umlaut mark
    "szlig"     =&gt;      '\\ss{}',       #   small sharp s, German (sz ligature)
    "THORN"     =&gt;      '\\L',          #   capital THORN, Icelandic
    "thorn"     =&gt;      '\\l',,         #   small thorn, Icelandic
    "Uacute"    =&gt;      "\\'{U}",       #   capital U, acute accent
    "uacute"    =&gt;      "\\'{u}",       #   small u, acute accent
    "Ucirc"     =&gt;      "\\^{U}",       #   capital U, circumflex accent
    "ucirc"     =&gt;      "\\^{u}",       #   small u, circumflex accent
    "Ugrave"    =&gt;      "\\`{U}",       #   capital U, grave accent
    "ugrave"    =&gt;      "\\`{u}",       #   small u, grave accent
    "Uuml"      =&gt;      '\\"{U}',       #   capital U, dieresis or umlaut mark
    "uuml"      =&gt;      '\\"{u}',       #   small u, dieresis or umlaut mark
    "Yacute"    =&gt;      "\\'{Y}",       #   capital Y, acute accent
    "yacute"    =&gt;      "\\'{y}",       #   small y, acute accent
    "yuml"      =&gt;      '\\"{y}',       #   small y, dieresis or umlaut mark

    # Added by TimJ

    "iexcl"  =&gt;   '!`',           # inverted exclamation mark
#    "cent"   =&gt;   ' ',        # cent sign
    "pound"  =&gt;   '\pounds',      # (UK) pound sign
#    "curren" =&gt;   ' ',        # currency sign
#    "yen"    =&gt;   ' ',        # yen sign
#    "brvbar" =&gt;   ' ',        # broken vertical bar
    "sect"   =&gt;   '\S',           # section sign
    "uml"    =&gt;   '\"{}',        # diaresis
    "copy"   =&gt;   '\copyright',   # Copyright symbol
#    "ordf"   =&gt;   ' ',        # feminine ordinal indicator
    "laquo"  =&gt;   '$\ll$',      # ' # left pointing double angle quotation mark
    "not"    =&gt;   '$\neg$',       # '  # not sign
    "shy"    =&gt;   '-',            # soft hyphen
#    "reg"    =&gt;   ' ',        # registered trademark
    "macr"   =&gt;   '$^-$',         # ' # macron, overline
    "deg"    =&gt;   '$^\circ$',     # '  # degree sign
    "plusmn" =&gt;   '$\pm$',        # ' # plus-minus sign
    "sup2"   =&gt;   '$^2$',         # ' # superscript 2
    "sup3"   =&gt;   '$^3$',         # ' # superscript 3
    "acute"  =&gt;   "\\'{}",        # acute accent
    "micro"  =&gt;   '$\mu$',        # micro sign
    "para"   =&gt;   '\P',           # pilcrow sign = paragraph sign
    "middot" =&gt;   '$\cdot$',      # middle dot = Georgian comma
    "cedil"  =&gt;   '\c{}',        # cedilla
    "sup1"   =&gt;   '$^1$',         # ' # superscript 1
#    "ordm"   =&gt;   ' ',        # masculine ordinal indicator
    "raquo"  =&gt;   '$\gg$',     # ' # right pointing double angle quotation mark
    "frac14" =&gt;   '$\frac{1}{4}$',   # ' # vulgar fraction one quarter
    "frac12" =&gt;   '$\frac{1}{2}$',   # ' # vulgar fraction one half
    "frac34" =&gt;   '$\frac{3}{4}$',   # ' # vulgar fraction three quarters
    "iquest" =&gt;   "?'",              # inverted question mark
    "times"  =&gt;   '$\times$',        # ' # multiplication sign
    "divide" =&gt;   '$\div$',          # division sign

    # Greek letters using HTML codes
    "alpha"  =&gt;   '$\alpha$',   # '
    "beta"   =&gt;   '$\beta$',    # '
    "gamma"  =&gt;   '$\gamma$',   # '
    "delta"  =&gt;   '$\delta$',   # '
    "epsilon"=&gt;   '$\epsilon$', # '
    "zeta"   =&gt;   '$\zeta$',    # '
    "eta"    =&gt;   '$\eta$',     # '
    "theta"  =&gt;   '$\theta$',   # '
    "iota"   =&gt;   '$\iota$',    # '
    "kappa"  =&gt;   '$\kappa$',   # '
    "lambda" =&gt;   '$\lambda$',  # '
    "mu"     =&gt;   '$\mu$',      # '
    "nu"     =&gt;   '$\nu$',      # '
    "xi"     =&gt;   '$\xi$',      # '
    "omicron"=&gt;   '$o$',        # '
    "pi"     =&gt;   '$\pi$',      # '
    "rho"    =&gt;   '$\rho$',     # '
    "sigma"  =&gt;   '$\sigma$',   # '
    "tau"    =&gt;   '$\tau$',     # '
    "upsilon"=&gt;   '$\upsilon$', # '
    "phi"    =&gt;   '$\phi$',     # '
    "chi"    =&gt;   '$\chi$',     # '
    "psi"    =&gt;   '$\psi$',     # '
    "omega"  =&gt;   '$\omega$',   # '

    "Alpha"  =&gt;   '$A$',   # '
    "Beta"   =&gt;   '$B$',    # '
    "Gamma"  =&gt;   '$\Gamma$',   # '
    "Delta"  =&gt;   '$\Delta$',   # '
    "Epsilon"=&gt;   '$E$', # '
    "Zeta"   =&gt;   '$Z$',    # '
    "Eta"    =&gt;   '$H$',     # '
    "Theta"  =&gt;   '$\Theta$',   # '
    "Iota"   =&gt;   '$I$',    # '
    "Kappa"  =&gt;   '$K$',   # '
    "Lambda" =&gt;   '$\Lambda$',  # '
    "Mu"     =&gt;   '$M$',      # '
    "Nu"     =&gt;   '$N$',      # '
    "Xi"     =&gt;   '$\Xi$',      # '
    "Omicron"=&gt;   '$O$',        # '
    "Pi"     =&gt;   '$\Pi$',      # '
    "Rho"    =&gt;   '$R$',     # '
    "Sigma"  =&gt;   '$\Sigma$',   # '
    "Tau"    =&gt;   '$T$',     # '
    "Upsilon"=&gt;   '$\Upsilon$', # '
    "Phi"    =&gt;   '$\Phi$',     # '
    "Chi"    =&gt;   '$X$',     # '
    "Psi"    =&gt;   '$\Psi$',     # '
    "Omega"  =&gt;   '$\Omega$',   # '


);


=head1 OBJECT METHODS

The following methods are provided in this module. Methods inherited
from C&lt;Pod::Select&gt; are not described in the public interface.

=over 4

=begin __PRIVATE__

=item C&lt;initialize&gt;

Initialise the object. This method is subclassed from C&lt;Pod::Parser&gt;.
The base class method is invoked. This method defines the default
behaviour of the object unless overridden by supplying arguments to
the constructor. 

Internal settings are defaulted as well as the public instance data.
Internal hash values are accessed directly (rather than through
a method) and start with an underscore.

This method should not be invoked by the user directly.

=end __PRIVATE__

=cut



#   - An array for nested lists

# Arguments have already been read by this point

sub initialize {
  my $self = shift;

  # print Dumper($self);

  # Internals
  $self-&gt;{_Lists} = [];             # For nested lists
  $self-&gt;{_suppress_all_para}  = 0; # For =begin blocks
  $self-&gt;{_suppress_next_para} = 0; # For =for blocks
  $self-&gt;{_dont_modify_any_para}=0; # For =begin blocks
  $self-&gt;{_dont_modify_next_para}=0; # For =for blocks
  $self-&gt;{_CURRENT_HEAD1}   = '';   # Name of current HEAD1 section

  # Options - only initialise if not already set

  # Cause the '=head1 NAME' field to be treated specially
  # The contents of the NAME paragraph will be converted
  # to a section title. All subsequent =head1 will be converted
  # to =head2 and down. Will not affect =head1's prior to NAME 
  # Assumes:  'Module - purpose' format
  # Also creates a purpose field
  # The name is used for Labeling of the subsequent subsections
  $self-&gt;{ReplaceNAMEwithSection} = 0
    unless exists $self-&gt;{ReplaceNAMEwithSection};
  $self-&gt;{AddPreamble}      = 1    # make full latex document
    unless exists $self-&gt;{AddPreamble};
  $self-&gt;{StartWithNewPage} = 0    # Start new page for pod section
    unless exists $self-&gt;{StartWithNewPage};
  $self-&gt;{TableOfContents}  = 0    # Add table of contents
    unless exists $self-&gt;{TableOfContents};  # only relevent if AddPreamble=1
   $self-&gt;{AddPostamble}     = 1          # Add closing latex code at end
    unless exists $self-&gt;{AddPostamble}; #  effectively end{document} and index
  $self-&gt;{MakeIndex}        = 1         # Add index (only relevant AddPostamble
    unless exists $self-&gt;{MakeIndex};   # and AddPreamble)

  $self-&gt;{UniqueLabels}     = 1          # Use label unique for each pod
    unless exists $self-&gt;{UniqueLabels}; # either based on the filename
                                         # or supplied

  # Control the level of =head1. default is \section
  # 
  $self-&gt;{Head1Level}     = 1   # Offset in latex sections
    unless exists $self-&gt;{Head1Level}; # 0 is chapter, 2 is subsection

  # Control at which level numbering of sections is turned off
  # ie subsection becomes subsection*
  # The numbering is relative to the latex sectioning commands
  # and is independent of Pod heading level
  # default is to number \section but not \subsection
  $self-&gt;{LevelNoNum} = 2
    unless exists $self-&gt;{LevelNoNum};

  # Label to be used as prefix to all internal section names
  # If not defined will attempt to derive it from the filename
  # This can not happen when running parse_from_filehandle though
  # hence the ability to set the label externally
  # The label could then be Pod::Parser_DESCRIPTION or somesuch

  $self-&gt;{Label}            = undef # label to be used as prefix
    unless exists $self-&gt;{Label};   # to all internal section names

  # These allow the caller to add arbritrary latex code to
  # start and end of document. AddPreamble and AddPostamble are ignored
  # if these are set.
  # Also MakeIndex and TableOfContents are also ignored.
  $self-&gt;{UserPreamble}     = undef # User supplied start (AddPreamble =1)
    unless exists $self-&gt;{Label};
  $self-&gt;{UserPostamble}    = undef # Use supplied end    (AddPostamble=1)
    unless exists $self-&gt;{Label};

  # Run base initialize
  $self-&gt;SUPER::initialize;

}

=back

=head2 Data Accessors

The following methods are provided for accessing instance data. These
methods should be used for accessing configuration parameters rather
than assuming the object is a hash.

Default values can be supplied by using these names as keys to a hash
of arguments when using the C&lt;new()&gt; constructor.

=over 4

=item B&lt;AddPreamble&gt;

Logical to control whether a C&lt;latex&gt; preamble is to be written.
If true, a valid C&lt;latex&gt; preamble is written before the pod data is written.
This is similar to:

  \documentclass{article}
  \begin{document}

but will be more complicated if table of contents and indexing are required.
Can be used to set or retrieve the current value.

  $add = $parser-&gt;AddPreamble();
  $parser-&gt;AddPreamble(1);

If used in conjunction with C&lt;AddPostamble&gt; a full latex document will
be written that could be immediately processed by C&lt;latex&gt;.

=cut

sub AddPreamble {
   my $self = shift;
   if (@_) {
     $self-&gt;{AddPreamble} = shift;
   }
   return $self-&gt;{AddPreamble};
}

=item B&lt;AddPostamble&gt;

Logical to control whether a standard C&lt;latex&gt; ending is written to the output
file after the document has been processed.
In its simplest form this is simply:

  \end{document}

but can be more complicated if a index is required.
Can be used to set or retrieve the current value.

  $add = $parser-&gt;AddPostamble();
  $parser-&gt;AddPostamble(1);

If used in conjunction with C&lt;AddPreaamble&gt; a full latex document will
be written that could be immediately processed by C&lt;latex&gt;.

=cut

sub AddPostamble {
   my $self = shift;
   if (@_) {
     $self-&gt;{AddPostamble} = shift;
   }
   return $self-&gt;{AddPostamble};
}

=item B&lt;Head1Level&gt;

The C&lt;latex&gt; sectioning level that should be used to correspond to
a pod C&lt;=head1&gt; directive. This can be used, for example, to turn
a C&lt;=head1&gt; into a C&lt;latex&gt; C&lt;subsection&gt;. This should hold a number
corresponding to the required position in an array containing the
following elements:

 [0] chapter
 [1] section
 [2] subsection
 [3] subsubsection
 [4] paragraph
 [5] subparagraph

Can be used to set or retrieve the current value:

  $parser-&gt;Head1Level(2);
  $sect = $parser-&gt;Head1Level;

Setting this number too high can result in sections that may not be reproducible
in the expected way. For example, setting this to 4 would imply that C&lt;=head3&gt;
do not have a corresponding C&lt;latex&gt; section (C&lt;=head1&gt; would correspond to
a C&lt;paragraph&gt;).

A check is made to ensure that the supplied value is an integer in the
range 0 to 5.

Default is for a value of 1 (i.e. a C&lt;section&gt;).

=cut

sub Head1Level {
   my $self = shift;
   if (@_) {
     my $arg = shift;
     if ($arg =~ /^\d$/ &amp;&amp; $arg &lt;= $#LatexSections) {
       $self-&gt;{Head1Level} = $arg;
     } else {
       carp "Head1Level supplied ($arg) must be integer in range 0 to ".$#LatexSections . "- Ignoring\n";
     }
   }
   return $self-&gt;{Head1Level};
}

=item B&lt;Label&gt;

This is the label that is prefixed to all C&lt;latex&gt; label and index
entries to make them unique. In general, pods have similarly titled
sections (NAME, DESCRIPTION etc) and a C&lt;latex&gt; label will be multiply
defined if more than one pod document is to be included in a single
C&lt;latex&gt; file. To overcome this, this label is prefixed to a label
whenever a label is required (joined with an underscore) or to an
index entry (joined by an exclamation mark which is the normal index
separator). For example, C&lt;\label{text}&gt; becomes C&lt;\label{Label_text}&gt;.

Can be used to set or retrieve the current value:

  $label = $parser-&gt;Label;
  $parser-&gt;Label($label);

This label is only used if C&lt;UniqueLabels&gt; is true.
Its value is set automatically from the C&lt;NAME&gt; field
if C&lt;ReplaceNAMEwithSection&gt; is true. If this is not the case
it must be set manually before starting the parse.

Default value is C&lt;undef&gt;.

=cut

sub Label {
   my $self = shift;
   if (@_) {
     $self-&gt;{Label} = shift;
   }
   return $self-&gt;{Label};
}

=item B&lt;LevelNoNum&gt;

Control the point at which C&lt;latex&gt; section numbering is turned off.
For example, this can be used to make sure that C&lt;latex&gt; sections
are numbered but subsections are not.

Can be used to set or retrieve the current value:

  $lev = $parser-&gt;LevelNoNum;
  $parser-&gt;LevelNoNum(2);

The argument must be an integer between 0 and 5 and is the same as the
number described in C&lt;Head1Level&gt; method description. The number has
nothing to do with the pod heading number, only the C&lt;latex&gt; sectioning.

Default is 2. (i.e. C&lt;latex&gt; subsections are written as C&lt;subsection*&gt;
but sections are numbered).

=cut

sub LevelNoNum {
   my $self = shift;
   if (@_) {
     $self-&gt;{LevelNoNum} = shift;
   }
   return $self-&gt;{LevelNoNum};
}

=item B&lt;MakeIndex&gt;

Controls whether C&lt;latex&gt; commands for creating an index are to be inserted
into the preamble and postamble

  $makeindex = $parser-&gt;MakeIndex;
  $parser-&gt;MakeIndex(0);

Irrelevant if both C&lt;AddPreamble&gt; and C&lt;AddPostamble&gt; are false (or equivalently,
C&lt;UserPreamble&gt; and C&lt;UserPostamble&gt; are set).

Default is for an index to be created.

=cut

sub MakeIndex {
   my $self = shift;
   if (@_) {
     $self-&gt;{MakeIndex} = shift;
   }
   return $self-&gt;{MakeIndex};
}

=item B&lt;ReplaceNAMEwithSection&gt;

This controls whether the C&lt;NAME&gt; section in the pod is to be translated
literally or converted to a slightly modified output where the section
name is the pod name rather than "NAME".

If true, the pod segment

  =head1 NAME

  pod::name - purpose

  =head1 SYNOPSIS

is converted to the C&lt;latex&gt;

  \section{pod::name\label{pod_name}\index{pod::name}}

  Purpose

  \subsection*{SYNOPSIS\label{pod_name_SYNOPSIS}%
               \index{pod::name!SYNOPSIS}}

(dependent on the value of C&lt;Head1Level&gt; and C&lt;LevelNoNum&gt;). Note that
subsequent C&lt;head1&gt; directives translate to subsections rather than
sections and that the labels and index now include the pod name (dependent
on the value of C&lt;UniqueLabels&gt;).

The C&lt;Label&gt; is set from the pod name regardless of any current value
of C&lt;Label&gt;.

  $mod = $parser-&gt;ReplaceNAMEwithSection;
  $parser-&gt;ReplaceNAMEwithSection(0);

Default is to translate the pod literally.

=cut

sub ReplaceNAMEwithSection {
   my $self = shift;
   if (@_) {
     $self-&gt;{ReplaceNAMEwithSection} = shift;
   }
   return $self-&gt;{ReplaceNAMEwithSection};
}

=item B&lt;StartWithNewPage&gt;

If true, each pod translation will begin with a C&lt;latex&gt;
C&lt;\clearpage&gt;.

  $parser-&gt;StartWithNewPage(1);
  $newpage = $parser-&gt;StartWithNewPage;

Default is false.

=cut

sub StartWithNewPage {
   my $self = shift;
   if (@_) {
     $self-&gt;{StartWithNewPage} = shift;
   }
   return $self-&gt;{StartWithNewPage};
}

=item B&lt;TableOfContents&gt;

If true, a table of contents will be created.
Irrelevant if C&lt;AddPreamble&gt; is false or C&lt;UserPreamble&gt;
is set.

  $toc = $parser-&gt;TableOfContents;
  $parser-&gt;TableOfContents(1);

Default is false.

=cut

sub TableOfContents {
   my $self = shift;
   if (@_) {
     $self-&gt;{TableOfContents} = shift;
   }
   return $self-&gt;{TableOfContents};
}

=item B&lt;UniqueLabels&gt;

If true, the translator will attempt to make sure that
each C&lt;latex&gt; label or index entry will be uniquely identified
by prefixing the contents of C&lt;Label&gt;. This allows
multiple documents to be combined without clashing 
common labels such as C&lt;DESCRIPTION&gt; and C&lt;SYNOPSIS&gt;

  $parser-&gt;UniqueLabels(1);
  $unq = $parser-&gt;UniqueLabels;

Default is true.

=cut

sub UniqueLabels {
   my $self = shift;
   if (@_) {
     $self-&gt;{UniqueLabels} = shift;
   }
   return $self-&gt;{UniqueLabels};
}

=item B&lt;UserPreamble&gt;

User supplied C&lt;latex&gt; preamble. Added before the pod translation
data. 

If set, the contents will be prepended to the output file before the translated 
data regardless of the value of C&lt;AddPreamble&gt;.
C&lt;MakeIndex&gt; and C&lt;TableOfContents&gt; will also be ignored.

=cut

sub UserPreamble {
   my $self = shift;
   if (@_) {
     $self-&gt;{UserPreamble} = shift;
   }
   return $self-&gt;{UserPreamble};
}

=item B&lt;UserPostamble&gt;

User supplied C&lt;latex&gt; postamble. Added after the pod translation
data. 

If set, the contents will be prepended to the output file after the translated 
data regardless of the value of C&lt;AddPostamble&gt;.
C&lt;MakeIndex&gt; will also be ignored.

=cut

sub UserPostamble {
   my $self = shift;
   if (@_) {
     $self-&gt;{UserPostamble} = shift;
   }
   return $self-&gt;{UserPostamble};
}

=begin __PRIVATE__

=item B&lt;Lists&gt;

Contains details of the currently active lists.
  The array contains C&lt;Pod::List&gt; objects. A new C&lt;Pod::List&gt;
object is created each time a list is encountered and it is
pushed onto this stack. When the list context ends, it 
is popped from the stack. The array will be empty if no
lists are active.

Returns array of list information in list context
Returns array ref in scalar context

=cut



sub lists {
  my $self = shift;
  return @{ $self-&gt;{_Lists} } if wantarray();
  return $self-&gt;{_Lists};
}

=end __PRIVATE__

=back

=begin __PRIVATE__

=head2 Subclassed methods

The following methods override methods provided in the C&lt;Pod::Select&gt;
base class. See C&lt;Pod::Parser&gt; and C&lt;Pod::Select&gt; for more information
on what these methods require.

=over 4

=cut

######### END ACCESSORS ###################

# Opening pod

=item B&lt;begin_pod&gt;

Writes the C&lt;latex&gt; preamble if requested.

=cut

sub begin_pod {
  my $self = shift;

  # Get the pod identification
  # This should really come from the '=head1 NAME' paragraph

  my $infile = $self-&gt;input_file;
  my $class = ref($self);
  my $date = gmtime(time);

  # Comment message to say where this came from
  my $comment = &lt;&lt; "__TEX_COMMENT__";
%%  Latex generated from POD in document $infile
%%  Using the perl module $class
%%  Converted on $date
__TEX_COMMENT__

  # Write the preamble
  # If the caller has supplied one then we just use that

  my $preamble = '';
  if (defined $self-&gt;UserPreamble) {

    $preamble = $self-&gt;UserPreamble;

    # Add the description of where this came from
    $preamble .=  "\n$comment";
    

  } elsif ($self-&gt;AddPreamble) {
    # Write our own preamble

    # Code to initialise index making
    # Use an array so that we can prepend comment if required
    my @makeidx = (
		   '\usepackage{makeidx}',
		   '\makeindex',
		  );

    unless ($self-&gt;MakeIndex) {
      foreach (@makeidx) {
	$_ = '%% ' . $_;
      }
    }
    my $makeindex = join("\n",@makeidx) . "\n";


    # Table of contents
    my $tableofcontents = '\tableofcontents';
    
    $tableofcontents = '%% ' . $tableofcontents
      unless $self-&gt;TableOfContents;

    # Roll our own
    $preamble = &lt;&lt; "__TEX_HEADER__";
\\documentclass{article}

$comment

$makeindex

\\begin{document}

$tableofcontents

__TEX_HEADER__

  }

  # Write the header (blank if none)
  $self-&gt;_output($preamble);

  # Start on new page if requested
  $self-&gt;_output("\\clearpage\n") if $self-&gt;StartWithNewPage;

}


=item B&lt;end_pod&gt;

Write the closing C&lt;latex&gt; code.

=cut

sub end_pod {
  my $self = shift;

  # End string
  my $end = '';

  # Use the user version of the postamble if deinfed
  if (defined $self-&gt;UserPostamble) {
    $end = $self-&gt;UserPostamble;

    $self-&gt;_output($end);

  } elsif ($self-&gt;AddPostamble) {

    # Check for index
    my $makeindex = '\printindex';

    $makeindex = '%% '. $makeindex  unless $self-&gt;MakeIndex;

    $end = "$makeindex\n\n\\end{document}\n";
  }


  $self-&gt;_output($end);

}

=item B&lt;command&gt;

Process basic pod commands.

=cut

sub command {
  my $self = shift;
  my ($command, $paragraph, $line_num, $parobj) = @_;

  # return if we dont care
  return if $command eq 'pod';

  $paragraph = $self-&gt;_replace_special_chars($paragraph);

  # Interpolate pod sequences in paragraph
  $paragraph = $self-&gt;interpolate($paragraph, $line_num);

  $paragraph =~ s/\s+$//;

  # Now run the command
  if ($command eq 'over') {

    $self-&gt;begin_list($paragraph, $line_num);

  } elsif ($command eq 'item') {

    $self-&gt;add_item($paragraph, $line_num);

  } elsif ($command eq 'back') {

    $self-&gt;end_list($line_num);

  } elsif ($command eq 'head1') {

    # Store the name of the section
    $self-&gt;{_CURRENT_HEAD1} = $paragraph;

    # Print it
    $self-&gt;head(1, $paragraph, $parobj);

  } elsif ($command eq 'head2') {

    $self-&gt;head(2, $paragraph, $parobj);

  } elsif ($command eq 'head3') {

    $self-&gt;head(3, $paragraph, $parobj);

  } elsif ($command eq 'head4') {

    $self-&gt;head(4, $paragraph, $parobj);

  } elsif ($command eq 'head5') {

    $self-&gt;head(5, $paragraph, $parobj);

  } elsif ($command eq 'head6') {

    $self-&gt;head(6, $paragraph, $parobj);

  } elsif ($command eq 'begin') {

    # pass through if latex
    if ($paragraph =~ /^latex/i) {
      # Make sure that subsequent paragraphs are not modfied before printing
      $self-&gt;{_dont_modify_any_para} = 1;

    } else {
      # Suppress all subsequent paragraphs unless 
      # it is explcitly intended for latex
      $self-&gt;{_suppress_all_para} = 1;
    }

  } elsif ($command eq 'for') {

    # pass through if latex
    if ($paragraph =~ /^latex/i) {
      # Make sure that next paragraph is not modfied before printing
      $self-&gt;{_dont_modify_next_para} = 1;

    } else {
      # Suppress the next paragraph unless it is latex
      $self-&gt;{_suppress_next_para} = 1
    }

  } elsif ($command eq 'end') {

    # Reset suppression
    $self-&gt;{_suppress_all_para} = 0;
    $self-&gt;{_dont_modify_any_para} = 0;

  } elsif ($command eq 'pod') {

    # Do nothing

  } else {
    carp "Command $command not recognised at line $line_num\n";
  }

}

=item B&lt;verbatim&gt;

Verbatim text

=cut

sub verbatim {
  my $self = shift;
  my ($paragraph, $line_num, $parobj) = @_;

  # Expand paragraph unless in =for or =begin block
  if ($self-&gt;{_dont_modify_any_para} || $self-&gt;{_dont_modify_next_para}) {
    # Just print as is
    $self-&gt;_output($paragraph);

    # Reset flag if in =for
    $self-&gt;{_dont_modify_next_para} = 0;

  } else {

    return if $paragraph =~ /^\s+$/;

    # Clean trailing space
    $paragraph =~ s/\s+$//;

    # Clean tabs
    $paragraph =~ s/\t/        /g;

    $self-&gt;_output('\begin{verbatim}' . "\n$paragraph\n". '\end{verbatim}'."\n");
  }
}

=item B&lt;textblock&gt;

Plain text paragraph.

=cut

sub textblock {
  my $self = shift;
  my ($paragraph, $line_num, $parobj) = @_;

  # print Dumper($self);
  
  # Expand paragraph unless in =for or =begin block
  if ($self-&gt;{_dont_modify_any_para} || $self-&gt;{_dont_modify_next_para}) {
    # Just print as is
    $self-&gt;_output($paragraph);

    # Reset flag if in =for
    $self-&gt;{_dont_modify_next_para} = 0;

    return;
  } 

  
  # Escape latex special characters
  $paragraph = $self-&gt;_replace_special_chars($paragraph);

  # Interpolate interior sequences
  my $expansion = $self-&gt;interpolate($paragraph, $line_num);
  $expansion =~ s/\s+$//;


  # If we are replacing 'head1 NAME' with a section
  # we need to look in the paragraph and rewrite things
  # Need to make sure this is called only on the first paragraph
  # following 'head1 NAME' and not on subsequent paragraphs that may be
  # present.
  if ($self-&gt;{_CURRENT_HEAD1} =~ /^NAME/i &amp;&amp; $self-&gt;ReplaceNAMEwithSection()) {

    # Strip white space from start and end
    $paragraph =~ s/^\s+//;
    $paragraph =~ s/\s$//;

    # Split the string into 2 parts
    my ($name, $purpose) = split(/\s+-\s+/, $expansion,2);

    # Now prevent this from triggering until a new head1 NAME is set
    $self-&gt;{_CURRENT_HEAD1} = '_NAME';

    # Might want to clear the Label() before doing this (CHECK)

    # Print the heading
    $self-&gt;head(1, $name, $parobj);

    # Set the labeling in case we want unique names later
    $self-&gt;Label( $self-&gt;_create_label( $name, 1 ) );

    # Raise the Head1Level by one so that subsequent =head1 appear
    # as subsections of the main name section unless we are already
    # at maximum [Head1Level() could check this itself - CHECK]
    $self-&gt;Head1Level( $self-&gt;Head1Level() + 1)
      unless $self-&gt;Head1Level == $#LatexSections;

    # Now write out the new latex paragraph
    $purpose = ucfirst($purpose);
    $self-&gt;_output("\n\n$purpose\n\n");

  } else {
    # Just write the output
    $self-&gt;_output("\n\n$expansion\n\n");
  }

}

=item B&lt;interior_sequence&gt;

Interior sequence expansion

=cut

sub interior_sequence {
  my $self = shift;

  my ($seq_command, $seq_argument, $pod_seq) = @_;

  if ($seq_command eq 'B') {
    return "\\textbf{$seq_argument}";

  } elsif ($seq_command eq 'I') {
    return "\\textit{$seq_argument}";

  } elsif ($seq_command eq 'E') {

    # If it is simply a number
    if ($seq_argument =~ /^\d+$/) {
      return chr($seq_argument);
    # Look up escape in hash table
    } elsif (exists $HTML_Escapes{$seq_argument}) {
      return $HTML_Escapes{$seq_argument};

    } else {
      my ($file, $line) = $pod_seq-&gt;file_line();
      warn "Escape sequence $seq_argument not recognised at line $line of file $file\n";
      return;
    }

  } elsif ($seq_command eq 'Z') {

    # Zero width space
    return '$\!$'; # '

  } elsif ($seq_command eq 'C') {
    return "\\texttt{$seq_argument}";

  } elsif ($seq_command eq 'F') {
    return "\\emph{$seq_argument}";

  } elsif ($seq_command eq 'S') {
    # non breakable spaces
    my $nbsp = '$\:$'; #'

    $seq_argument =~ s/\s/$nbsp/g;
    return $seq_argument;

  } elsif ($seq_command eq 'L') {

    my $link = new Pod::Hyperlink($seq_argument);

    # undef on failure
    unless (defined $link) {
      carp $@;
      return;
    }

    # Handle internal links differently
    my $type = $link-&gt;type;
    my $page = $link-&gt;page;

    if ($type eq 'section' &amp;&amp; $page eq '') {
      # Use internal latex reference 
      my $node = $link-&gt;node;

      # Convert to a label
      $node = $self-&gt;_create_label($node);

      return "\\S\\ref{$node}";

    } else {
      # Use default markup for external references
      # (although Starlink would use \xlabel)
      my $markup = $link-&gt;markup;

      my ($file, $line) = $pod_seq-&gt;file_line();

      return $self-&gt;interpolate($link-&gt;markup, $line);
    }



  } elsif ($seq_command eq 'P') {
    # Special markup for Pod::Hyperlink
    # Replace :: with /
    my $link = $seq_argument;
    $link =~ s/::/\//g;

    my $ref = "\\emph{$seq_argument}";
    return $ref;

  } elsif ($seq_command eq 'Q') {
    # Special markup for Pod::Hyperlink
    return "\\textsf{$seq_argument}\n";

  } elsif ($seq_command eq 'X') {
    # Index entries

    # use \index command
    # I will let '!' go through for now
    # not sure how sub categories are handled in X&lt;&gt;
    my $index = $self-&gt;_create_index($seq_argument);
    return "\\index{$index}\n";

  } else {
    carp "Unknown sequence $seq_command&lt;$seq_argument&gt;";
  }

}

=back

=head2 List Methods

Methods used to handle lists.

=over 4

=item B&lt;begin_list&gt;

Called when a new list is found (via the C&lt;over&gt; directive).
Creates a new C&lt;Pod::List&gt; object and stores it on the 
list stack.

  $parser-&gt;begin_list($indent, $line_num);

=cut

sub begin_list {
  my $self = shift;
  my $indent = shift;
  my $line_num = shift;

  # Indicate that a list should be started for the next item
  # need to do this to work out the type of list
  push ( @{$self-&gt;lists}, new Pod::List(-indent =&gt; $indent, 
					-start =&gt; $line_num,
					-file =&gt; $self-&gt;input_file,
				       )	 
       );

}

=item B&lt;end_list&gt;

Called when the end of a list is found (the C&lt;back&gt; directive).
Pops the C&lt;Pod::List&gt; object off the stack of lists and writes
the C&lt;latex&gt; code required to close a list.

  $parser-&gt;end_list($line_num);

=cut

sub end_list {
  my $self = shift;
  my $line_num = shift;

  unless (defined $self-&gt;lists-&gt;[-1]) {
    my $file = $self-&gt;input_file;
    warn "No list is active at line $line_num (file=$file). Missing =over?\n";
    return;
  }

  # What to write depends on list type
  my $type = $self-&gt;lists-&gt;[-1]-&gt;type;

  # Dont write anything if the list type is not set
  # iomplying that a list was created but no entries were
  # placed in it (eg because of a =begin/=end combination)
  $self-&gt;_output("\\end{$type}\n")
    if (defined $type &amp;&amp; length($type) &gt; 0);
  
  # Clear list
  pop(@{ $self-&gt;lists});

}

=item B&lt;add_item&gt;

Add items to the list. The first time an item is encountered 
(determined from the state of the current C&lt;Pod::List&gt; object)
the type of list is determined (ordered, unnumbered or description)
and the relevant latex code issued.

  $parser-&gt;add_item($paragraph, $line_num);

=cut

sub add_item {
  my $self = shift;
  my $paragraph = shift;
  my $line_num = shift;

  unless (defined $self-&gt;lists-&gt;[-1]) {
    my $file = $self-&gt;input_file;
    warn "List has already ended by line $line_num of file $file. Missing =over?\n";
    # Replace special chars
#    $paragraph = $self-&gt;_replace_special_chars($paragraph);
    $self-&gt;_output("$paragraph\n\n");
    return;
  }

  # If paragraphs printing is turned off via =begin/=end or whatver
  # simply return immediately
  return if ($self-&gt;{_suppress_all_para} || $self-&gt;{_suppress_next_para});

  # Check to see whether we are starting a new lists
  if (scalar($self-&gt;lists-&gt;[-1]-&gt;item) == 0) {

    # Examine the paragraph to determine what type of list
    # we have
    $paragraph =~ s/\s+$//;
    $paragraph =~ s/^\s+//;

    my $type;
    if (substr($paragraph, 0,1) eq '*') {
      $type = 'itemize';
    } elsif ($paragraph =~ /^\d/) {
      $type = 'enumerate';
    } else {
      $type = 'description';
    }
    $self-&gt;lists-&gt;[-1]-&gt;type($type);

    $self-&gt;_output("\\begin{$type}\n");

  }

  my $type = $self-&gt;lists-&gt;[-1]-&gt;type;

  if ($type eq 'description') {
    # Handle long items - long items do not wrap
    if (length($paragraph) &lt; 40) {
      # A real description list item
      $self-&gt;_output("\\item[$paragraph] \\mbox{}");
    } else {
      # The item is now simply bold text
      $self-&gt;_output(qq{\\item \\textbf{$paragraph}});
    }

  } else {
    # If the item was '* Something' we still need to write
    # out the something
    my $extra_info = $paragraph;
    $extra_info =~ s/^\*\s*//;
    $self-&gt;_output("\\item $extra_info");
  }

  # Store the item name in the object. Required so that 
  # we can tell if the list is new or not
  $self-&gt;lists-&gt;[-1]-&gt;item($paragraph);

}

=back

=head2 Methods for headings

=over 4

=item B&lt;head&gt;

Print a heading of the required level.

  $parser-&gt;head($level, $paragraph, $parobj);

The first argument is the pod heading level. The second argument
is the contents of the heading. The 3rd argument is a Pod::Paragraph
object so that the line number can be extracted.

=cut

sub head {
  my $self = shift;
  my $num = shift;
  my $paragraph = shift;
  my $parobj = shift;

  # If we are replace 'head1 NAME' with a section
  # we return immediately if we get it
  return 
    if ($self-&gt;{_CURRENT_HEAD1} =~ /^NAME/i &amp;&amp; $self-&gt;ReplaceNAMEwithSection());

  # Create a label
  my $label = $self-&gt;_create_label($paragraph);

  # Create an index entry
  my $index = $self-&gt;_create_index($paragraph);

  # Work out position in the above array taking into account
  # that =head1 is equivalent to $self-&gt;Head1Level

  my $level = $self-&gt;Head1Level() - 1 + $num;

  # Warn if heading to large
  if ($num &gt; $#LatexSections) {
    my $line = $parobj-&gt;file_line;
    my $file = $self-&gt;input_file;
    warn "Heading level too large ($level) for LaTeX at line $line of file $file\n";
    $level = $#LatexSections;
  }

  # Check to see whether section should be unnumbered
  my $star = ($level &gt;= $self-&gt;LevelNoNum ? '*' : '');

  # Section
  $self-&gt;_output("\\" .$LatexSections[$level] .$star ."{$paragraph\\label{".$label ."}\\index{".$index."}}");

}


=back

=end __PRIVATE__

=begin __PRIVATE__

=head2 Internal methods

Internal routines are described in this section. They do not form part of the
public interface. All private methods start with an underscore.

=over 4

=item B&lt;_output&gt;

Output text to the output filehandle. This method must be always be called
to output parsed text.

   $parser-&gt;_output($text);

Does not write anything if a =begin or =for is active that should be
ignored.

=cut

sub _output { 
  my $self = shift;
  my $text = shift;

  print { $self-&gt;output_handle } $text 
    unless $self-&gt;{_suppress_all_para} ||
      $self-&gt;{_suppress_next_para};

  # Reset pargraph stuff for =for
  $self-&gt;{_suppress_next_para} = 0
    if $self-&gt;{_suppress_next_para};
}


=item B&lt;_replace_special_chars&gt;

Subroutine to replace characters that are special in C&lt;latex&gt;
with the escaped forms

  $escaped = $parser-&gt;_replace_special_chars($paragraph);

Need to call this routine before interior_sequences are munged but
not if verbatim.

Special characters and the C&lt;latex&gt; equivalents are:

  }     \}
  {     \{
  _     \_
  $     \$
  %     \%
  &amp;     \&amp;
  \     $\backslash$
  ^     \^{}
  ~     \~{}
  |     $|$

=cut

sub _replace_special_chars {
  my $self = shift;
  my $paragraph = shift;

  # Replace a \ with $\backslash$
  # This is made more complicated because the dollars will be escaped
  # by the subsequent replacement. Easiest to add \backslash 
  # now and then add the dollars
  $paragraph =~ s/\\/\\backslash/g;

  # Must be done after escape of \ since this command adds latex escapes
  # Replace characters that can be escaped
  $paragraph =~ s/([\$\#&amp;%_{}])/\\$1/g;

  # Replace ^ characters with \^{} so that $^F works okay
  $paragraph =~ s/(\^)/\\$1\{\}/g;

  # Replace tilde (~) with \texttt{\~{}}
  $paragraph =~ s/~/\\texttt\{\\~\{\}\}/g;

  # Replace | with $|$
  $paragraph =~ s'\|'$|$'g;

  # Now add the dollars around each \backslash
  $paragraph =~ s/(\\backslash)/\$$1\$/g;

  return $paragraph;
}


=item B&lt;_create_label&gt;

Return a string that can be used as an internal reference
in a C&lt;latex&gt; document (i.e. accepted by the C&lt;\label&gt; command)

 $label = $parser-&gt;_create_label($string)

If UniqueLabels is true returns a label prefixed by Label()
This can be suppressed with an optional second argument.

 $label = $parser-&gt;_create_label($string, $suppress);

If a second argument is supplied (of any value including undef)
the Label() is never prefixed. This means that this routine can
be called to create a Label() without prefixing a previous setting.

=cut

sub _create_label {
  my $self = shift;
  my $paragraph = shift;
  my $suppress = (@_ ? 1 : 0 );

  # Remove latex commands
  $paragraph = $self-&gt;_clean_latex_commands($paragraph);

  # Remove non alphanumerics from the label and replace with underscores
  # want to protect '-' though so use negated character classes 
  $paragraph =~ s/[^-:\w]/_/g;

  # Multiple underscores will look unsightly so remove repeats
  # This will also have the advantage of tidying up the end and
  # start of string
  $paragraph =~ s/_+/_/g;

  # If required need to make sure that the label is unique
  # since it is possible to have multiple pods in a single
  # document
  if (!$suppress &amp;&amp; $self-&gt;UniqueLabels() &amp;&amp; defined $self-&gt;Label) {
    $paragraph = $self-&gt;Label() .'_'. $paragraph;
  }

  return $paragraph;
}


=item B&lt;_create_index&gt;

Similar to C&lt;_create_label&gt; except an index entry is created.
If C&lt;UniqueLabels&gt; is true, the index entry is prefixed by 
the current C&lt;Label&gt; and an exclamation mark.

  $ind = $parser-&gt;_create_index($paragraph);

An exclamation mark is used by C&lt;makeindex&gt; to generate 
sub-entries in an index.

=cut

sub _create_index {
  my $self = shift;
  my $paragraph = shift;
  my $suppress = (@_ ? 1 : 0 );

  # Remove latex commands
  $paragraph = $self-&gt;_clean_latex_commands($paragraph);

  # If required need to make sure that the index entry is unique
  # since it is possible to have multiple pods in a single
  # document
  if (!$suppress &amp;&amp; $self-&gt;UniqueLabels() &amp;&amp; defined $self-&gt;Label) {
    $paragraph = $self-&gt;Label() .'!'. $paragraph;
  }

  # Need to replace _ with space
  $paragraph =~ s/_/ /g;

  return $paragraph;

}

=item B&lt;_clean_latex_commands&gt;

Removes latex commands from text. The latex command is assumed to be of the
form C&lt;\command{ text }&gt;. "C&lt;text&gt;" is retained

  $clean = $parser-&gt;_clean_latex_commands($text);

=cut

sub _clean_latex_commands {
  my $self = shift;
  my $paragraph = shift;

  # Remove latex commands of the form \text{ }
  # and replace with the contents of the { }
  # need to make this non-greedy so that it can handle
  #  "\text{a} and \text2{b}"
  # without converting it to
  #  "a} and \text2{b"
  # This match will still get into trouble if \} is present 
  # This is not vital since the subsequent replacement of non-alphanumeric
  # characters will tidy it up anyway
  $paragraph =~ s/\\\w+{(.*?)}/$1/g;

  return $paragraph
}

=back

=end __PRIVATE__

=head1 NOTES

Compatible with C&lt;latex2e&gt; only. Can not be used with C&lt;latex&gt; v2.09
or earlier.

A subclass of C&lt;Pod::Select&gt; so that specific pod sections can be
converted to C&lt;latex&gt; by using the C&lt;select&gt; method.

Some HTML escapes are missing and many have not been tested.

=head1 SEE ALSO

L&lt;Pod::Parser&gt;, L&lt;Pod::Select&gt;, L&lt;pod2latex&gt;

=head1 AUTHORS

Tim Jenness E&lt;lt&gt;t.jenness@jach.hawaii.eduE&lt;gt&gt;

=head1 COPYRIGHT

Copyright (C) 2000 Tim Jenness. All Rights Reserved.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

=begin __PRIVATE__

=head1 REVISION

$Id: LaTeX.pm,v 1.6 2000/08/21 09:05:03 timj Exp $

=end __PRIVATE__

=cut
</pre></body></html>