ROFF(ID:2453/rof001)

UNIX RUNOFF 


for RunOFF

Text formatting language/interpreter

from Groff history section:
"`troff' can trace its origins back to a formatting program called  `runoff', written by J. E. Saltzer, which ran on MIT's CTSS operating  system in the mid-sixties.  This name came from the common phrase of  the time "I'll run off a document."  Bob Morris ported it to the 635  architecture and called the program `roff' (an abbreviation of `runoff').  It was rewritten as `rf' for the PDP-7 (before having UNIX), and at the same time (1969), Doug McIllroy rewrote an extended and simplified version of `roff' in the BCPL programming language.

The first version of UNIX was developed on a PDP-7 which was sitting  around Bell Labs.  In 1971 the developers wanted to get a PDP-11 for further work on the operating system.  In order to justify the cost for this system, they proposed that they would implement a document formatting system for the AT&T patents division.  This first formatting program was a reimplementation of McIllroy's `roff', written by J. F. Ossanna.

When they needed a more flexible language, a new version of roff called nroff (Newer roff) was written. It had a much more complicated syntax, but provided the basis for all future versions. When they got a Graphic Systems CAT Phototypesetter, Ossanna wrote a version of nroff which would drive it. It was dubbed troff for typesetter roff, although many people have speculated that it actually means Times roff because of the use of the Times font family in troff by default. As such, the name troff is pronounced `t-roff' rather than `trough'."


Related languages
RUNOFF => ROFF   Port
ROFF => NROFF   Extension of

References:
  • Ossanna, J. F. "NROFF/TROFF User's Manual," Comp. Sci. Tech. Rep. 54, Bell Laborato­ries, Murray Hill, NJ (October 1976). view details ps Extract: Introduction
    Introduction

    Troff and nroff are text processors that format text for typesetter- and typewriter-like terminals, respectively. They accept lines of text interspersed with lines of format control information and format the text into a printable, paginated document having a user-designed style. Troff and nroff offer unusual freedom in document styling: arbitrary style headers and footers; arbitrary style footnotes; multiple automatic sequence numbering for paragraphs, sections, etc; multiple column output; dynamic font and point-size control; arbitrary horizontal and vertical local motions at any point; and a family of automatic overstriking, bracket construction, and line-drawing functions.

    Troff produces its output in a device-independent form, although parameterized for a specific device; troff output must be processed by a driver for that device to produce printed output. Troff and nroff are highly compatible with each other and it is almost always possible to prepare input acceptable to both. Conditional input is provided that enables the user to embed input expressly destined for either program. Nroff can prepare output directly for a variety of terminal types and is capable of utilizing the full resolution of each terminal. A warning, however: nroff necessarily cannot support all features of troff. Within that limitation, it is the same as troff, and in fact there is only a single program, invoked by two different names. Extract: Background to the Second Edition
    Background to the Second Edition

    Troff was originally written by the late Joe Ossanna in about 1973, in assembly language for the PDP-11, to drive the Graphic Systems CAT typesetter. It was rewritten in C around 1975, and underwent slow but steady evolution until Ossanna's death late in 1977.

    In 1979, Brian Kernighan modified troff so that it would produce output for a variety of typesetters, while retaining its input specifications. Over the decade from 1979 to 1989, the internals have been modestly revised, though much of the code remains as it was when Ossanna wrote it.

    Troff reads parameter files each time it is invoked, to set values for machine resolution, legal type sizes and fonts, and character names, character widths and the like. Troff output is ASCII characters in a simple language that describes where each character is to be placed and in what size and font. A post-processor must be written for each device to convert this typesetter-independent language into specific instructions for that device.

    The output language contains information that was not readily identifiable in the older output. Most notably, the beginning of each page and line is marked, so post-processors can do device-specific optimizations such as sorting the data vertically or printing it boustrophedonically, independent of troff.

    Capabilities for graphics have been added. troff now recognizes commands for drawing diagonal lines, circles, ellipses, circular arcs, and quadratic B-splines; there are also ways to pass arbitrary information to the output unprocessed by troff.
    A number of limitations have been eased or eliminated. A document may have an arbitrary number of fonts on any page (if the output device permits it, of course). Fonts may be accessed merely by naming them; "mounting'' is no longer necessary. There are no limits on the number of characters. Character height and slant may be set independently of width.

    The remainder of this document contains a description of usage and command-line options; a summary of requests, escape sequences, and pre-defined number registers; a reference manual; tutorial examples; and a list of commonly-available characters. Extract: Acknowledgements
    Acknowledgements

    Joe Ossanna's troff remains a remarkable accomplishment. For fifteen years, it has proven a robust tool, taking unbelievable abuse from a variety of preprocessors and being forced into uses that were never conceived of in the original design, all with considerable grace under fire. The current version of troff has profited from significant code improvements by Jaap Akkerhuis, Dennis Ritchie, Ken Thompson, and Molly Wagner. Andrew Hume, Doug McIlroy, and Ravi Sethi made valuable suggestions on the manual. I fear that the remaining bugs are my fault.
  • Gehani, Narain "Document Formatting and Type-setting on the UNIX System" Silicon Press, Summit, NJ 1986 view details
  • Roddy, Kevin P. "UNIX NROFF/TROFF: a user's guide", Holt, Rinehart and Winston, New York, 1987 view details