LaTeX::Driver is a Latex driver.
$drv = LaTeX::Driver->new( source => $doc_text,
output => $filename,
format => 'pdf',
$ok = $drv->run;
$stats = $drv->stats;
The LaTeX::Driver module encapsulates the details of invoking the Latex programs to format a LaTeX document. Formatting with LaTeX is complicated; there are potentially many programs to run and the output of those programs must be monitored to determine whether further processing is required.
This module runs the required commands in the directory specified, either explicitly with the dirname option or implicitly by the directory part of basename, or in the current directory. As a result of the processing up to a dozen or more intermediate files are created. These can be removed with the cleanup method.
This is the constructor method. It creates a driver object on which the run method is used to format the document specified. The main arguments are source and output; the source argument is required to specify the input document; output is only mandatory if source is a scalar reference.
The full list of arguments is as follows:
This parameter is mandatory; it can either specify the name of the document to be formatted or be a reference to a scalar containing the document source.
specifies the output for the formatted document; this may either be a file name or be a scalar reference. In the latter case the contents of the formatted document file is copied into the scalar variable referenced.
the format of output required: one of "dvi" (TeX Device Independent format), "ps" (PostScript) or "pdf" (Adobe Portable Document Format). The follow special values are also accepted: "pdf(ps)" (generates PDF via PostScript, using dvips and ps2pdf), "pdf(dvi)" (generates PDF via dvi, using dvipdfm). If not specified then the format is determined from the name of the output document if specified, or defaults to PDF.
Specifies whether the formatting should be done in a temporary directory in which case the source document is copied into the directory before formatting. This option can either take the value 1, in which case a temporary directory is automatically generated, or it is taken as the name of a subdirectory of the system temporary directory. A temporary directory is always created if the source document is specified as a scalar reference.
Specifies a mapping of program names to full pathname as a hash reference. These paths override the paths determined at installation time.
The maximum number of runs of the formatter program (defaults to 10).
The number of additional runs of the formatter program after the document has stabilized.
Specifies whether temporary files and directories should be automatically removed when the object destructor is called. Accepted values are none (do no cleanup), logfiles (remove log files) and tempfiles (remove log and temporary files). By default the destructor will remove the entire contents of any automatically generated temporary directory, but will leave all other files intact.
The name of a makeindex index style file that should be passed to makeindex.
Specifies additional options that should be passed to makeindex. Useful options are: -c to compress intermediate blanks in index keys, -l to specify letter ordering rather than word ordering, -r to disable implicit range formation. Refer to makeindex(1) for full details.
Specifies one or more directories to be searched for LaTeX files.