A technical writer recently transitioned from producing technical documentation to writing fiction, discovering that the legacy groff typesetting system—traditionally used for rendering manual pages in Linux terminals—could be adapted for book production. While modern tools are often preferred for their visual accessibility, the author highlights groff's primary advantages as being relatively small and exceptionally fast. On a 13.5-year-old PC, groff can render a 50-page document in approximately 700 milliseconds and a 120-page document in 1.6 seconds, offering a high-performance alternative to modern software that can feel sluggish during the typesetting process.
The mechanism for producing a book in groff involves defining a custom macro package to handle basic formatting. By using the `.de` command, the author created specific macros for chapter headings (`.SH`), normal paragraphs with hanging indents (`.PP`), and intra-chapter spacing (`.LP`). For example, the `.PP` macro handles the specific requirement for hanging indents common in German books by breaking the current line and requesting a temporary indent for the next output line. More complex elements, such as footers and page numbers, are managed through 'traps' and environment switching. A trap is installed at a specific vertical position (e.g., 5v before the end of the page) to trigger a macro that switches to a dedicated footer environment, prints the page number, and then requests a page break.
Despite its capabilities, using groff for book production involves specific trade-offs and technical hurdles. The author notes that groff lacks the 'visually pleasing' nature of Markdown, which can make the raw source files less intuitive for the creative writing process. Furthermore, mastering the system requires navigating complex behaviors, such as the use of the neutral apostrophe (`'`) as a no-break control character to prevent unwanted line breaks when inserting specific text. The author also acknowledges unresolved technical nuances, such as perfect symmetry in header and footer sizes and the exact mechanics of certain vertical position requests, illustrating that while groff is powerful, it requires a deep, manual understanding of its internal logic to achieve professional results.
