PERLTEX(1) | PERLTEX(1) |
perltex - enable LaTeX macros to be defined in terms of Perl code
perltex [--help] [--latex=program] [--[no]safe] [--permit=feature] [--makesty] [latex options]
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.
Clearly, Perl's programmability could complement LaTeX's typesetting strengths. perltex is the tool that enables a symbiosis between the two systems. All a user needs to do is compile a LaTeX document using perltex instead of latex. (perltex is actually a wrapper for latex, so no latex functionality is lost.) If the document includes a "\usepackage{perltex}" in its preamble, then "\perlnewcommand" and "\perlrenewcommand" macros will be made available. These behave just like LaTeX's "\newcommand" and "\renewcommand" except that the macro body contains Perl code instead of LaTeX code.
perltex accepts the following command-line options:
These options are then followed by whatever options are normally passed to latex (or whatever program was specified with "--latex"), including, for instance, the name of the .tex file to compile.
In its simplest form, perltex is run just like latex:
perltex myfile.tex
To use pdflatex instead of regular latex, use the --latex option:
perltex --latex=pdflatex myfile.tex
If LaTeX gives a ``"trapped by operation mask"'' 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 --nosafe:
perltex --nosafe myfile.tex
The following command gives documents only perltex's default permissions (":browse") plus the ability to open files and invoke the "time" command:
perltex --permit=:browse --permit=:filesys_open --permit=time myfile.tex
perltex honors the following environment variables:
While compiling jobname.tex, perltex makes use of the following files:
perltex's sandbox defaults to what Opcode calls ``":browse"''.
Scott Pakin, scott+pt@pakin.org
2019-09-15 | v2.2 |