Pod::LaTeX - Convert Pod data to formatted Latex
use Pod::LaTeX; my $parser = Pod::LaTeX->new ( );
$parser->parse_from_filehandle;
$parser->parse_from_file ('file.pod', 'file.tex');
"Pod::LaTeX" is a derived class from Pod::Select.
Default values can be supplied by using these names as keys to a hash of arguments when using the "new()" constructor.
\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 with "AddPostamble" a full latex document will be written that could be immediately processed by "latex".
For some pod escapes it may be necessary to include the amsmath package. This is not yet added to the preamble automaatically.
\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 with "AddPreaamble" a full latex document will be written that could be immediately processed by "latex".
[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 corresponding "latex" section ("=head1" would correspond to a "paragraph").
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 "section").
Can be used to set or retrieve the current value:
$label = $parser->Label; $parser->Label($label);
This label is only used if "UniqueLabels" is true. Its value is set automatically from the "NAME" field if "ReplaceNAMEwithSection" is true. If this is not the case it must be set manually before starting the parse.
Default value is "undef".
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 in "Head1Level" method description. The number has nothing to do with the pod heading number, only the "latex" sectioning.
Default is 2. (i.e. "latex" subsections are written as "subsection*" but sections are numbered).
$makeindex = $parser->MakeIndex; $parser->MakeIndex(0);
Irrelevant if both "AddPreamble" and "AddPostamble" are false (or equivalently, "UserPreamble" and "UserPostamble" are set).
Default is for an index to be created.
If true, the pod segment
=head1 NAME
pod::name - purpose
=head1 SYNOPSIS
is converted to the "latex"
\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 "Head1Level" and "LevelNoNum"). Note that subsequent "head1" directives translate to subsections rather than sections and that the labels and index now include the pod name (dependent on the value of "UniqueLabels").
The "Label" is set from the pod name regardless of any current value of "Label".
$mod = $parser->ReplaceNAMEwithSection; $parser->ReplaceNAMEwithSection(0);
Default is to translate the pod literally.
$parser->StartWithNewPage(1); $newpage = $parser->StartWithNewPage;
Default is false.
$toc = $parser->TableOfContents; $parser->TableOfContents(1);
Default is false.
$parser->UniqueLabels(1); $unq = $parser->UniqueLabels;
Default is true.
If set, the contents will be prepended to the output file before the translated data regardless of the value of "AddPreamble". "MakeIndex" and "TableOfContents" will also be ignored.
If set, the contents will be prepended to the output file after the translated data regardless of the value of "AddPostamble". "MakeIndex" will also be ignored.
A subclass of "Pod::Select" so that specific pod sections can be converted to "latex" by using the "select" method.
Some HTML escapes are missing and many have not been tested.
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> and R. de Vries <r.de.vries@dutchspace.nl>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |