2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml">
5 <title>Pod::LaTeX - Convert Pod data to formatted Latex
</title>
6 <meta http-equiv=
"content-type" content=
"text/html; charset=utf-8" />
7 <link rev=
"made" href=
"mailto:" />
10 <body style=
"background-color: white">
11 <table border=
"0" width=
"100%" cellspacing=
"0" cellpadding=
"3">
12 <tr><td class=
"block" style=
"background-color: #cccccc" valign=
"middle">
13 <big><strong><span class=
"block"> Pod::LaTeX - Convert Pod data to formatted Latex
</span></strong></big>
17 <p><a name=
"__index__"></a></p>
22 <li><a href=
"#name">NAME
</a></li>
23 <li><a href=
"#synopsis">SYNOPSIS
</a></li>
24 <li><a href=
"#description">DESCRIPTION
</a></li>
25 <li><a href=
"#object_methods">OBJECT METHODS
</a></li>
28 <li><a href=
"#data_accessors">Data Accessors
</a></li>
29 <li><a href=
"#subclassed_methods">Subclassed methods
</a></li>
30 <li><a href=
"#list_methods">List Methods
</a></li>
31 <li><a href=
"#methods_for_headings">Methods for headings
</a></li>
32 <li><a href=
"#internal_methods">Internal methods
</a></li>
35 <li><a href=
"#notes">NOTES
</a></li>
36 <li><a href=
"#see_also">SEE ALSO
</a></li>
37 <li><a href=
"#authors">AUTHORS
</a></li>
38 <li><a href=
"#copyright">COPYRIGHT
</a></li>
39 <li><a href=
"#revision">REVISION
</a></li>
46 <h1><a name=
"name">NAME
</a></h1>
47 <p>Pod::LaTeX - Convert Pod data to formatted Latex
</p>
51 <h1><a name=
"synopsis">SYNOPSIS
</a></h1>
54 my $parser = Pod::LaTeX-
>new ( );
</pre>
56 $parser-
>parse_from_filehandle;
</pre>
58 $parser-
>parse_from_file ('file.pod', 'file.tex');
</pre>
62 <h1><a name=
"description">DESCRIPTION
</a></h1>
63 <p><code>Pod::LaTeX
</code> is a module to convert documentation in the Pod format
64 into Latex. The
<a href=
"file://C|\msysgit\mingw\html/pod/pod2latex.html"><strong>pod2latex
</strong></a> command uses
65 this module for translation.
</p>
66 <p><code>Pod::LaTeX
</code> is a derived class from
<a href=
"file://C|\msysgit\mingw\html/lib/Pod/Select.html">Pod::Select
</a>.
</p>
70 <h1><a name=
"object_methods">OBJECT METHODS
</a></h1>
71 <p>The following methods are provided in this module. Methods inherited
72 from
<code>Pod::Select
</code> are not described in the public interface.
</p>
75 <h2><a name=
"data_accessors">Data Accessors
</a></h2>
76 <p>The following methods are provided for accessing instance data. These
77 methods should be used for accessing configuration parameters rather
78 than assuming the object is a hash.
</p>
79 <p>Default values can be supplied by using these names as keys to a hash
80 of arguments when using the
<code>new()
</code> constructor.
</p>
82 <dt><strong><a name=
"item_addpreamble"><strong>AddPreamble
</strong></a></strong>
85 <p>Logical to control whether a
<code>latex
</code> preamble is to be written.
86 If true, a valid
<code>latex
</code> preamble is written before the pod data is written.
87 This is similar to:
</p>
91 \documentclass{article}
92 \usepackage[T1]{fontenc}
94 \begin{document}
</pre>
97 <p>but will be more complicated if table of contents and indexing are required.
98 Can be used to set or retrieve the current value.
</p>
102 $add = $parser-
>AddPreamble();
103 $parser-
>AddPreamble(
1);
</pre>
106 <p>If used in conjunction with
<a href=
"#item_addpostamble"><code>AddPostamble
</code></a> a full latex document will
107 be written that could be immediately processed by
<code>latex
</code>.
</p>
110 <p>For some pod escapes it may be necessary to include the amsmath
111 package. This is not yet added to the preamble automaatically.
</p>
114 <dt><strong><a name=
"item_addpostamble"><strong>AddPostamble
</strong></a></strong>
117 <p>Logical to control whether a standard
<code>latex
</code> ending is written to the output
118 file after the document has been processed.
119 In its simplest form this is simply:
</p>
126 <p>but can be more complicated if a index is required.
127 Can be used to set or retrieve the current value.
</p>
131 $add = $parser-
>AddPostamble();
132 $parser-
>AddPostamble(
1);
</pre>
135 <p>If used in conjunction with
<code>AddPreaamble
</code> a full latex document will
136 be written that could be immediately processed by
<code>latex
</code>.
</p>
139 <dt><strong><a name=
"item_head1level"><strong>Head1Level
</strong></a></strong>
142 <p>The
<code>latex
</code> sectioning level that should be used to correspond to
143 a pod
<code>=head1
</code> directive. This can be used, for example, to turn
144 a
<code>=head1
</code> into a
<code>latex
</code> <code>subsection
</code>. This should hold a number
145 corresponding to the required position in an array containing the
146 following elements:
</p>
155 [
5] subparagraph
</pre>
158 <p>Can be used to set or retrieve the current value:
</p>
162 $parser-
>Head1Level(
2);
163 $sect = $parser-
>Head1Level;
</pre>
166 <p>Setting this number too high can result in sections that may not be reproducible
167 in the expected way. For example, setting this to
4 would imply that
<code>=head3
</code>
168 do not have a corresponding
<code>latex
</code> section (
<code>=head1
</code> would correspond to
169 a
<code>paragraph
</code>).
</p>
172 <p>A check is made to ensure that the supplied value is an integer in the
176 <p>Default is for a value of
1 (i.e. a
<code>section
</code>).
</p>
179 <dt><strong><a name=
"item_label"><strong>Label
</strong></a></strong>
182 <p>This is the label that is prefixed to all
<code>latex
</code> label and index
183 entries to make them unique. In general, pods have similarly titled
184 sections (NAME, DESCRIPTION etc) and a
<code>latex
</code> label will be multiply
185 defined if more than one pod document is to be included in a single
186 <code>latex
</code> file. To overcome this, this label is prefixed to a label
187 whenever a label is required (joined with an underscore) or to an
188 index entry (joined by an exclamation mark which is the normal index
189 separator). For example,
<code>\label{text}
</code> becomes
<code>\label{Label_text}
</code>.
</p>
192 <p>Can be used to set or retrieve the current value:
</p>
196 $label = $parser-
>Label;
197 $parser-
>Label($label);
</pre>
200 <p>This label is only used if
<a href=
"#item_uniquelabels"><code>UniqueLabels
</code></a> is true.
201 Its value is set automatically from the
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_name"><code>NAME
</code></a> field
202 if
<a href=
"#item_replacenamewithsection"><code>ReplaceNAMEwithSection
</code></a> is true. If this is not the case
203 it must be set manually before starting the parse.
</p>
206 <p>Default value is
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_undef"><code>undef
</code></a>.
</p>
209 <dt><strong><a name=
"item_levelnonum"><strong>LevelNoNum
</strong></a></strong>
212 <p>Control the point at which
<code>latex
</code> section numbering is turned off.
213 For example, this can be used to make sure that
<code>latex
</code> sections
214 are numbered but subsections are not.
</p>
217 <p>Can be used to set or retrieve the current value:
</p>
221 $lev = $parser-
>LevelNoNum;
222 $parser-
>LevelNoNum(
2);
</pre>
225 <p>The argument must be an integer between
0 and
5 and is the same as the
226 number described in
<a href=
"#item_head1level"><code>Head1Level
</code></a> method description. The number has
227 nothing to do with the pod heading number, only the
<code>latex
</code> sectioning.
</p>
230 <p>Default is
2. (i.e.
<code>latex
</code> subsections are written as
<code>subsection*
</code>
231 but sections are numbered).
</p>
234 <dt><strong><a name=
"item_makeindex"><strong>MakeIndex
</strong></a></strong>
237 <p>Controls whether
<code>latex
</code> commands for creating an index are to be inserted
238 into the preamble and postamble
</p>
242 $makeindex = $parser-
>MakeIndex;
243 $parser-
>MakeIndex(
0);
</pre>
246 <p>Irrelevant if both
<a href=
"#item_addpreamble"><code>AddPreamble
</code></a> and
<a href=
"#item_addpostamble"><code>AddPostamble
</code></a> are false (or equivalently,
247 <a href=
"#item_userpreamble"><code>UserPreamble
</code></a> and
<a href=
"#item_userpostamble"><code>UserPostamble
</code></a> are set).
</p>
250 <p>Default is for an index to be created.
</p>
253 <dt><strong><a name=
"item_replacenamewithsection"><strong>ReplaceNAMEwithSection
</strong></a></strong>
256 <p>This controls whether the
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_name"><code>NAME
</code></a> section in the pod is to be translated
257 literally or converted to a slightly modified output where the section
258 name is the pod name rather than ``NAME''.
</p>
261 <p>If true, the pod segment
</p>
269 pod::name - purpose
</pre>
273 =head1 SYNOPSIS
</pre>
276 <p>is converted to the
<code>latex
</code></p>
280 \section{pod::name\label{pod_name}\index{pod::name}}
</pre>
288 \subsection*{SYNOPSIS\label{pod_name_SYNOPSIS}%
289 \index{pod::name!SYNOPSIS}}
</pre>
292 <p>(dependent on the value of
<a href=
"#item_head1level"><code>Head1Level
</code></a> and
<a href=
"#item_levelnonum"><code>LevelNoNum
</code></a>). Note that
293 subsequent
<code>head1
</code> directives translate to subsections rather than
294 sections and that the labels and index now include the pod name (dependent
295 on the value of
<a href=
"#item_uniquelabels"><code>UniqueLabels
</code></a>).
</p>
298 <p>The
<a href=
"#item_label"><code>Label
</code></a> is set from the pod name regardless of any current value
299 of
<a href=
"#item_label"><code>Label
</code></a>.
</p>
303 $mod = $parser-
>ReplaceNAMEwithSection;
304 $parser-
>ReplaceNAMEwithSection(
0);
</pre>
307 <p>Default is to translate the pod literally.
</p>
310 <dt><strong><a name=
"item_startwithnewpage"><strong>StartWithNewPage
</strong></a></strong>
313 <p>If true, each pod translation will begin with a
<code>latex
</code>
314 <code>\clearpage
</code>.
</p>
318 $parser-
>StartWithNewPage(
1);
319 $newpage = $parser-
>StartWithNewPage;
</pre>
322 <p>Default is false.
</p>
325 <dt><strong><a name=
"item_tableofcontents"><strong>TableOfContents
</strong></a></strong>
328 <p>If true, a table of contents will be created.
329 Irrelevant if
<a href=
"#item_addpreamble"><code>AddPreamble
</code></a> is false or
<a href=
"#item_userpreamble"><code>UserPreamble
</code></a>
334 $toc = $parser-
>TableOfContents;
335 $parser-
>TableOfContents(
1);
</pre>
338 <p>Default is false.
</p>
341 <dt><strong><a name=
"item_uniquelabels"><strong>UniqueLabels
</strong></a></strong>
344 <p>If true, the translator will attempt to make sure that
345 each
<code>latex
</code> label or index entry will be uniquely identified
346 by prefixing the contents of
<a href=
"#item_label"><code>Label
</code></a>. This allows
347 multiple documents to be combined without clashing
348 common labels such as
<code>DESCRIPTION
</code> and
<code>SYNOPSIS
</code></p>
352 $parser-
>UniqueLabels(
1);
353 $unq = $parser-
>UniqueLabels;
</pre>
356 <p>Default is true.
</p>
359 <dt><strong><a name=
"item_userpreamble"><strong>UserPreamble
</strong></a></strong>
362 <p>User supplied
<code>latex
</code> preamble. Added before the pod translation
366 <p>If set, the contents will be prepended to the output file before the translated
367 data regardless of the value of
<a href=
"#item_addpreamble"><code>AddPreamble
</code></a>.
368 <a href=
"#item_makeindex"><code>MakeIndex
</code></a> and
<a href=
"#item_tableofcontents"><code>TableOfContents
</code></a> will also be ignored.
</p>
371 <dt><strong><a name=
"item_userpostamble"><strong>UserPostamble
</strong></a></strong>
374 <p>User supplied
<code>latex
</code> postamble. Added after the pod translation
378 <p>If set, the contents will be prepended to the output file after the translated
379 data regardless of the value of
<a href=
"#item_addpostamble"><code>AddPostamble
</code></a>.
380 <a href=
"#item_makeindex"><code>MakeIndex
</code></a> will also be ignored.
</p>
387 <h1><a name=
"notes">NOTES
</a></h1>
388 <p>Compatible with
<code>latex2e
</code> only. Can not be used with
<code>latex
</code> v2.09
390 <p>A subclass of
<code>Pod::Select
</code> so that specific pod sections can be
391 converted to
<code>latex
</code> by using the
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_select"><code>select
</code></a> method.
</p>
392 <p>Some HTML escapes are missing and many have not been tested.
</p>
396 <h1><a name=
"see_also">SEE ALSO
</a></h1>
397 <p><a href=
"file://C|\msysgit\mingw\html/lib/Pod/Parser.html">the Pod::Parser manpage
</a>,
<a href=
"file://C|\msysgit\mingw\html/lib/Pod/Select.html">the Pod::Select manpage
</a>,
<a href=
"file://C|\msysgit\mingw\html/pod/pod2latex.html">the pod2latex manpage
</a></p>
401 <h1><a name=
"authors">AUTHORS
</a></h1>
402 <p>Tim Jenness
<<a href=
"mailto:tjenness@cpan.org">tjenness@cpan.org
</a>></p>
403 <p>Bug fixes and improvements have been received from: Simon Cozens
404 <<a href=
"mailto:simon@cozens.net">simon@cozens.net
</a>>, Mark A. Hershberger
405 <<a href=
"mailto:mah@everybody.org">mah@everybody.org
</a>>, Marcel Grunauer
406 <<a href=
"mailto:marcel@codewerk.com">marcel@codewerk.com
</a>>, Hugh S Myers
407 <<a href=
"mailto:hsmyers@sdragons.com">hsmyers@sdragons.com
</a>>, Peter J Acklam
408 <<a href=
"mailto:jacklam@math.uio.no">jacklam@math.uio.no
</a>>, Sudhi Herle
<<a href=
"mailto:sudhi@herle.net">sudhi@herle.net
</a>>,
409 Ariel Scolnicov
<<a href=
"mailto:ariels@compugen.co.il">ariels@compugen.co.il
</a>>,
410 Adriano Rodrigues Ferreira
<<a href=
"mailto:ferreira@triang.com.br">ferreira@triang.com.br
</a>> and
411 R. de Vries
<<a href=
"mailto:r.de.vries@dutchspace.nl">r.de.vries@dutchspace.nl
</a>>.
</p>
415 <h1><a name=
"copyright">COPYRIGHT
</a></h1>
416 <p>Copyright (C)
2000-
2004 Tim Jenness. All Rights Reserved.
</p>
417 <p>This program is free software; you can redistribute it and/or modify
418 it under the same terms as Perl itself.
</p>
419 <table border=
"0" width=
"100%" cellspacing=
"0" cellpadding=
"3">
420 <tr><td class=
"block" style=
"background-color: #cccccc" valign=
"middle">
421 <big><strong><span class=
"block"> Pod::LaTeX - Convert Pod data to formatted Latex
</span></strong></big>