nroff was originally designed for terminals and line printers, which are devices with fixed width characters. troff was designed for the Wang CAT photo-typsetter, which could have up to four different fonts available, in many different point sizes.
Around 1980, Brian Kernighan revamped troff to create ditroff, the device-independent troff. This version accepted an enhanced language, and generated ASCII output that described the motions the output device should make around the page, the size and placement of characters, and so on. Then, to add a new output device (laser printer, photo-typesetter, or whatever), you would write a post-processor for the device independent output that would correctly drive your device. Recent version of troff are the device-independent version, usually with support for PostScript(TM) output.
The ditroff saga can be found in Bell Labs Computing Science Technical Report #97. You can get PostScript for this report via anonymous ftp to netlib.att.com. Change to /netlib/att/cs/cstr, use binary mode, and retrieve 97.ps.Z.
Now that you know what troff is, we'll discuss the specifics of the GNU version, groff. groff is written in C++. This is somewhat unusual; most GNU programs are written in C. To compile it, you need a C++ compiler. The GNU C++ compiler, g++, will usually do it with little problem. You will need both g++ and the GNU C++ library, libg++ to compile the groff suite of programs.
The programs in the suite are:
gtroff - the actual troff clone gtbl - the tbl clone geqn - the eqn clone gpic - the pic clone groff - the driver for the other programs
There is no grap clone. Anyone who wishes to write one should contact email@example.com.
groff has a large number of extensions over Unix troff. It particular, groff supports long names for commands, strings, and registers, and has many additional commands. It also has a compatibility mode, where all the extensions are turned off. This is occasionally necessary when using macro packages meant for original troff.
The groff pre-processors described above cannot be used with original troff; they take advantage of groff's extensions.
groff uses the ditroff model of post-processors for different devices, with the same intermediate format. By default, groff generates PostScript output. The other most useful output format is plain ASCII. This is in fact how nroff is provided; by a shell script that calls groff -Tascii (i.e., the output type [-T] is ASCII). An interesting output type is TeX DVI, which can be used on many older laser printers that do not support PostScript. groff comes with two previewers for X windows, using different density fonts (75 and 100 dots per inch).
groff comes with a number of macro packages. It has its own version of the -man macros. The -mgs package is the GNU version of -ms, and -mgm is the GNU version of -mm. These should be used in preference to the original packages, since they can also take advantage of the groff extensions. The Berkeley -me, -mdoc, and -mandoc packages are themselves freely distributable, and are included with the groff distribution.
What is really nice about groff is that it is like lint for your troff documents. The programs check *everything*. Many things that Unix troff silently ignores, groff will warn you about. Often there are subtle errors in your files, and groff will help you catch the problems. Although every once in a while, there really is no problem, and you need to use compatibility mode instead.
Unfortunately, the one major lack in the groff distribution is that there is no comprehensive manual. The Tenth Edition Research Unix Programmer's Manual describes troff and its friends in detail. groff is based on this specification. Additional information can be found in the man pages that come with groff.
Information about pic can be obtained via anonymous ftp from the same site and directory mentioned above, in the file 116.ps.Z. A description of grap can be found in 114.ps.Z.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Ubuntu Online Summit
- Devuan Beta Release
- The Qt Company's Qt Start-Up
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- May 2016 Issue of Linux Journal
- The US Government and Open-Source Software
- Open-Source Project Secretly Funded by CIA
- The Death of RoboVM
- EnterpriseDB's EDB Postgres Advanced Server and EDB Postgres Enterprise Manager
- New Container Image Standard Promises More Portable Apps
In modern computer systems, privacy and security are mandatory. However, connections from the outside over public networks automatically imply risks. One easily available solution to avoid eavesdroppers’ attempts is SSH. But, its wide adoption during the past 21 years has made it a target for attackers, so hardening your system properly is a must.
Additionally, in highly regulated markets, you must comply with specific operational requirements, proving that you conform to standards and even that you have included new mandatory authentication methods, such as two-factor authentication. In this ebook, I discuss SSH and how to configure and manage it to guarantee that your network is safe, your data is secure and that you comply with relevant regulations.Get the Guide