Troff

Troff

:"See also trough."

:"TROFF may also refer to a command in the BASIC programming language. It is short for 'TRACE OFF'. Some BASIC interpreter implementations used 'TROFF' in place of or in addition to 'TRACE OFF"'

lowercase|title=troff

troff is a document processing system developed by AT&T for the Unix operating system.

History

troff can trace its origins back to a text formatting program called RUNOFF, written by Jerome H. Saltzer for MIT's CTSS operating system in the mid-1960s. (The name allegedly came from the phrase at the time, "I'll run off a document".)

Bob Morris ported it to the GE 635 architecture and called the program roff (an abbreviation of "runoff"). It was rewritten as rf for the PDP-7, and at the same time (1969), Doug McIlroy 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 Joe 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" that would drive it. It was dubbed "troff", for "typesetter 'roff"'. As such, the name "troff" is pronounced "t-roff" rather than "trough".

With "troff" came "nroff" (they were actually almost the same program), which was for producing output for line printers and character terminals. It understood everything "troff" did, and ignored the commands which were not applicable (e.g. font changes).

Unfortunately, Ossanna's "troff" was written in PDP-11 assembly language and produced output specifically for the CAT phototypesetter. He rewrote it in C, although it was now 7000 lines of uncommented code and still dependent on the CAT. As the CAT became less common, and was no longer supported by the manufacturer, the need to make it support other devices became a priority. However, before this could be done, Ossanna died.

So, Brian Kernighan took on the task of rewriting "troff". The newly rewritten version produced a device independent code which was very easy for postprocessors to read and translate to the appropriate printer codes. Also, this new version of "troff" (called ditroff for "device independent troff") had several extensions, which included drawing functions. It was described in a Bell Labs Computing Science Technical Report entitled "A Typesetter-independent TROFF"; it is available from the Computing Science Technology website in gzipped PostScript [http://cm.bell-labs.com/cm/cs/cstr/97.ps.gz here] . The document defines the output format of ditroff, which is used by many modern troff clones like GNU groff.

The "troff" collection of tools was eventually called "Documenter's WorkBench" (DWB), and was under continuous development in Bell Labs and later at the spin-off Unix System Laboratories (USL) through 1994. At that time, SoftQuad took over the maintenance, although Brian Kernighan continued to improve "troff" on his own. There are thus currently four variants of the original Bell Labs "troff":

*An ancient variation from Bill Joy, still shipped by Sun Microsystems.
*The SoftQuad DWB, based on USL DWB 2.0 from 1994
*The DWB 3.4 from Lucent Software Solutions (USL)
*Troff, Plan 9 edition

Use of "troff" and family was reduced somewhat in the 1990s, but it is still being used quite extensively. While "troff" has been supplanted by other programs such as Interleaf, FrameMaker and LaTeX, it is still the default format of the UNIX documentation.

The software was reimplemented as groff for the GNU system beginning in 1990. In addition, due to the open sourcing of Ancient UNIX Systems, as well as modern successors such as OpenSolaris and Plan 9 from Bell Labs, several versions of AT&T troff are available under various open source licenses.

Features

"troff" features commands to designate fonts, spacing, paragraphs, margins, footnotes and more. Unlike many other text formatters, "troff" can position characters arbitrarily on a page, even overlapping them, and has a fully programmable input language. Separate preprocessors are used for more convenient production of tables, diagrams, and mathematics. Inputs to troff are plain text files that can be created by any text editor.

Extensive macro packages have been created for various document styles. A typical distribution of troff includes the me macros for formatting research papers, man macros for creating Unix man pages, and the ms and mm macros for letters, books, technical memoranda, and reports.

As "troff" evolved, since there are several things which cannot be done easily in "troff", several preprocessors were developed. These programs transform certain parts of a document into "troff" input, fitting naturally into the use of "pipelines" in Unix — sending the output of one program as the input to another (see pipes and filters).

The eqn preprocessor allows mathematical formulae to be specified in a much simpler and more intuitive manner. tbl is a preprocessor for formatting tables. The refer preprocessor (and the similar program "bib") processes citations in a document according to a bibliographic database.

Later, several other preprocessors appeared. The "pic" preprocessor provides a domain-specific programming language with a wide range of drawing functions. The "ideal" preprocessor does much the same thing, although via a much different paradigm. The "grap" preprocessor takes specifications for graphs, but, unlike other preprocessors, produces "pic" code.

Reimplementations

*groff is the GNU project's free replacement for troff and nroff.
* [http://www-rn.informatik.uni-bremen.de/software/unroff/ unroff] is an extensible replacement of troff written in Scheme
* [http://heirloom.sf.net/ Heirloom troff] is based on troff from OpenSolaris. It includes: support for OpenType fonts, improved support for Type 1 fonts, support for Unicode, a new paragraph formatting algorithms, and a groff compatibility mode.

References

* [http://groups.google.com/groups?selm=DqA8Hy.Jyn%40research.att.com Nils-Peter Nelson letter explaining roff/troff/DWB history and status]

ee also

*TeX
*DocBook
*SGML
*Desktop publishing

External links

* [http://troff.org/ The Text Processor for Typesetters]
* [http://www.troff.org/history.html The history of troff]
* [http://heirloom.sourceforge.net/doctools.html OpenSolaris-derived port of troff and related programs]
* [http://plan9.bell-labs.com/sys/doc/troff.pdf User manual for the Plan 9 edition of troff]


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Troff — Saltar a navegación, búsqueda troff es un sistema de proceso de textos desarrollado por AT T para el sistema operativo UNIX. Características Entre las características de troff se encuentran el espaciado, párrafos, márgenes, notas al pie de página …   Wikipedia Español

  • troff — es un sistema de proceso de textos desarrollado por AT T para el sistema operativo UNIX. Características Entre las características de troff se encuentran el espaciado, párrafos, márgenes, notas al pie de página y mucho más. A diferencia de otros… …   Wikipedia Español

  • Troff — oder TROFF steht für: Troff (Software), kurz für Text Runoff, eine Textsatzsoftware. den Debugging Befehl trace off der Programmiersprache BASIC. Diese Seite ist eine Begriffsklärung zur Unterscheidung me …   Deutsch Wikipedia

  • troff — This article is about the Unix document processing system. For the command in BASIC, see TROFF. Not to be confused with Trough (disambiguation). troff is a document processing system developed by AT T for the Unix operating system. Contents 1… …   Wikipedia

  • Troff — Roff Roff est un langage de formatage de texte historiquement lié à UNIX et à ses dérivés (BSD, Linux...). Sommaire 1 Description 2 Historique 2.1 CTSS et Multics : runoff 2 …   Wikipédia en Français

  • troff — trọff → triefen * * * trọff, trọ̈f|fe: ↑ triefen. * * * Troff,   Unix. * * * trọff, trọ̈f|fe: ↑triefen …   Universal-Lexikon

  • troff — Cumbrian Dictionary ( n troff) See scran …   English dialects glossary

  • Troff (Software) — Troff ist ein Textsatzsystem, das von AT T für das Betriebssystem Unix entwickelt wurde. Es erlaubt professionellen und qualitativ hochwertigen Textsatz, samt typographischen Merkmalen wie verschiedenen Schriftarten, und Schriftschnitten,… …   Deutsch Wikipedia

  • Troff macro — The troff typesetting system includes sets of commands called macros that are run before starting to process the document. These macros include setting up page headers and footers, defining new commands, and generally influencing how the output… …   Wikipedia

  • troff — Typesetter Run Off Standard UNIX Tool zur Drucker Textformatierung http://www.desy.de/cgi bin/man cgitroff …   Acronyms

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”