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: 28 Apr 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 AUTHOR, with no Front-Cover Texts, and with no
18 A copy of the Free Documentation License is included as a file called
19 fdl.txt in the main directory of the groff source package.
21 .\" --------------------------------------------------------------------
23 .\" --------------------------------------------------------------------
25 . ds @tmp@ \\fB\\$1\\fP\\fR(\\$2)\\fP
33 . ds @tmp@ \\fB\\$1\\fP\\fI\\$2\\fP
35 \\*[@tmp@]\\fR\\$*\\fP
40 .ds dquote \&"\" make Emacs happy
41 .\" --------------------------------------------------------------------
43 .\" --------------------------------------------------------------------
44 .TH ROFF @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
46 roff \- a survey of the roff typesetting system
47 .\" --------------------------------------------------------------------
49 .\" --------------------------------------------------------------------
51 is the general name for a set of type-setting programs, known under
60 type-setting system consists of a formatting language, macro packages,
61 preprocessors, postprocessors for output devices, user front-end
62 programs, and conversion tools.
66 system today is the free software implementation
69 The pre-groff implementations are referred to as "classical" (dating
70 back as long as 1973).
73 is backward-compatible to its classical ancestors, but has many
74 extensions, and is still evolving.
75 As it is available for almost every computer systems it is the de-facto
81 is in wide use today, e.g., the manual pages on UNIX systems
86 Its output for text devices is still unmatched, and its graphical output
87 has the same quality as the other free type-setting programs and is
88 better than some of the commercial systems.
90 This document gives only an overview and provides pointers to further
92 This document is not maintained and might be out of date.
93 For the real documentation refer to the
96 It contains more detailed, actual and concise information.
97 .\" --------------------------------------------------------------------
98 .SH "FORMATTING LANGUAGE"
99 .\" --------------------------------------------------------------------
100 There are three terms that refer to the language of the
104 is used when the classical aspects of
106 are stressed, the term
108 includes the GNU extensions, whereas
112 The main source of documentation for all aspects of the
114 is the groff info file. The manual page
115 .BR groff (@MAN7EXT@)
116 gives a short description of all predefined language elements.
119 documents are normal text files decorated by formatting elements.
120 It is very easy to write high-quality documents by using one of the macro
122 These are like high-level programming languages, while the bare
124 language compares to a low-level language like C or assembler.
128 language is a full programming language providing low-level requests,
129 definition of macros, escape sequences, string variables, number or size
130 registers, and C-like flow controls.
131 In the 1980s, it was even possible to write the common utilities for system
132 administration by only using
134 There were contests on writing the most unreadable program fake by
137 Because of security impacts, these dangerous features were removed in
140 Some clarification on the language elements seems to be wanted.
141 Requests are basic formatting commands defined by programming languages
142 like C, C++, etc., whereas macros are formatting commands that are
146 A document writer will not note any difference in usage for requests or
147 macros, both are written on a line on their own starting with a dot `.'.
148 But the user may define her own macros if desired.
150 Escape sequences are in-line elements starting with a backslash `\e'.
151 They are used to implement various features, including the insertion of
152 non-ASCII characters with \fB\e(\fP, the content of strings with
153 \fB\e*\fP and register variables with \fB\en\fP, font changes with
154 \fB\ef\fP, in-line comments with \fB\e\*[dquote]\fP, the escaping of
155 special characters used in the
157 language like \fB\e\e\fP, and many other features.
158 .\" --------------------------------------------------------------------
160 .\" --------------------------------------------------------------------
161 Formatters are the front-end programs that analize a groff document and
162 translate it into a form that is suitable for a special device.
169 for graphical devices.
171 These programs still exist in the
173 implementation, but usually they are accessed thru a program called
175 This combined and extended the old functionality into a single program.
176 It has many command-line options, most of them herited from
178 To ease the option jungle, the user-friendly utility
180 (from "groff guess") was created.
181 It tries to guess from the document which arguments should be used and
182 displays a suitable command line.
183 Though not being perfect, it is a good starting point.
184 .\" --------------------------------------------------------------------
186 .\" --------------------------------------------------------------------
187 There are 4 classical preprocessors that are still available in
190 for including mathematical equations,
192 for creating diagrams,
194 for rectangular tables, and
196 for including other roff files into a document.
197 There were many more preprocessors available in industrial roff
199 By the time, some of these will be available in groff as well, e.g., grap
200 has been actually developed.
202 Each of these preprocessors defines a language that is translated into
203 roff code when run through the preprocessor program.
204 So parts written in these languages may be included within a roff document.
205 Such an enhanced document is run thru one or more corresponding
206 preprocessors before it is fed into the actual formatter.
208 The preprocessors programs are called
215 They extract and transform the document parts determined for them.
217 The preprocessor programs can be used within a UNIX pipeline like
225 Alternatively, each one can be activated by a single character option when
229 The option letters are easy to remember, classical
233 use the first character of the preprocessor, i.e.,
240 .\" --------------------------------------------------------------------
242 .\" --------------------------------------------------------------------
243 Macro packages are collections of macros that are suitable to format a
244 special kind of documents in a convenient way.
245 This greatly eases the usage of
247 The macro definitions of a package are kept in a file called
253 name for this package.
254 All tmac files are stored in a single or few directories at standard
257 A macro package that is used in a document is specified by the command line
260 for the formatter like
261 .BI "troff\ -m "\ name
263 .BIR "troff\ -m" name .
264 General details on the naming of macro packages and their placement is
266 .BR tmac (@MAN5EXT@).
268 Famous classical macro packages are
278 for books, articles, and letters.
279 Besides these collections,
281 provides an increasing multitude of new macro packages for various
282 applications, for example integration of or conversion into other file
284 .\" --------------------------------------------------------------------
285 .SH "FILE NAME EXTENSIONS"
286 .\" --------------------------------------------------------------------
287 Manual pages (man-pages) take the section number as a file name
288 extension, e.g., the filename for this document is
290 i.e., it is kept in section\ 7 of the man-pages.
292 The classical macro packages take the package name as an extension, e.g.
294 for a document using the
309 But there is no general naming scheme for roff documents, though
313 seems to be a good choice.
315 File name extensions can be very handy in conjunction with the
318 It provides the possibility to feed all input into a command-line pipe that
319 is specified in the shell environment variable
321 This process is not well documented, so here an example
322 .B LESSOPEN='|lesspipe %s'
325 is either a system supplied command or a shell script of your own.
326 .\" --------------------------------------------------------------------
328 .\" --------------------------------------------------------------------
329 Most text editors provide support for editing documents using roff.
330 Especially useful is the
332 in all flavors of the Emacs editor.
333 .\" --------------------------------------------------------------------
335 .\" --------------------------------------------------------------------
339 A colon separated list of directories in which to search for
348 A colon separated list of directories in which to search for the
352 will search in directories given in the
354 option before these, and in standard directories
355 .RB ( .:/usr/local/share/groff/font:/usr/lib/font )
357 .\" --------------------------------------------------------------------
359 .\" --------------------------------------------------------------------
362 installs all of its library files in a directory tree under
363 .IR /usr/local/share/groff .
364 This location might vary for different systems systems.
365 In the following, this directory is referred to as
369 .B GROFF_DIR/tmac/troffrc
372 .BI GROFF_DIR/tmac/tmac. name
375 .BI GROFF_DIR/font/dev name /DESC
376 Device description file for device
379 .BI GROFF_DIR/font/dev name / F
384 .\" --------------------------------------------------------------------
386 .\" --------------------------------------------------------------------
387 The groff documentation is in evolution at the moment.
388 It is possible that small inconsistencies between different documents exist
390 .\" --------------------------------------------------------------------
392 .\" --------------------------------------------------------------------
393 This document was written by Bernd Warken <bwarken@mayn.de> and is part
394 of the GNU roff distribution.
396 It is distributed under the terms of the GFDL (GNU Free Documentation
397 License) version 1.1 or later.
398 You should have received a copy of the GFDL on your system, it is also
399 available on-line under
400 .IR <http://www.gnu.org/copyright/fdl.html> .
401 .\" --------------------------------------------------------------------
403 .\" --------------------------------------------------------------------
404 The main source of information is the
409 The predefined elements of the
411 language are also documented in the manual page
412 .BR groff (@MAN7EXT@).
414 Formatters and their wrappers:
415 .BR groff (@MAN1EXT@),
416 .BR grog (@MAN1EXT@),
417 .BR nroff (@MAN1EXT@),
419 .BR troff (@MAN1EXT@).
421 Postprocessors for the output devices:
422 .BR grodvi (@MAN1EXT@),
423 .BR grohtml (@MAN1EXT@),
424 .BR grolbp (@MAN1EXT@),
425 .BR grolj4 (@MAN1EXT@),
426 .BR grops (@MAN1EXT@),
428 .BR grotty (@MAN1EXT@).
430 Standard preprocessors:
435 .BR refer (@MAN1EXT@),
436 .BR soelim (@MAN1EXT@),
440 The man pages for macro packages include
441 .BR groff_tmac (@MAN5EXT@),
442 .BR groff_man (@MAN7EXT@),
443 .BR groff_markup (@MAN7EXT@),
444 .BR groff_mdoc (@MAN7EXT@),
445 .BR groff_mdoc.samples (@MAN7EXT@),
446 .BR groff_me (@MAN7EXT@),
447 .BR groff_mm (@MAN7EXT@),
448 .BR groff_mmroff (@MAN7EXT@),
449 .BR groff_ms (@MAN7EXT@),
451 .BR groff_msafer (@MAN7EXT@).
453 The following utils are available:
454 .BR addftinfo (@MAN1EXT@),
455 .BR afmtodif (@MAN1EXT@),
456 .BR hpftodit (@MAN1EXT@),
457 .BR indxbib (@MAN1EXT@),
458 .BR lookbib (@MAN1EXT@),
459 .BR pfbtops (@MAN1EXT@),
460 .BR tfmtodit (@MAN1EXT@),
462 .BR gxditview (@MAN1EXT@).
464 For details on the GNU implementation of the
467 .BR groff_char (@MAN7EXT@),
468 .BR groff_font (@MAN7EXT@),
469 .BR groff_out (@MAN7EXT@),
472 in the main directory of the groff source distribution.
473 These also give details on how to contact or join the
479 documents are still available on-line.
480 Especially informative are the original Bell Labs proceedings for the old,
482 .I http://cm.bell-labs.com/cm/cs/cstr.html
483 and the Collection of Richard S. Stevens at
484 .IR http://www.kohala.com/start/troff/ .