latex.html

来自「perl教程」· HTML 代码 · 共 444 行 · 第 1/2 页

HTML
444
字号
<?xml version="1.0" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<!-- saved from url=(0017)http://localhost/ -->
<script language="JavaScript" src="../../displayToc.js"></script>
<script language="JavaScript" src="../../tocParas.js"></script>
<script language="JavaScript" src="../../tocTab.js"></script>
<link rel="stylesheet" type="text/css" href="../../scineplex.css">
<title>Pod::LaTeX - Convert Pod data to formatted Latex</title>
<link rel="stylesheet" href="../../Active.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>

<body>

<script>writelinks('__top__',2);</script>
<h1><a>Pod::LaTeX - Convert Pod data to formatted Latex</a></h1>
<p><a name="__index__"></a></p>

<!-- INDEX BEGIN -->

<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<li><a href="#description">DESCRIPTION</a></li>
	<li><a href="#object_methods">OBJECT METHODS</a></li>
	<ul>

		<li><a href="#data_accessors">Data Accessors</a></li>
		<li><a href="#subclassed_methods">Subclassed methods</a></li>
		<li><a href="#list_methods">List Methods</a></li>
		<li><a href="#methods_for_headings">Methods for headings</a></li>
		<li><a href="#internal_methods">Internal methods</a></li>
	</ul>

	<li><a href="#notes">NOTES</a></li>
	<li><a href="#see_also">SEE ALSO</a></li>
	<li><a href="#authors">AUTHORS</a></li>
	<li><a href="#copyright">COPYRIGHT</a></li>
	<li><a href="#revision">REVISION</a></li>
</ul>
<!-- INDEX END -->

<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>Pod::LaTeX - Convert Pod data to formatted Latex</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
  <span class="keyword">use</span> <span class="variable">Pod::LaTeX</span><span class="operator">;</span>
  <span class="keyword">my</span> <span class="variable">$parser</span> <span class="operator">=</span> <span class="variable">Pod::LaTeX</span><span class="operator">-&gt;</span><span class="variable">new</span> <span class="operator">(</span> <span class="operator">);</span>
</pre>
<pre>
  <span class="variable">$parser</span><span class="operator">-&gt;</span><span class="variable">parse_from_filehandle</span><span class="operator">;</span>
</pre>
<pre>
  <span class="variable">$parser</span><span class="operator">-&gt;</span><span class="variable">parse_from_file</span> <span class="operator">(</span><span class="string">'file.pod'</span><span class="operator">,</span> <span class="string">'file.tex'</span><span class="operator">);</span>
</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p><code>Pod::LaTeX</code> is a module to convert documentation in the Pod format
into Latex. The <em><strong>pod2latex</strong></em>  command uses
this module for translation.</p>
<p><code>Pod::LaTeX</code> is a derived class from <a href="../../lib/Pod/Select.html">Pod::Select</a>.</p>
<p>
</p>
<hr />
<h1><a name="object_methods">OBJECT METHODS</a></h1>
<p>The following methods are provided in this module. Methods inherited
from <code>Pod::Select</code> are not described in the public interface.</p>
<p>
</p>
<h2><a name="data_accessors">Data Accessors</a></h2>
<p>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.</p>
<p>Default values can be supplied by using these names as keys to a hash
of arguments when using the <code>new()</code> constructor.</p>
<dl>
<dt><strong><a name="item_addpreamble"><strong>AddPreamble</strong></a></strong>

<dd>
<p>Logical to control whether a <code>latex</code> preamble is to be written.
If true, a valid <code>latex</code> preamble is written before the pod data is written.
This is similar to:</p>
</dd>
<dd>
<pre>
  <span class="operator">\</span><span class="variable">documentclass</span><span class="operator">{</span><span class="variable">article</span><span class="operator">}</span>
  <span class="operator">\</span><span class="variable">usepackage</span><span class="operator">[</span><span class="variable">T1</span><span class="operator">]</span><span class="operator">{</span><span class="variable">fontenc</span><span class="operator">}</span>
  <span class="operator">\</span><span class="variable">usepackage</span><span class="operator">{</span><span class="variable">textcomp</span><span class="operator">}</span>
  <span class="operator">\</span><span class="variable">begin</span><span class="operator">{</span><span class="variable">document</span><span class="operator">}</span>
</pre>
</dd>
<dd>
<p>but will be more complicated if table of contents and indexing are required.
Can be used to set or retrieve the current value.</p>
</dd>
<dd>
<pre>
  <span class="variable">$add</span> <span class="operator">=</span> <span class="variable">$parser</span><span class="operator">-&gt;</span><span class="variable">AddPreamble</span><span class="operator">();</span>
  <span class="variable">$parser</span><span class="operator">-&gt;</span><span class="variable">AddPreamble</span><span class="operator">(</span><span class="number">1</span><span class="operator">);</span>
</pre>
</dd>
<dd>
<p>If used in conjunction with <a href="#item_addpostamble"><code>AddPostamble</code></a> a full latex document will
be written that could be immediately processed by <code>latex</code>.</p>
</dd>
<dd>
<p>For some pod escapes it may be necessary to include the amsmath
package. This is not yet added to the preamble automaatically.</p>
</dd>
</li>
<dt><strong><a name="item_addpostamble"><strong>AddPostamble</strong></a></strong>

<dd>
<p>Logical to control whether a standard <code>latex</code> ending is written to the output
file after the document has been processed.
In its simplest form this is simply:</p>
</dd>
<dd>
<pre>
  <span class="operator">\</span><span class="variable">end</span><span class="operator">{</span><span class="variable">document</span><span class="operator">}</span>
</pre>
</dd>
<dd>
<p>but can be more complicated if a index is required.
Can be used to set or retrieve the current value.</p>
</dd>
<dd>
<pre>
  <span class="variable">$add</span> <span class="operator">=</span> <span class="variable">$parser</span><span class="operator">-&gt;</span><span class="variable">AddPostamble</span><span class="operator">();</span>
  <span class="variable">$parser</span><span class="operator">-&gt;</span><span class="variable">AddPostamble</span><span class="operator">(</span><span class="number">1</span><span class="operator">);</span>
</pre>
</dd>
<dd>
<p>If used in conjunction with <code>AddPreaamble</code> a full latex document will
be written that could be immediately processed by <code>latex</code>.</p>
</dd>
</li>
<dt><strong><a name="item_head1level"><strong>Head1Level</strong></a></strong>

<dd>
<p>The <code>latex</code> sectioning level that should be used to correspond to
a pod <code>=head1</code> directive. This can be used, for example, to turn
a <code>=head1</code> into a <code>latex</code> <code>subsection</code>. This should hold a number
corresponding to the required position in an array containing the
following elements:</p>
</dd>
<dd>
<pre>
 [0] chapter
 [1] section
 [2] subsection
 [3] subsubsection
 [4] paragraph
 [5] subparagraph</pre>
</dd>
<dd>
<p>Can be used to set or retrieve the current value:</p>
</dd>
<dd>
<pre>
  <span class="variable">$parser</span><span class="operator">-&gt;</span><span class="variable">Head1Level</span><span class="operator">(</span><span class="number">2</span><span class="operator">);</span>
  <span class="variable">$sect</span> <span class="operator">=</span> <span class="variable">$parser</span><span class="operator">-&gt;</span><span class="variable">Head1Level</span><span class="operator">;</span>
</pre>
</dd>
<dd>
<p>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 <code>=head3</code>
do not have a corresponding <code>latex</code> section (<code>=head1</code> would correspond to
a <code>paragraph</code>).</p>
</dd>
<dd>
<p>A check is made to ensure that the supplied value is an integer in the
range 0 to 5.</p>
</dd>
<dd>
<p>Default is for a value of 1 (i.e. a <code>section</code>).</p>
</dd>
</li>
<dt><strong><a name="item_label"><strong>Label</strong></a></strong>

<dd>
<p>This is the label that is prefixed to all <code>latex</code> label and index
entries to make them unique. In general, pods have similarly titled
sections (NAME, DESCRIPTION etc) and a <code>latex</code> label will be multiply
defined if more than one pod document is to be included in a single
<code>latex</code> 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, <code>\label{text}</code> becomes <code>\label{Label_text}</code>.</p>
</dd>
<dd>
<p>Can be used to set or retrieve the current value:</p>
</dd>
<dd>
<pre>
  <span class="variable">$label</span> <span class="operator">=</span> <span class="variable">$parser</span><span class="operator">-&gt;</span><span class="variable">Label</span><span class="operator">;</span>
  <span class="variable">$parser</span><span class="operator">-&gt;</span><span class="variable">Label</span><span class="operator">(</span><span class="variable">$label</span><span class="operator">);</span>
</pre>
</dd>
<dd>
<p>This label is only used if <a href="#item_uniquelabels"><code>UniqueLabels</code></a> is true.
Its value is set automatically from the <a href="../../lib/Pod/perlfunc.html#item_name"><code>NAME</code></a> field
if <a href="#item_replacenamewithsection"><code>ReplaceNAMEwithSection</code></a> is true. If this is not the case
it must be set manually before starting the parse.</p>
</dd>
<dd>
<p>Default value is <a href="../../lib/Pod/perlfunc.html#item_undef"><code>undef</code></a>.</p>
</dd>
</li>
<dt><strong><a name="item_levelnonum"><strong>LevelNoNum</strong></a></strong>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?