1 .\" $Id: roff.7,v 1.2 2010/05/16 22:28:33 kristaps Exp $
3 .\" Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv>
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .Dd $Mdocdate: May 16 2010 $
22 .Nd roff language reference
26 language is a general-purpose text-formatting language. The purpose of
27 this document is to consistently describe those language constructs
30 utility. It is a work in progress.
34 document follows simple rules: lines beginning with the control
39 are parsed for macros. Other lines are interpreted within the scope of
41 .Bd -literal -offset indent
42 \&.xx Macro lines change control state.
43 Other lines are interpreted within the current state.
47 documents may contain only graphable 7-bit ASCII characters, the space
48 character, and, in certain circumstances, the tab character. All
53 Macros are arbitrary in length and begin with a control character ,
57 at the beginning of the line.
58 An arbitrary amount of whitespace may sit between the control character
60 Thus, the following are equivalent:
61 .Bd -literal -offset indent
66 This section is a canonical reference of all macros, arranged
70 Has the following syntax:
72 .Bd -literal -offset indent -compact
77 .Bd -literal -offset indent -compact
81 .Bd -literal -offset indent -compact
86 .Bd -literal -offset indent -compact
91 COND is a conditional (TODO: document).
93 If the BODY section is begun by an escaped brace
95 scope continues until a closing-brace macro
97 If the BODY is not enclosed in braces, scope continues until the next
99 If the COND is followed by a BODY on the same line, whether after a
100 brace or not, then macros
102 begin with a control character.
103 It is generally more intuitive, in this case, to write
104 .Bd -literal -offset indent
111 than having the macro follow as
113 .D1 \&.if COND \e{ .foo
115 The scope of a conditional is always parsed, but only executed if the
116 conditional evaluates to true.
118 Note that text subsequent a
121 Furthermore, if an explicit closing sequence
123 is specified in a free-form line, the entire line is accepted within the
124 scope of the prior macro, not only the text preceding the close.
127 Accepts the following syntax:
129 .Bd -literal -offset indent -compact
134 .Bd -literal -offset indent -compact
140 In the first case, input is ignored until a
142 macro is encountered on its own line.
143 In the second case, input is ignored until a
152 Do not use the escape
154 anywhere in the definition of END.
155 It causes very strange behaviour.
156 Furthermore, if you redefine a
162 the subsequent invocation of
164 will first signify the end of comment, then be invoked as a macro.
165 This behaviour really shouldn't be counted upon.
167 This section documents compatibility between mandoc and other other
168 troff implementations, at this time limited to GNU troff
172 refers to groff versions before the
175 .Pq somewhere between 1.15 and 1.19 .
179 Historic groff did not accept white-space buffering the custom END tag
187 reference was written by
188 .An Kristaps Dzonsons Aq kristaps@bsd.lv .