Movatterモバイル変換


[0]ホーム

URL:


 / 
Pod-LaTeX-0.61
River stage one • 3 direct dependents • 7 total dependents
/Pod::LaTeX

NAME

Pod::LaTeX - Convert Pod data to formatted Latex

SYNOPSIS

use Pod::LaTeX;my $parser = Pod::LaTeX->new ( );$parser->parse_from_filehandle;$parser->parse_from_file ('file.pod', 'file.tex');

DESCRIPTION

Pod::LaTeX is a module to convert documentation in the Pod format into Latex. Thepod2latex command uses this module for translation.

Pod::LaTeX is a derived class fromPod::Select.

OBJECT METHODS

The following methods are provided in this module. Methods inherited fromPod::Select are not described in the public interface.

    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 thenew() constructor.

    AddPreamble

    Logical to control whether alatex preamble is to be written. If true, a validlatex preamble is written before the pod data is written. This is similar to:

    \documentclass{article}\usepackage[T1]{fontenc}\usepackage{textcomp}\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->AddPreamble();$parser->AddPreamble(1);

    If used in conjunction withAddPostamble a full latex document will be written that could be immediately processed bylatex.

    For some pod escapes it may be necessary to include the amsmath package. This is not yet added to the preamble automatically.

    AddPostamble

    Logical to control whether a standardlatex 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->AddPostamble();$parser->AddPostamble(1);

    If used in conjunction withAddPreaamble a full latex document will be written that could be immediately processed bylatex.

    Head1Level

    Thelatex sectioning level that should be used to correspond to a pod=head1 directive. This can be used, for example, to turn a=head1 into alatexsubsection. 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->Head1Level(2);$sect = $parser->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=head3 do not have a correspondinglatex section (=head1 would correspond to aparagraph).

    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. asection).

    Label

    This is the label that is prefixed to alllatex label and index entries to make them unique. In general, pods have similarly titled sections (NAME, DESCRIPTION etc) and alatex label will be multiply defined if more than one pod document is to be included in a singlelatex 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,\label{text} becomes\label{Label_text}.

    Can be used to set or retrieve the current value:

    $label = $parser->Label;$parser->Label($label);

    This label is only used ifUniqueLabels is true. Its value is set automatically from theNAME field ifReplaceNAMEwithSection is true. If this is not the case it must be set manually before starting the parse.

    Default value isundef.

    LevelNoNum

    Control the point at whichlatex section numbering is turned off. For example, this can be used to make sure thatlatex sections are numbered but subsections are not.

    Can be used to set or retrieve the current value:

    $lev = $parser->LevelNoNum;$parser->LevelNoNum(2);

    The argument must be an integer between 0 and 5 and is the same as the number described inHead1Level method description. The number has nothing to do with the pod heading number, only thelatex sectioning.

    Default is 2. (i.e.latex subsections are written assubsection* but sections are numbered).

    MakeIndex

    Controls whetherlatex commands for creating an index are to be inserted into the preamble and postamble

    $makeindex = $parser->MakeIndex;$parser->MakeIndex(0);

    Irrelevant if bothAddPreamble andAddPostamble are false (or equivalently,UserPreamble andUserPostamble are set).

    Default is for an index to be created.

    ReplaceNAMEwithSection

    This controls whether theNAME 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 NAMEpod::name - purpose=head1 SYNOPSIS

    is converted to thelatex

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

    (dependent on the value ofHead1Level andLevelNoNum). Note that subsequenthead1 directives translate to subsections rather than sections and that the labels and index now include the pod name (dependent on the value ofUniqueLabels).

    TheLabel is set from the pod name regardless of any current value ofLabel.

    $mod = $parser->ReplaceNAMEwithSection;$parser->ReplaceNAMEwithSection(0);

    Default is to translate the pod literally.

    StartWithNewPage

    If true, each pod translation will begin with alatex\clearpage.

    $parser->StartWithNewPage(1);$newpage = $parser->StartWithNewPage;

    Default is false.

    TableOfContents

    If true, a table of contents will be created. Irrelevant ifAddPreamble is false orUserPreamble is set.

    $toc = $parser->TableOfContents;$parser->TableOfContents(1);

    Default is false.

    UniqueLabels

    If true, the translator will attempt to make sure that eachlatex label or index entry will be uniquely identified by prefixing the contents ofLabel. This allows multiple documents to be combined without clashing common labels such asDESCRIPTION andSYNOPSIS

    $parser->UniqueLabels(1);$unq = $parser->UniqueLabels;

    Default is true.

    UserPreamble

    User suppliedlatex 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 ofAddPreamble.MakeIndex andTableOfContents will also be ignored.

    UserPostamble

    User suppliedlatex 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 ofAddPostamble.MakeIndex will also be ignored.

    NOTES

    Compatible withlatex2e only. Can not be used withlatex v2.09 or earlier.

    A subclass ofPod::Select so that specific pod sections can be converted tolatex by using theselect method.

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

    SEE ALSO

    Pod::Parser,Pod::Select,pod2latex,Pod::Simple.

    AUTHORS

    Tim Jenness <tjenness@cpan.org>

    Bug fixes and improvements have been received from: Simon Cozens <simon@cozens.net>, Mark A. Hershberger <mah@everybody.org>, Marcel Grunauer <marcel@codewerk.com>, Hugh S Myers <hsmyers@sdragons.com>, Peter J Acklam <jacklam@math.uio.no>, Sudhi Herle <sudhi@herle.net>, Ariel Scolnicov <ariels@compugen.co.il>, Adriano Rodrigues Ferreira <ferreira@triang.com.br>, R. de Vries <r.de.vries@dutchspace.nl> and Dave Mitchell <davem@iabyn.com>.

    COPYRIGHT

    Copyright (C) 2011 Tim Jenness. Copyright (C) 2000-2004 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.

    Module Install Instructions

    To install Pod::LaTeX, copy and paste the appropriate command in to your terminal.

    cpanm

    cpanm Pod::LaTeX

    CPAN shell

    perl -MCPAN -e shellinstall Pod::LaTeX

    For more information on module installation, please visitthe detailed CPAN module installation guide.

    Keyboard Shortcuts

    Global
    sFocus search bar
    ?Bring up this help dialog
    GitHub
    gpGo to pull requests
    gigo to github issues (only if github is preferred repository)
    POD
    gaGo to author
    gcGo to changes
    giGo to issues
    gdGo to dist
    grGo to repository/SCM
    gsGo to source
    gbGo to file browse
    Search terms
    module: (e.g.module:Plugin)
    distribution: (e.g.distribution:Dancer auth)
    author: (e.g.author:SONGMU Redis)
    version: (e.g.version:1.00)

    [8]ページ先頭

    ©2009-2025 Movatter.jp