5 This file is part of groff, the GNU roff type-setting system.
7 Copyright (C) 2000 Free Software Foundation, Inc.
8 written by Bernd Warken <bwarken@mayn.de>
10 Last update: 17 May 2000
12 Permission is granted to copy, distribute and/or modify this document
13 under the terms of the GNU Free Documentation License, Version 1.1 or
14 any later version published by the Free Software Foundation; with the
15 Invariant Sections being this .ig-section and AUTHOR, with no
16 Front-Cover Texts, and with no Back-Cover Texts.
18 A copy of the Free Documentation License is included as a file called
19 FDL in the main directory of the groff source package.
22 .\" --------------------------------------------------------------------
24 .\" --------------------------------------------------------------------
33 .\" text lines in macro definitions or bracketed sections \{...\}
39 . ds @tmp@ \f(CB\\$1\fP
46 . ds @tmp@ `\f(CB\\$1\fP'
53 . ds @tmp@ \f(CB\e\\$1\fP
60 . ds @tmp@ \f(CI\\$1\fP
67 . ds @tmp@ \&\\$1\ \f(CR\\$2\fP
73 .\" --------------------------------------------------------------------
75 .\" --------------------------------------------------------------------
76 .TH ROFF @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
78 roff \- a survey of the roff typesetting system
79 .\" --------------------------------------------------------------------
81 .\" --------------------------------------------------------------------
83 is the general name for a set of type-setting programs, known under
90 The roff type-setting system consists of a formatting language, macro
91 packages, preprocessors, postprocessors for output devices, user
92 front-end programs, and conversion tools.
94 The most common roff system today is the free software implementation
97 The pre-groff implementations are referred to as `classical' (dating
98 back as long as 1973).
101 is backward-compatible to its classical ancestors, but has many
102 extensions, and is still evolving.
103 As it is available for almost every computer system it is the de-facto
106 In spite of its age, roff is in wide use today, e.g., the manual pages
110 The roff output for text devices is still unmatched, and its graphical
111 output has the same quality as the other free type-setting programs and
112 is better than some of the commercial systems.
114 This document gives only an overview and provides pointers to further
117 This document is not maintained and might be out of date. For the real
118 documentation refer to the groff info file that contains the detailed,
119 actual and concise reference information.
120 .\" --------------------------------------------------------------------
121 .SH "FORMATTING LANGUAGE"
122 .\" --------------------------------------------------------------------
123 There are three terms that refer to the language of the
128 is used when the classical aspects of
130 are stressed, the term
132 includes the GNU extensions, whereas
136 The main source of documentation for all aspects of the
138 is the groff info file. The manual page
139 .BR groff (@MAN7EXT@)
140 gives a short description of all predefined language elements.
142 Documents using roff are normal text files decorated by formatting
144 It is very easy to write high-quality documents by using one of the
146 These are like high-level programming languages, while the bare roff
147 language compares to a low-level language like C or assembler.
149 The roff language is a full programming language providing low-level
150 requests, definition of macros, escape sequences, string variables,
151 number or size registers, and C-like flow controls.
153 In the 1980s, it was even possible to write the common utilities for
154 system administration by only using troff.
155 There were contests on writing the most unreadable program fake by
156 exclusively using troff.
157 Because of security impacts, these dangerous features were removed in
161 Some clarification on the language elements seems to be wanted.
162 Requests are basic formatting commands defined by programming languages
163 like C, C++, etc., whereas macros are formatting commands that are
164 written in the roff language.
165 A document writer will not note any difference in usage for requests or
166 macros, both are written on a line on their own starting with a dot
168 But the user may define her own macros if desired.
170 Escape sequences are in-line elements starting with a backslash
172 They are used to implement various features, including the insertion of
173 non-ASCII characters with
175 the content of strings with
177 and register variables with
181 in-line comments with
183 the escaping of special control characters like
185 and many other features.
186 .\" --------------------------------------------------------------------
188 .\" --------------------------------------------------------------------
189 Formatters are the front-end programs that analyze a groff document and
190 translate it into a form that is suitable for a special device.
197 for graphical devices.
199 These programs still exist in the
201 implementation, but usually they are accessed through a program called
203 This combined and extended the old functionality into a single program.
204 It has many command-line options, most of them herited from
206 To ease the option jungle, the user-friendly utility
208 (from `groff guess') was created.
209 It tries to guess from the document which arguments should be used and
210 displays a suitable command line.
211 Though not being perfect, it is a good starting point.
212 .\" --------------------------------------------------------------------
214 .\" --------------------------------------------------------------------
215 The classical preprocessors that are still available in groff.
221 for including mathematical equations.
224 for constructing graphical elements (this preprocessor doesn't come with
225 groff; it is an extra package).
228 for including gremlin pictures.
231 for creating diagrams.
234 for bibliographic references.
237 for including other roff files.
240 for rectangular tables.
244 Each of these preprocessors defines its own language that is translated
245 into roff code when run through the preprocessor program.
246 So parts written in these languages may be included within a roff
248 Such an enhanced document is run through one or more corresponding
249 preprocessors before it is fed into the actual formatter.
251 The preprocessor programs extract and transform the document parts
253 They can be called either in a UNIX pipeline with their program name or
254 automatically with a groff option.
257 center, box, tab (@);
260 preprocessor@groff option
272 .\" --------------------------------------------------------------------
274 .\" --------------------------------------------------------------------
275 Macro packages are collections of macros that are suitable to format a
276 special kind of documents in a convenient way.
277 This greatly eases the usage of roff.
278 The macro definitions of a package are kept in a file called
282 is the internal roff name for this package.
283 All tmac files are stored in a single or few directories at standard
286 A macro package that is used in a document is specified by the command line
289 for the formatter like
295 General details on the naming of macro packages and their placement is
297 .BR tmac (@MAN5EXT@).
299 Famous classical macro packages are
309 for books, articles, and letters.
310 Besides these collections, groff provides an increasing number of new
311 macro packages for various applications, for example integration of or
312 conversion into other file formats.
313 .\" --------------------------------------------------------------------
314 .SH "FILE NAME EXTENSIONS"
315 .\" --------------------------------------------------------------------
316 Manual pages (man-pages) take the section number as a file name
317 extension, e.g., the filename for this document is
320 .prefixednumber section 7
323 The classical macro packages take the package name as an extension, e.g.
325 for a document using the
341 But there is no general naming scheme for roff documents, though
345 seems to be a good choice.
347 File name extensions can be very handy in conjunction with the
350 It provides the possibility to feed all input into a command-line pipe that
351 is specified in the shell environment variable
353 This process is not well documented, so here an example
354 .B LESSOPEN='|lesspipe %s'
357 is either a system supplied command or a shell script of your own.
359 .\" --------------------------------------------------------------------
361 .\" --------------------------------------------------------------------
362 Most text editors provide support for editing documents using roff.
363 Especially useful is the
365 in all flavors of the Emacs editor.
366 .\" --------------------------------------------------------------------
368 .\" --------------------------------------------------------------------
372 A colon separated list of directories in which to search for
374 .BR tmac (@MAN5EXT@).
382 A colon separated list of directories in which to search for the
386 will search in directories given in the
388 option before these, and in standard directories
389 .RB ( .:/usr/local/share/groff/font:/usr/lib/font )
391 .\" --------------------------------------------------------------------
393 .\" --------------------------------------------------------------------
396 installs all of its library files in a directory tree under
397 .IR /usr/local/share/groff .
398 This location might vary for different systems.
399 In the following, this directory is referred to as
403 .IB <groff_dir> /tmac/troffrc
404 Initialization file for troff.
406 .IB <groff_dir> /tmac/tmac. name
409 .IB <groff_dir> /font/dev name /DESC
410 Device description file for device
413 .IB <groff_dir> /font/dev name / F
418 .\" --------------------------------------------------------------------
420 .\" --------------------------------------------------------------------
421 The groff documentation is in evolution at the moment.
422 It is possible that small inconsistencies between different documents exist
424 .\" --------------------------------------------------------------------
426 .\" --------------------------------------------------------------------
427 This document is part of groff, the GNU roff distribution. It was
428 written by Bernd Warken <bwarken@mayn.de>.
430 It is distributed under the terms of the FDL (GNU Free Documentation
431 License) version 1.1 or later. You should have received a copy of the
432 FDL on your system, it is also available on-line under
435 .IR <http://www.gnu.org/copyleft/fdl.html> .
437 .\" --------------------------------------------------------------------
439 .\" --------------------------------------------------------------------
440 The main source of information is the
445 The predefined elements of the
447 language are also documented in the manual page
448 .BR groff (@MAN7EXT@).
450 Formatters and their wrappers:
451 .BR groff (@MAN1EXT@),
452 .BR grog (@MAN1EXT@),
453 .BR nroff (@MAN1EXT@),
455 .BR troff (@MAN1EXT@).
457 Postprocessors for the output devices:
458 .BR grodvi (@MAN1EXT@),
459 .BR grohtml (@MAN1EXT@),
460 .BR grolbp (@MAN1EXT@),
461 .BR grolj4 (@MAN1EXT@),
462 .BR grops (@MAN1EXT@),
464 .BR grotty (@MAN1EXT@).
466 Standard preprocessors:
471 .BR refer (@MAN1EXT@),
472 .BR soelim (@MAN1EXT@),
476 The man pages for macro packages include
477 .BR groff_tmac (@MAN5EXT@),
478 .BR groff_man (@MAN7EXT@),
479 .BR groff_markup (@MAN7EXT@),
480 .BR groff_mdoc (@MAN7EXT@),
481 .BR groff_mdoc.samples (@MAN7EXT@),
482 .BR groff_me (@MAN7EXT@),
483 .BR groff_mm (@MAN7EXT@),
484 .BR groff_mmroff (@MAN7EXT@),
485 .BR groff_ms (@MAN7EXT@),
487 .BR groff_msafer (@MAN7EXT@).
489 The following utilities are available:
490 .BR addftinfo (@MAN1EXT@),
491 .BR afmtodif (@MAN1EXT@),
492 .BR hpftodit (@MAN1EXT@),
493 .BR indxbib (@MAN1EXT@),
494 .BR lookbib (@MAN1EXT@),
495 .BR pfbtops (@MAN1EXT@),
496 .BR tfmtodit (@MAN1EXT@),
498 .BR gxditview (@MAN1EXT@).
500 For details on the GNU implementation of the
503 .BR groff_char (@MAN7EXT@),
504 .BR groff_font (@MAN7EXT@),
505 .BR groff_out (@MAN7EXT@),
508 in the main directory of the groff source distribution.
509 These also give details on how to contact or join the
515 documents are still available on-line.
516 Especially informative are the original Bell Labs proceedings for the old,
518 .I http://cm.bell-labs.com/cm/cs/cstr.html
519 and the collection of the late Richard S. Stevens at
520 .IR http://www.kohala.com/start/troff/ .