# 1. NAME▲

perltex - enable LaTeX macros to be defined in terms of Perl code

# 2. SYNOPSIS ▲

perltex [--help] [--latex=program] [--[no]safe] [--permit=feature] [latex options]

# 3. DESCRIPTION ▲

LaTeX \*(-- through the underlying TeX typesetting system \*(-- produces beautifully typeset documents but has a macro language that is difficult to program. In particular, support for complex string manipulation is largely lacking. Perl is a popular general-purpose programming language whose forte is string manipulation. However, it has no typesetting capabilities whatsoever.


# 4. OPTIONS ▲

perltex accepts the following command-line options:

--help 4 Display basic usage information.

--latex=program 4 Specify a program to use instead of latex. For example, \f(CW\*(C`--latex=pdflatex\*(C'\fR would typeset the given document using pdflatex instead of ordinary latex.


--permit=feature 4 Permit particular Perl operations to be performed. The \f(CW\*(C`--permit\*(C'\fR option, which can be specified more than once on the command line, enables finer-grained control over the perltex sandbox. See Opcode for more information.

These options are then followed by whatever options are normally passed to latex (or whatever program was specified with \f(CW\*(C`--latex\*(C'\fR), including, for instance, the name of the .tex file to compile.

# 5. EXAMPLES ▲

In its simplest form, perltex is run just like latex:

perltex myfile.tex

To use pdflatex instead of regular latex, use the \f(CW\*(C`--latex\*(C'\fR option:

perltex --latex=pdflatex myfile.tex

If LaTeX gives a ``\f(CW\*(C`trapped by operation mask\*(C'\fR'' error and you trust the .tex file you're trying to compile not to execute malicious Perl code (e.g., because you wrote it yourself), you can disable perltex's safety mechansisms with \f(CW\*(C`--nosafe\*(C'\fR:

perltex --nosafe myfile.tex

The following command gives documents only perltex's default permissions (\f(CW\*(C`:browse\*(C'\fR) plus the ability to open files and invoke the \f(CW\*(C`time\*(C'\fR command:

perltex --permit=:browse --permit=:filesys_open --permit=time myfile.tex

# 6. ENVIRONMENT ▲

perltex honors the following environment variables:

PERLTEX 4 Specify the filename of the LaTeX compiler. The LaTeX compiler defaults to ``\f(CW\*(C`latex\*(C'\fR''. The \f(CW\*(C`PERLTEX\*(C'\fR environment variable overrides this default, and the \f(CW\*(C`--latex\*(C'\fR command-line option (see \*(L"OPTIONS\*(R") overrides that.

# 7. FILES ▲

While compiling jobname.tex, perltex makes use of the following files:

jobname.lgpl 4 log file written by Perl; helpful for debugging Perl macros

jobname.topl 4 information sent from LaTeX to Perl

jobname.frpl 4 information sent from Perl to LaTeX

jobname.tfpl 4 ``flag'' file whose existence indicates that jobname.topl contains valid data

jobname.ffpl 4 ``flag'' file whose existence indicates that jobname.frpl contains valid data

jobname.dfpl 4 ``flag'' file whose existence indicates that jobname.ffpl has been deleted

# 8. NOTES ▲

perltex's sandbox defaults to what Opcode calls ``\f(CW\*(C`:browse\*(C'\fR''.