pdfmom
Format troff documents into PDF
SYNOPSIS
pdfmom [options] [files...]
PARAMETERS
[files...]
One or more input files to be processed. If no files are specified, pdfmom reads from standard input.
-e
Enable the eqn preprocessor for typesetting mathematical equations.
-p
Enable the pic preprocessor for drawing diagrams.
-t
Enable the tbl preprocessor for formatting tables.
-R
Enable the refer preprocessor for handling bibliographic references.
-s
Enable the soelim preprocessor for handling `.so` requests (source inclusion).
-I dir
Add dir to the search path for files specified with `"` (include) requests.
-m name
Read the macro file name. Although pdfmom implies mom, this can be used for additional macro sets.
-r cn
Set number register c to value n.
-d cval
Define string c as val.
-o pages
Output only the specified pages. Pages can be a comma-separated list or ranges (e.g., '1,3-5,7').
-z
Suppress formatted output; primarily used for checking syntax and producing error messages.
-P arg
Pass arg directly to the postprocessor (e.g., gs or ps2pdf). Useful for specific PDF output options.
--version
Display version information and exit.
--help
Display a help message and exit.
DESCRIPTION
pdfmom is a convenience wrapper script that processes documents written using the groff typesetting system and the mom macro package, directly outputting them as PDF files.
It streamlines the workflow by automatically invoking groff with the appropriate output device (implicitly `pdf` via `-Tpdf`) and the mom macros (`-mom`), and then piping the generated PostScript output through a PostScript-to-PDF converter (like gs or ps2pdf). This eliminates the need for manual invocation of multiple commands, making it simpler for users to create high-quality PDF documents from their groff mom sources.
CAVEATS
pdfmom is a wrapper script, meaning it relies on the correct installation and configuration of underlying tools. Key considerations include:
groff: It requires a functional groff installation, specifically with the mom macro package installed.
PDF Converter: A PostScript-to-PDF converter (such as Ghostscript's gs command or ps2pdf) must be available in the system's PATH.
Debugging: Debugging issues often requires familiarity with groff's error messages and general behavior.
TYPICAL WORKFLOW
Users typically write their document source in a text editor, incorporating mom macros. The pdfmom command is then run on this source file, producing a PDF output file.
For example: pdfmom mydocument.mom > mydocument.pdf
DEPENDENCIES
pdfmom relies on:
groff: The GNU troff document formatting system.
mom macros: The `mom` macro package for groff.
PostScript-to-PDF converter: Such as Ghostscript (gs) or ps2pdf (often provided by Ghostscript or TeX Live).
HISTORY
The mom macros themselves were developed by Peter Schaffter to provide a more intuitive and powerful way to format documents with troff/groff. As PDF became the standard for document exchange, utility scripts like pdfmom emerged to simplify the process of generating PDF directly from groff sources. pdfmom is part of the groff distribution, reflecting the project's evolution to provide modern output formats for its powerful typesetting capabilities.