xref: /titanic_41/usr/src/man/man5/mandoc_roff.5 (revision 32a712da90cea6ff9a05f51e7844944ccfa28d5e)
1*32a712daSGarrett D'Amore.\"
2*32a712daSGarrett D'Amore.\" Permission to use, copy, modify, and distribute this software for any
3*32a712daSGarrett D'Amore.\" purpose with or without fee is hereby granted, provided that the above
4*32a712daSGarrett D'Amore.\" copyright notice and this permission notice appear in all copies.
5*32a712daSGarrett D'Amore.\"
6*32a712daSGarrett D'Amore.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
7*32a712daSGarrett D'Amore.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
8*32a712daSGarrett D'Amore.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
9*32a712daSGarrett D'Amore.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
10*32a712daSGarrett D'Amore.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
11*32a712daSGarrett D'Amore.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
12*32a712daSGarrett D'Amore.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
13*32a712daSGarrett D'Amore.\"
14*32a712daSGarrett D'Amore.\"
15*32a712daSGarrett D'Amore.\" Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
16*32a712daSGarrett D'Amore.\" Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
17*32a712daSGarrett D'Amore.\" Copyright 2012 Nexenta Systems, Inc. All rights reserved.
18*32a712daSGarrett D'Amore.\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
19*32a712daSGarrett D'Amore.\"
20*32a712daSGarrett D'Amore.Dd Jul 13, 2014
21*32a712daSGarrett D'Amore.Dt MANDOC_ROFF 5
22*32a712daSGarrett D'Amore.Os
23*32a712daSGarrett D'Amore.Sh NAME
24*32a712daSGarrett D'Amore.Nm mandoc_roff
25*32a712daSGarrett D'Amore.Nd roff language reference for mandoc
26*32a712daSGarrett D'Amore.Sh DESCRIPTION
27*32a712daSGarrett D'AmoreThe
28*32a712daSGarrett D'Amore.Nm roff
29*32a712daSGarrett D'Amorelanguage is a general purpose text formatting language.
30*32a712daSGarrett D'AmoreSince traditional implementations of the
31*32a712daSGarrett D'Amore.Xr mdoc 5
32*32a712daSGarrett D'Amoreand
33*32a712daSGarrett D'Amore.Xr man 5
34*32a712daSGarrett D'Amoremanual formatting languages are based on it,
35*32a712daSGarrett D'Amoremany real-world manuals use small numbers of
36*32a712daSGarrett D'Amore.Nm
37*32a712daSGarrett D'Amorerequests intermixed with their
38*32a712daSGarrett D'Amore.Xr mdoc 5
39*32a712daSGarrett D'Amoreor
40*32a712daSGarrett D'Amore.Xr man 5
41*32a712daSGarrett D'Amorecode.
42*32a712daSGarrett D'AmoreTo properly format such manuals, the
43*32a712daSGarrett D'Amore.Xr mandoc 1
44*32a712daSGarrett D'Amoreutility supports a tiny subset of
45*32a712daSGarrett D'Amore.Nm
46*32a712daSGarrett D'Amorerequests.
47*32a712daSGarrett D'AmoreOnly these requests supported by
48*32a712daSGarrett D'Amore.Xr mandoc 1
49*32a712daSGarrett D'Amoreare documented in the present manual,
50*32a712daSGarrett D'Amoretogether with the basic language syntax shared by
51*32a712daSGarrett D'Amore.Nm ,
52*32a712daSGarrett D'Amore.Xr mdoc 5 ,
53*32a712daSGarrett D'Amoreand
54*32a712daSGarrett D'Amore.Xr man 5 .
55*32a712daSGarrett D'AmoreFor complete
56*32a712daSGarrett D'Amore.Nm
57*32a712daSGarrett D'Amoremanuals, consult the
58*32a712daSGarrett D'Amore.Sx SEE ALSO
59*32a712daSGarrett D'Amoresection.
60*32a712daSGarrett D'Amore.Pp
61*32a712daSGarrett D'AmoreInput lines beginning with the control character
62*32a712daSGarrett D'Amore.Sq \&.
63*32a712daSGarrett D'Amoreare parsed for requests and macros.
64*32a712daSGarrett D'AmoreSuch lines are called
65*32a712daSGarrett D'Amore.Dq request lines
66*32a712daSGarrett D'Amoreor
67*32a712daSGarrett D'Amore.Dq macro lines ,
68*32a712daSGarrett D'Amorerespectively.
69*32a712daSGarrett D'AmoreRequests change the processing state and manipulate the formatting;
70*32a712daSGarrett D'Amoresome macros also define the document structure and produce formatted
71*32a712daSGarrett D'Amoreoutput.
72*32a712daSGarrett D'AmoreThe single quote
73*32a712daSGarrett D'Amore.Pq Qq \(aq
74*32a712daSGarrett D'Amoreis accepted as an alternative control character,
75*32a712daSGarrett D'Amoretreated by
76*32a712daSGarrett D'Amore.Xr mandoc 1
77*32a712daSGarrett D'Amorejust like
78*32a712daSGarrett D'Amore.Ql \&.
79*32a712daSGarrett D'Amore.Pp
80*32a712daSGarrett D'AmoreLines not beginning with control characters are called
81*32a712daSGarrett D'Amore.Dq text lines .
82*32a712daSGarrett D'AmoreThey provide free-form text to be printed; the formatting of the text
83*32a712daSGarrett D'Amoredepends on the respective processing context.
84*32a712daSGarrett D'Amore.Sh LANGUAGE SYNTAX
85*32a712daSGarrett D'Amore.Nm
86*32a712daSGarrett D'Amoredocuments may contain only graphable 7-bit ASCII characters, the space
87*32a712daSGarrett D'Amorecharacter, and, in certain circumstances, the tab character.
88*32a712daSGarrett D'AmoreThe back-space character
89*32a712daSGarrett D'Amore.Sq \e
90*32a712daSGarrett D'Amoreindicates the start of an escape sequence for
91*32a712daSGarrett D'Amore.Sx Comments ,
92*32a712daSGarrett D'Amore.Sx Special Characters ,
93*32a712daSGarrett D'Amore.Sx Predefined Strings ,
94*32a712daSGarrett D'Amoreand
95*32a712daSGarrett D'Amoreuser-defined strings defined using the
96*32a712daSGarrett D'Amore.Sx ds
97*32a712daSGarrett D'Amorerequest.
98*32a712daSGarrett D'Amore.Ss Comments
99*32a712daSGarrett D'AmoreText following an escaped double-quote
100*32a712daSGarrett D'Amore.Sq \e\(dq ,
101*32a712daSGarrett D'Amorewhether in a request, macro, or text line, is ignored to the end of the line.
102*32a712daSGarrett D'AmoreA request line beginning with a control character and comment escape
103*32a712daSGarrett D'Amore.Sq \&.\e\(dq
104*32a712daSGarrett D'Amoreis also ignored.
105*32a712daSGarrett D'AmoreFurthermore, request lines with only a control character and optional
106*32a712daSGarrett D'Amoretrailing whitespace are stripped from input.
107*32a712daSGarrett D'Amore.Pp
108*32a712daSGarrett D'AmoreExamples:
109*32a712daSGarrett D'Amore.Bd -literal -offset indent -compact
110*32a712daSGarrett D'Amore\&.\e\(dq This is a comment line.
111*32a712daSGarrett D'Amore\&.\e\(dq The next line is ignored:
112*32a712daSGarrett D'Amore\&.
113*32a712daSGarrett D'Amore\&.Sh EXAMPLES \e\(dq This is a comment, too.
114*32a712daSGarrett D'Amore\&example text \e\(dq And so is this.
115*32a712daSGarrett D'Amore.Ed
116*32a712daSGarrett D'Amore.Ss Special Characters
117*32a712daSGarrett D'AmoreSpecial characters are used to encode special glyphs and are rendered
118*32a712daSGarrett D'Amoredifferently across output media.
119*32a712daSGarrett D'AmoreThey may occur in request, macro, and text lines.
120*32a712daSGarrett D'AmoreSequences begin with the escape character
121*32a712daSGarrett D'Amore.Sq \e
122*32a712daSGarrett D'Amorefollowed by either an open-parenthesis
123*32a712daSGarrett D'Amore.Sq \&(
124*32a712daSGarrett D'Amorefor two-character sequences; an open-bracket
125*32a712daSGarrett D'Amore.Sq \&[
126*32a712daSGarrett D'Amorefor n-character sequences (terminated at a close-bracket
127*32a712daSGarrett D'Amore.Sq \&] ) ;
128*32a712daSGarrett D'Amoreor a single one character sequence.
129*32a712daSGarrett D'Amore.Pp
130*32a712daSGarrett D'AmoreExamples:
131*32a712daSGarrett D'Amore.Bl -tag -width Ds -offset indent -compact
132*32a712daSGarrett D'Amore.It Li \e(em
133*32a712daSGarrett D'AmoreTwo-letter em dash escape.
134*32a712daSGarrett D'Amore.It Li \ee
135*32a712daSGarrett D'AmoreOne-letter backslash escape.
136*32a712daSGarrett D'Amore.El
137*32a712daSGarrett D'Amore.Pp
138*32a712daSGarrett D'AmoreSee
139*32a712daSGarrett D'Amore.Xr mandoc_char 5
140*32a712daSGarrett D'Amorefor a complete list.
141*32a712daSGarrett D'Amore.Ss Text Decoration
142*32a712daSGarrett D'AmoreTerms may be text-decorated using the
143*32a712daSGarrett D'Amore.Sq \ef
144*32a712daSGarrett D'Amoreescape followed by an indicator: B (bold), I (italic), R (regular), or P
145*32a712daSGarrett D'Amore(revert to previous mode).
146*32a712daSGarrett D'AmoreA numerical representation 3, 2, or 1 (bold, italic, and regular,
147*32a712daSGarrett D'Amorerespectively) may be used instead.
148*32a712daSGarrett D'AmoreThe indicator or numerical representative may be preceded by C
149*32a712daSGarrett D'Amore(constant-width), which is ignored.
150*32a712daSGarrett D'Amore.Pp
151*32a712daSGarrett D'AmoreExamples:
152*32a712daSGarrett D'Amore.Bl -tag -width Ds -offset indent -compact
153*32a712daSGarrett D'Amore.It Li \efBbold\efR
154*32a712daSGarrett D'AmoreWrite in bold, then switch to regular font mode.
155*32a712daSGarrett D'Amore.It Li \efIitalic\efP
156*32a712daSGarrett D'AmoreWrite in italic, then return to previous font mode.
157*32a712daSGarrett D'Amore.El
158*32a712daSGarrett D'Amore.Pp
159*32a712daSGarrett D'AmoreText decoration is
160*32a712daSGarrett D'Amore.Em not
161*32a712daSGarrett D'Amorerecommended for
162*32a712daSGarrett D'Amore.Xr mdoc 5 ,
163*32a712daSGarrett D'Amorewhich encourages semantic annotation.
164*32a712daSGarrett D'Amore.Ss Predefined Strings
165*32a712daSGarrett D'AmorePredefined strings, like
166*32a712daSGarrett D'Amore.Sx Special Characters ,
167*32a712daSGarrett D'Amoremark special output glyphs.
168*32a712daSGarrett D'AmorePredefined strings are escaped with the slash-asterisk,
169*32a712daSGarrett D'Amore.Sq \e* :
170*32a712daSGarrett D'Amoresingle-character
171*32a712daSGarrett D'Amore.Sq \e*X ,
172*32a712daSGarrett D'Amoretwo-character
173*32a712daSGarrett D'Amore.Sq \e*(XX ,
174*32a712daSGarrett D'Amoreand N-character
175*32a712daSGarrett D'Amore.Sq \e*[N] .
176*32a712daSGarrett D'Amore.Pp
177*32a712daSGarrett D'AmoreExamples:
178*32a712daSGarrett D'Amore.Bl -tag -width Ds -offset indent -compact
179*32a712daSGarrett D'Amore.It Li \e*(Am
180*32a712daSGarrett D'AmoreTwo-letter ampersand predefined string.
181*32a712daSGarrett D'Amore.It Li \e*q
182*32a712daSGarrett D'AmoreOne-letter double-quote predefined string.
183*32a712daSGarrett D'Amore.El
184*32a712daSGarrett D'Amore.Pp
185*32a712daSGarrett D'AmorePredefined strings are not recommended for use,
186*32a712daSGarrett D'Amoreas they differ across implementations.
187*32a712daSGarrett D'AmoreThose supported by
188*32a712daSGarrett D'Amore.Xr mandoc 1
189*32a712daSGarrett D'Amoreare listed in
190*32a712daSGarrett D'Amore.Xr mandoc_char 5 .
191*32a712daSGarrett D'AmoreManuals using these predefined strings are almost certainly not portable.
192*32a712daSGarrett D'Amore.Ss Whitespace
193*32a712daSGarrett D'AmoreWhitespace consists of the space character.
194*32a712daSGarrett D'AmoreIn text lines, whitespace is preserved within a line.
195*32a712daSGarrett D'AmoreIn request and macro lines, whitespace delimits arguments and is discarded.
196*32a712daSGarrett D'Amore.Pp
197*32a712daSGarrett D'AmoreUnescaped trailing spaces are stripped from text line input unless in a
198*32a712daSGarrett D'Amoreliteral context.
199*32a712daSGarrett D'AmoreIn general, trailing whitespace on any input line is discouraged for
200*32a712daSGarrett D'Amorereasons of portability.
201*32a712daSGarrett D'AmoreIn the rare case that a blank character is needed at the end of an
202*32a712daSGarrett D'Amoreinput line, it may be forced by
203*32a712daSGarrett D'Amore.Sq \e\ \e& .
204*32a712daSGarrett D'Amore.Pp
205*32a712daSGarrett D'AmoreLiteral space characters can be produced in the output
206*32a712daSGarrett D'Amoreusing escape sequences.
207*32a712daSGarrett D'AmoreIn macro lines, they can also be included in arguments using quotation; see
208*32a712daSGarrett D'Amore.Sx MACRO SYNTAX
209*32a712daSGarrett D'Amorefor details.
210*32a712daSGarrett D'Amore.Pp
211*32a712daSGarrett D'AmoreBlank text lines, which may include whitespace, are only permitted
212*32a712daSGarrett D'Amorewithin literal contexts.
213*32a712daSGarrett D'AmoreIf the first character of a text line is a space, that line is printed
214*32a712daSGarrett D'Amorewith a leading newline.
215*32a712daSGarrett D'Amore.Ss Scaling Widths
216*32a712daSGarrett D'AmoreMany requests and macros support scaled widths for their arguments.
217*32a712daSGarrett D'AmoreThe syntax for a scaled width is
218*32a712daSGarrett D'Amore.Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
219*32a712daSGarrett D'Amorewhere a decimal must be preceded or followed by at least one digit.
220*32a712daSGarrett D'AmoreNegative numbers, while accepted, are truncated to zero.
221*32a712daSGarrett D'Amore.Pp
222*32a712daSGarrett D'AmoreThe following scaling units are accepted:
223*32a712daSGarrett D'Amore.Pp
224*32a712daSGarrett D'Amore.Bl -tag -width Ds -offset indent -compact
225*32a712daSGarrett D'Amore.It c
226*32a712daSGarrett D'Amorecentimetre
227*32a712daSGarrett D'Amore.It i
228*32a712daSGarrett D'Amoreinch
229*32a712daSGarrett D'Amore.It P
230*32a712daSGarrett D'Amorepica (~1/6 inch)
231*32a712daSGarrett D'Amore.It p
232*32a712daSGarrett D'Amorepoint (~1/72 inch)
233*32a712daSGarrett D'Amore.It f
234*32a712daSGarrett D'Amoresynonym for
235*32a712daSGarrett D'Amore.Sq u
236*32a712daSGarrett D'Amore.It v
237*32a712daSGarrett D'Amoredefault vertical span
238*32a712daSGarrett D'Amore.It m
239*32a712daSGarrett D'Amorewidth of rendered
240*32a712daSGarrett D'Amore.Sq m
241*32a712daSGarrett D'Amore.Pq em
242*32a712daSGarrett D'Amorecharacter
243*32a712daSGarrett D'Amore.It n
244*32a712daSGarrett D'Amorewidth of rendered
245*32a712daSGarrett D'Amore.Sq n
246*32a712daSGarrett D'Amore.Pq en
247*32a712daSGarrett D'Amorecharacter
248*32a712daSGarrett D'Amore.It u
249*32a712daSGarrett D'Amoredefault horizontal span
250*32a712daSGarrett D'Amore.It M
251*32a712daSGarrett D'Amoremini-em (~1/100 em)
252*32a712daSGarrett D'Amore.El
253*32a712daSGarrett D'Amore.Pp
254*32a712daSGarrett D'AmoreUsing anything other than
255*32a712daSGarrett D'Amore.Sq m ,
256*32a712daSGarrett D'Amore.Sq n ,
257*32a712daSGarrett D'Amore.Sq u ,
258*32a712daSGarrett D'Amoreor
259*32a712daSGarrett D'Amore.Sq v
260*32a712daSGarrett D'Amoreis necessarily non-portable across output media.
261*32a712daSGarrett D'AmoreSee
262*32a712daSGarrett D'Amore.Sx COMPATIBILITY .
263*32a712daSGarrett D'Amore.Pp
264*32a712daSGarrett D'AmoreIf a scaling unit is not provided, the numerical value is interpreted
265*32a712daSGarrett D'Amoreunder the default rules of
266*32a712daSGarrett D'Amore.Sq v
267*32a712daSGarrett D'Amorefor vertical spaces and
268*32a712daSGarrett D'Amore.Sq u
269*32a712daSGarrett D'Amorefor horizontal ones.
270*32a712daSGarrett D'Amore.Pp
271*32a712daSGarrett D'AmoreExamples:
272*32a712daSGarrett D'Amore.Bl -tag -width ".Bl -tag -width 2i" -offset indent -compact
273*32a712daSGarrett D'Amore.It Li \&.Bl -tag -width 2i
274*32a712daSGarrett D'Amoretwo-inch tagged list indentation in
275*32a712daSGarrett D'Amore.Xr mdoc 5
276*32a712daSGarrett D'Amore.It Li \&.HP 2i
277*32a712daSGarrett D'Amoretwo-inch tagged list indentation in
278*32a712daSGarrett D'Amore.Xr man 5
279*32a712daSGarrett D'Amore.It Li \&.sp 2v
280*32a712daSGarrett D'Amoretwo vertical spaces
281*32a712daSGarrett D'Amore.El
282*32a712daSGarrett D'Amore.Ss Sentence Spacing
283*32a712daSGarrett D'AmoreEach sentence should terminate at the end of an input line.
284*32a712daSGarrett D'AmoreBy doing this, a formatter will be able to apply the proper amount of
285*32a712daSGarrett D'Amorespacing after the end of sentence (unescaped) period, exclamation mark,
286*32a712daSGarrett D'Amoreor question mark followed by zero or more non-sentence closing
287*32a712daSGarrett D'Amoredelimiters
288*32a712daSGarrett D'Amore.Po
289*32a712daSGarrett D'Amore.Sq \&) ,
290*32a712daSGarrett D'Amore.Sq \&] ,
291*32a712daSGarrett D'Amore.Sq \&' ,
292*32a712daSGarrett D'Amore.Sq \&"
293*32a712daSGarrett D'Amore.Pc .
294*32a712daSGarrett D'Amore.Pp
295*32a712daSGarrett D'AmoreThe proper spacing is also intelligently preserved if a sentence ends at
296*32a712daSGarrett D'Amorethe boundary of a macro line.
297*32a712daSGarrett D'Amore.Pp
298*32a712daSGarrett D'AmoreExamples:
299*32a712daSGarrett D'Amore.Bd -literal -offset indent -compact
300*32a712daSGarrett D'AmoreDo not end sentences mid-line like this.  Instead,
301*32a712daSGarrett D'Amoreend a sentence like this.
302*32a712daSGarrett D'AmoreA macro would end like this:
303*32a712daSGarrett D'Amore\&.Xr mandoc 1 \&.
304*32a712daSGarrett D'Amore.Ed
305*32a712daSGarrett D'Amore.Sh REQUEST SYNTAX
306*32a712daSGarrett D'AmoreA request or macro line consists of:
307*32a712daSGarrett D'Amore.Pp
308*32a712daSGarrett D'Amore.Bl -enum -compact
309*32a712daSGarrett D'Amore.It
310*32a712daSGarrett D'Amorethe control character
311*32a712daSGarrett D'Amore.Sq \&.
312*32a712daSGarrett D'Amoreor
313*32a712daSGarrett D'Amore.Sq \(aq
314*32a712daSGarrett D'Amoreat the beginning of the line,
315*32a712daSGarrett D'Amore.It
316*32a712daSGarrett D'Amoreoptionally an arbitrary amount of whitespace,
317*32a712daSGarrett D'Amore.It
318*32a712daSGarrett D'Amorethe name of the request or the macro, which is one word of arbitrary
319*32a712daSGarrett D'Amorelength, terminated by whitespace,
320*32a712daSGarrett D'Amore.It
321*32a712daSGarrett D'Amoreand zero or more arguments delimited by whitespace.
322*32a712daSGarrett D'Amore.El
323*32a712daSGarrett D'Amore.Pp
324*32a712daSGarrett D'AmoreThus, the following request lines are all equivalent:
325*32a712daSGarrett D'Amore.Bd -literal -offset indent
326*32a712daSGarrett D'Amore\&.ig end
327*32a712daSGarrett D'Amore\&.ig    end
328*32a712daSGarrett D'Amore\&.   ig end
329*32a712daSGarrett D'Amore.Ed
330*32a712daSGarrett D'Amore.Sh MACRO SYNTAX
331*32a712daSGarrett D'AmoreMacros are provided by the
332*32a712daSGarrett D'Amore.Xr mdoc 5
333*32a712daSGarrett D'Amoreand
334*32a712daSGarrett D'Amore.Xr man 5
335*32a712daSGarrett D'Amorelanguages and can be defined by the
336*32a712daSGarrett D'Amore.Sx \&de
337*32a712daSGarrett D'Amorerequest.
338*32a712daSGarrett D'AmoreWhen called, they follow the same syntax as requests, except that
339*32a712daSGarrett D'Amoremacro arguments may optionally be quoted by enclosing them
340*32a712daSGarrett D'Amorein double quote characters
341*32a712daSGarrett D'Amore.Pq Sq \(dq .
342*32a712daSGarrett D'AmoreQuoted text, even if it contains whitespace or would cause
343*32a712daSGarrett D'Amorea macro invocation when unquoted, is always considered literal text.
344*32a712daSGarrett D'AmoreInside quoted text, pairs of double quote characters
345*32a712daSGarrett D'Amore.Pq Sq Qq
346*32a712daSGarrett D'Amoreresolve to single double quote characters.
347*32a712daSGarrett D'Amore.Pp
348*32a712daSGarrett D'AmoreTo be recognised as the beginning of a quoted argument, the opening
349*32a712daSGarrett D'Amorequote character must be preceded by a space character.
350*32a712daSGarrett D'AmoreA quoted argument extends to the next double quote character that is not
351*32a712daSGarrett D'Amorepart of a pair, or to the end of the input line, whichever comes earlier.
352*32a712daSGarrett D'AmoreLeaving out the terminating double quote character at the end of the line
353*32a712daSGarrett D'Amoreis discouraged.
354*32a712daSGarrett D'AmoreFor clarity, if more arguments follow on the same input line,
355*32a712daSGarrett D'Amoreit is recommended to follow the terminating double quote character
356*32a712daSGarrett D'Amoreby a space character; in case the next character after the terminating
357*32a712daSGarrett D'Amoredouble quote character is anything else, it is regarded as the beginning
358*32a712daSGarrett D'Amoreof the next, unquoted argument.
359*32a712daSGarrett D'Amore.Pp
360*32a712daSGarrett D'AmoreBoth in quoted and unquoted arguments, pairs of backslashes
361*32a712daSGarrett D'Amore.Pq Sq \e\e
362*32a712daSGarrett D'Amoreresolve to single backslashes.
363*32a712daSGarrett D'AmoreIn unquoted arguments, space characters can alternatively be included
364*32a712daSGarrett D'Amoreby preceding them with a backslash
365*32a712daSGarrett D'Amore.Pq Sq \e\~ ,
366*32a712daSGarrett D'Amorebut quoting is usually better for clarity.
367*32a712daSGarrett D'Amore.Pp
368*32a712daSGarrett D'AmoreExamples:
369*32a712daSGarrett D'Amore.Bl -tag -width Ds -offset indent -compact
370*32a712daSGarrett D'Amore.It Li .Fn strlen \(dqconst char *s\(dq
371*32a712daSGarrett D'AmoreGroup arguments
372*32a712daSGarrett D'Amore.Qq const char *s
373*32a712daSGarrett D'Amoreinto one function argument.
374*32a712daSGarrett D'AmoreIf unspecified,
375*32a712daSGarrett D'Amore.Qq const ,
376*32a712daSGarrett D'Amore.Qq char ,
377*32a712daSGarrett D'Amoreand
378*32a712daSGarrett D'Amore.Qq *s
379*32a712daSGarrett D'Amorewould be considered separate arguments.
380*32a712daSGarrett D'Amore.It Li .Op \(dqFl a\(dq
381*32a712daSGarrett D'AmoreConsider
382*32a712daSGarrett D'Amore.Qq \&Fl a
383*32a712daSGarrett D'Amoreas literal text instead of a flag macro.
384*32a712daSGarrett D'Amore.El
385*32a712daSGarrett D'Amore.Sh REQUEST REFERENCE
386*32a712daSGarrett D'AmoreThe
387*32a712daSGarrett D'Amore.Xr mandoc 1
388*32a712daSGarrett D'Amore.Nm
389*32a712daSGarrett D'Amoreparser recognises the following requests.
390*32a712daSGarrett D'AmoreNote that the
391*32a712daSGarrett D'Amore.Nm
392*32a712daSGarrett D'Amorelanguage defines many more requests not implemented in
393*32a712daSGarrett D'Amore.Xr mandoc 1 .
394*32a712daSGarrett D'Amore.Ss \&ad
395*32a712daSGarrett D'AmoreSet line adjustment mode.
396*32a712daSGarrett D'AmoreThis line-scoped request is intended to have one argument to select
397*32a712daSGarrett D'Amorenormal, left, right, or centre adjustment for subsequent text.
398*32a712daSGarrett D'AmoreCurrently, it is ignored including its arguments,
399*32a712daSGarrett D'Amoreand the number of arguments is not checked.
400*32a712daSGarrett D'Amore.Ss \&am
401*32a712daSGarrett D'AmoreAppend to a macro definition.
402*32a712daSGarrett D'AmoreThe syntax of this request is the same as that of
403*32a712daSGarrett D'Amore.Sx \&de .
404*32a712daSGarrett D'AmoreIt is currently ignored by
405*32a712daSGarrett D'Amore.Xr mandoc 1 ,
406*32a712daSGarrett D'Amoreas are its children.
407*32a712daSGarrett D'Amore.Ss \&ami
408*32a712daSGarrett D'AmoreAppend to a macro definition, specifying the macro name indirectly.
409*32a712daSGarrett D'AmoreThe syntax of this request is the same as that of
410*32a712daSGarrett D'Amore.Sx \&dei .
411*32a712daSGarrett D'AmoreIt is currently ignored by
412*32a712daSGarrett D'Amore.Xr mandoc 1 ,
413*32a712daSGarrett D'Amoreas are its children.
414*32a712daSGarrett D'Amore.Ss \&am1
415*32a712daSGarrett D'AmoreAppend to a macro definition, switching roff compatibility mode off
416*32a712daSGarrett D'Amoreduring macro execution.
417*32a712daSGarrett D'AmoreThe syntax of this request is the same as that of
418*32a712daSGarrett D'Amore.Sx \&de1 .
419*32a712daSGarrett D'AmoreIt is currently ignored by
420*32a712daSGarrett D'Amore.Xr mandoc 1 ,
421*32a712daSGarrett D'Amoreas are its children.
422*32a712daSGarrett D'Amore.Ss \&de
423*32a712daSGarrett D'AmoreDefine a
424*32a712daSGarrett D'Amore.Nm
425*32a712daSGarrett D'Amoremacro.
426*32a712daSGarrett D'AmoreIts syntax can be either
427*32a712daSGarrett D'Amore.Bd -literal -offset indent
428*32a712daSGarrett D'Amore.Pf . Cm \&de Ar name
429*32a712daSGarrett D'Amore.Ar macro definition
430*32a712daSGarrett D'Amore\&..
431*32a712daSGarrett D'Amore.Ed
432*32a712daSGarrett D'Amore.Pp
433*32a712daSGarrett D'Amoreor
434*32a712daSGarrett D'Amore.Bd -literal -offset indent
435*32a712daSGarrett D'Amore.Pf . Cm \&de Ar name Ar end
436*32a712daSGarrett D'Amore.Ar macro definition
437*32a712daSGarrett D'Amore.Pf . Ar end
438*32a712daSGarrett D'Amore.Ed
439*32a712daSGarrett D'Amore.Pp
440*32a712daSGarrett D'AmoreBoth forms define or redefine the macro
441*32a712daSGarrett D'Amore.Ar name
442*32a712daSGarrett D'Amoreto represent the
443*32a712daSGarrett D'Amore.Ar macro definition ,
444*32a712daSGarrett D'Amorewhich may consist of one or more input lines, including the newline
445*32a712daSGarrett D'Amorecharacters terminating each line, optionally containing calls to
446*32a712daSGarrett D'Amore.Nm
447*32a712daSGarrett D'Amorerequests,
448*32a712daSGarrett D'Amore.Nm
449*32a712daSGarrett D'Amoremacros or high-level macros like
450*32a712daSGarrett D'Amore.Xr man 5
451*32a712daSGarrett D'Amoreor
452*32a712daSGarrett D'Amore.Xr mdoc 5
453*32a712daSGarrett D'Amoremacros, whichever applies to the document in question.
454*32a712daSGarrett D'Amore.Pp
455*32a712daSGarrett D'AmoreSpecifying a custom
456*32a712daSGarrett D'Amore.Ar end
457*32a712daSGarrett D'Amoremacro works in the same way as for
458*32a712daSGarrett D'Amore.Sx \&ig ;
459*32a712daSGarrett D'Amorenamely, the call to
460*32a712daSGarrett D'Amore.Sq Pf . Ar end
461*32a712daSGarrett D'Amorefirst ends the
462*32a712daSGarrett D'Amore.Ar macro definition ,
463*32a712daSGarrett D'Amoreand after that, it is also evaluated as a
464*32a712daSGarrett D'Amore.Nm
465*32a712daSGarrett D'Amorerequest or
466*32a712daSGarrett D'Amore.Nm
467*32a712daSGarrett D'Amoremacro, but not as a high-level macro.
468*32a712daSGarrett D'Amore.Pp
469*32a712daSGarrett D'AmoreThe macro can be invoked later using the syntax
470*32a712daSGarrett D'Amore.Pp
471*32a712daSGarrett D'Amore.D1 Pf . Ar name Op Ar argument Op Ar argument ...
472*32a712daSGarrett D'Amore.Pp
473*32a712daSGarrett D'AmoreRegarding argument parsing, see
474*32a712daSGarrett D'Amore.Sx MACRO SYNTAX
475*32a712daSGarrett D'Amoreabove.
476*32a712daSGarrett D'Amore.Pp
477*32a712daSGarrett D'AmoreThe line invoking the macro will be replaced
478*32a712daSGarrett D'Amorein the input stream by the
479*32a712daSGarrett D'Amore.Ar macro definition ,
480*32a712daSGarrett D'Amorereplacing all occurrences of
481*32a712daSGarrett D'Amore.No \e\e$ Ns Ar N ,
482*32a712daSGarrett D'Amorewhere
483*32a712daSGarrett D'Amore.Ar N
484*32a712daSGarrett D'Amoreis a digit, by the
485*32a712daSGarrett D'Amore.Ar N Ns th Ar argument .
486*32a712daSGarrett D'AmoreFor example,
487*32a712daSGarrett D'Amore.Bd -literal -offset indent
488*32a712daSGarrett D'Amore\&.de ZN
489*32a712daSGarrett D'Amore\efI\e^\e\e$1\e^\efP\e\e$2
490*32a712daSGarrett D'Amore\&..
491*32a712daSGarrett D'Amore\&.ZN XtFree .
492*32a712daSGarrett D'Amore.Ed
493*32a712daSGarrett D'Amore.Pp
494*32a712daSGarrett D'Amoreproduces
495*32a712daSGarrett D'Amore.Pp
496*32a712daSGarrett D'Amore.D1 \efI\e^XtFree\e^\efP.
497*32a712daSGarrett D'Amore.Pp
498*32a712daSGarrett D'Amorein the input stream, and thus in the output: \fI\^XtFree\^\fP.
499*32a712daSGarrett D'Amore.Pp
500*32a712daSGarrett D'AmoreSince macros and user-defined strings share a common string table,
501*32a712daSGarrett D'Amoredefining a macro
502*32a712daSGarrett D'Amore.Ar name
503*32a712daSGarrett D'Amoreclobbers the user-defined string
504*32a712daSGarrett D'Amore.Ar name ,
505*32a712daSGarrett D'Amoreand the
506*32a712daSGarrett D'Amore.Ar macro definition
507*32a712daSGarrett D'Amorecan also be printed using the
508*32a712daSGarrett D'Amore.Sq \e*
509*32a712daSGarrett D'Amorestring interpolation syntax described below
510*32a712daSGarrett D'Amore.Sx ds ,
511*32a712daSGarrett D'Amorebut this is rarely useful because every macro definition contains at least
512*32a712daSGarrett D'Amoreone explicit newline character.
513*32a712daSGarrett D'Amore.Pp
514*32a712daSGarrett D'AmoreIn order to prevent endless recursion, both groff and
515*32a712daSGarrett D'Amore.Xr mandoc 1
516*32a712daSGarrett D'Amorelimit the stack depth for expanding macros and strings
517*32a712daSGarrett D'Amoreto a large, but finite number.
518*32a712daSGarrett D'AmoreDo not rely on the exact value of this limit.
519*32a712daSGarrett D'Amore.Ss \&dei
520*32a712daSGarrett D'AmoreDefine a
521*32a712daSGarrett D'Amore.Nm
522*32a712daSGarrett D'Amoremacro, specifying the macro name indirectly.
523*32a712daSGarrett D'AmoreThe syntax of this request is the same as that of
524*32a712daSGarrett D'Amore.Sx \&de .
525*32a712daSGarrett D'AmoreIt is currently ignored by
526*32a712daSGarrett D'Amore.Xr mandoc 1 ,
527*32a712daSGarrett D'Amoreas are its children.
528*32a712daSGarrett D'Amore.Ss \&de1
529*32a712daSGarrett D'AmoreDefine a
530*32a712daSGarrett D'Amore.Nm
531*32a712daSGarrett D'Amoremacro that will be executed with
532*32a712daSGarrett D'Amore.Nm
533*32a712daSGarrett D'Amorecompatibility mode switched off during macro execution.
534*32a712daSGarrett D'AmoreThis is a GNU extension not available in traditional
535*32a712daSGarrett D'Amore.Nm
536*32a712daSGarrett D'Amoreimplementations and not even in older versions of groff.
537*32a712daSGarrett D'AmoreSince
538*32a712daSGarrett D'Amore.Xr mandoc 1
539*32a712daSGarrett D'Amoredoes not implement
540*32a712daSGarrett D'Amore.Nm
541*32a712daSGarrett D'Amorecompatibility mode at all, it handles this request as an alias for
542*32a712daSGarrett D'Amore.Sx \&de .
543*32a712daSGarrett D'Amore.Ss \&ds
544*32a712daSGarrett D'AmoreDefine a user-defined string.
545*32a712daSGarrett D'AmoreIts syntax is as follows:
546*32a712daSGarrett D'Amore.Pp
547*32a712daSGarrett D'Amore.D1 Pf . Cm \&ds Ar name Oo \(dq Oc Ns Ar string
548*32a712daSGarrett D'Amore.Pp
549*32a712daSGarrett D'AmoreThe
550*32a712daSGarrett D'Amore.Ar name
551*32a712daSGarrett D'Amoreand
552*32a712daSGarrett D'Amore.Ar string
553*32a712daSGarrett D'Amorearguments are space-separated.
554*32a712daSGarrett D'AmoreIf the
555*32a712daSGarrett D'Amore.Ar string
556*32a712daSGarrett D'Amorebegins with a double-quote character, that character will not be part
557*32a712daSGarrett D'Amoreof the string.
558*32a712daSGarrett D'AmoreAll remaining characters on the input line form the
559*32a712daSGarrett D'Amore.Ar string ,
560*32a712daSGarrett D'Amoreincluding whitespace and double-quote characters, even trailing ones.
561*32a712daSGarrett D'Amore.Pp
562*32a712daSGarrett D'AmoreThe
563*32a712daSGarrett D'Amore.Ar string
564*32a712daSGarrett D'Amorecan be interpolated into subsequent text by using
565*32a712daSGarrett D'Amore.No \e* Ns Bq Ar name
566*32a712daSGarrett D'Amorefor a
567*32a712daSGarrett D'Amore.Ar name
568*32a712daSGarrett D'Amoreof arbitrary length, or \e*(NN or \e*N if the length of
569*32a712daSGarrett D'Amore.Ar name
570*32a712daSGarrett D'Amoreis two or one characters, respectively.
571*32a712daSGarrett D'AmoreInterpolation can be prevented by escaping the leading backslash;
572*32a712daSGarrett D'Amorethat is, an asterisk preceded by an even number of backslashes
573*32a712daSGarrett D'Amoredoes not trigger string interpolation.
574*32a712daSGarrett D'Amore.Pp
575*32a712daSGarrett D'AmoreSince user-defined strings and macros share a common string table,
576*32a712daSGarrett D'Amoredefining a string
577*32a712daSGarrett D'Amore.Ar name
578*32a712daSGarrett D'Amoreclobbers the macro
579*32a712daSGarrett D'Amore.Ar name ,
580*32a712daSGarrett D'Amoreand the
581*32a712daSGarrett D'Amore.Ar name
582*32a712daSGarrett D'Amoreused for defining a string can also be invoked as a macro,
583*32a712daSGarrett D'Amorein which case the following input line will be appended to the
584*32a712daSGarrett D'Amore.Ar string ,
585*32a712daSGarrett D'Amoreforming a new input line passed to the
586*32a712daSGarrett D'Amore.Nm
587*32a712daSGarrett D'Amoreparser.
588*32a712daSGarrett D'AmoreFor example,
589*32a712daSGarrett D'Amore.Bd -literal -offset indent
590*32a712daSGarrett D'Amore\&.ds badidea .S
591*32a712daSGarrett D'Amore\&.badidea
592*32a712daSGarrett D'AmoreH SYNOPSIS
593*32a712daSGarrett D'Amore.Ed
594*32a712daSGarrett D'Amore.Pp
595*32a712daSGarrett D'Amoreinvokes the
596*32a712daSGarrett D'Amore.Cm SH
597*32a712daSGarrett D'Amoremacro when used in a
598*32a712daSGarrett D'Amore.Xr man 5
599*32a712daSGarrett D'Amoredocument.
600*32a712daSGarrett D'AmoreSuch abuse is of course strongly discouraged.
601*32a712daSGarrett D'Amore.Ss \&el
602*32a712daSGarrett D'AmoreThe
603*32a712daSGarrett D'Amore.Qq else
604*32a712daSGarrett D'Amorehalf of an if/else conditional.
605*32a712daSGarrett D'AmorePops a result off the stack of conditional evaluations pushed by
606*32a712daSGarrett D'Amore.Sx \&ie
607*32a712daSGarrett D'Amoreand uses it as its conditional.
608*32a712daSGarrett D'AmoreIf no stack entries are present (e.g., due to no prior
609*32a712daSGarrett D'Amore.Sx \&ie
610*32a712daSGarrett D'Amorecalls)
611*32a712daSGarrett D'Amorethen false is assumed.
612*32a712daSGarrett D'AmoreThe syntax of this request is similar to
613*32a712daSGarrett D'Amore.Sx \&if
614*32a712daSGarrett D'Amoreexcept that the conditional is missing.
615*32a712daSGarrett D'Amore.Ss \&EN
616*32a712daSGarrett D'AmoreEnd an equation block.
617*32a712daSGarrett D'AmoreSee
618*32a712daSGarrett D'Amore.Sx \&EQ .
619*32a712daSGarrett D'Amore.Ss \&EQ
620*32a712daSGarrett D'AmoreBegin an equation block.
621*32a712daSGarrett D'AmoreSee
622*32a712daSGarrett D'Amore.Xr eqn 5
623*32a712daSGarrett D'Amorefor a description of the equation language.
624*32a712daSGarrett D'Amore.Ss \&hy
625*32a712daSGarrett D'AmoreSet automatic hyphenation mode.
626*32a712daSGarrett D'AmoreThis line-scoped request is currently ignored.
627*32a712daSGarrett D'Amore.Ss \&ie
628*32a712daSGarrett D'AmoreThe
629*32a712daSGarrett D'Amore.Qq if
630*32a712daSGarrett D'Amorehalf of an if/else conditional.
631*32a712daSGarrett D'AmoreThe result of the conditional is pushed into a stack used by subsequent
632*32a712daSGarrett D'Amoreinvocations of
633*32a712daSGarrett D'Amore.Sx \&el ,
634*32a712daSGarrett D'Amorewhich may be separated by any intervening input (or not exist at all).
635*32a712daSGarrett D'AmoreIts syntax is equivalent to
636*32a712daSGarrett D'Amore.Sx \&if .
637*32a712daSGarrett D'Amore.Ss \&if
638*32a712daSGarrett D'AmoreBegins a conditional.
639*32a712daSGarrett D'AmoreRight now, the conditional evaluates to true
640*32a712daSGarrett D'Amoreif and only if it starts with the letter
641*32a712daSGarrett D'Amore.Sy n ,
642*32a712daSGarrett D'Amoreindicating processing in nroff style as opposed to troff style.
643*32a712daSGarrett D'AmoreIf a conditional is false, its children are not processed, but are
644*32a712daSGarrett D'Amoresyntactically interpreted to preserve the integrity of the input
645*32a712daSGarrett D'Amoredocument.
646*32a712daSGarrett D'AmoreThus,
647*32a712daSGarrett D'Amore.Pp
648*32a712daSGarrett D'Amore.D1 \&.if t .ig
649*32a712daSGarrett D'Amore.Pp
650*32a712daSGarrett D'Amorewill discard the
651*32a712daSGarrett D'Amore.Sq \&.ig ,
652*32a712daSGarrett D'Amorewhich may lead to interesting results, but
653*32a712daSGarrett D'Amore.Pp
654*32a712daSGarrett D'Amore.D1 \&.if t .if t \e{\e
655*32a712daSGarrett D'Amore.Pp
656*32a712daSGarrett D'Amorewill continue to syntactically interpret to the block close of the final
657*32a712daSGarrett D'Amoreconditional.
658*32a712daSGarrett D'AmoreSub-conditionals, in this case, obviously inherit the truth value of
659*32a712daSGarrett D'Amorethe parent.
660*32a712daSGarrett D'AmoreThis request has the following syntax:
661*32a712daSGarrett D'Amore.Bd -literal -offset indent
662*32a712daSGarrett D'Amore\&.if COND \e{\e
663*32a712daSGarrett D'AmoreBODY...
664*32a712daSGarrett D'Amore\&.\e}
665*32a712daSGarrett D'Amore.Ed
666*32a712daSGarrett D'Amore.Bd -literal -offset indent
667*32a712daSGarrett D'Amore\&.if COND \e{ BODY
668*32a712daSGarrett D'AmoreBODY... \e}
669*32a712daSGarrett D'Amore.Ed
670*32a712daSGarrett D'Amore.Bd -literal -offset indent
671*32a712daSGarrett D'Amore\&.if COND \e{ BODY
672*32a712daSGarrett D'AmoreBODY...
673*32a712daSGarrett D'Amore\&.\e}
674*32a712daSGarrett D'Amore.Ed
675*32a712daSGarrett D'Amore.Bd -literal -offset indent
676*32a712daSGarrett D'Amore\&.if COND \e
677*32a712daSGarrett D'AmoreBODY
678*32a712daSGarrett D'Amore.Ed
679*32a712daSGarrett D'Amore.Pp
680*32a712daSGarrett D'AmoreCOND is a conditional statement.
681*32a712daSGarrett D'Amoreroff allows for complicated conditionals; mandoc is much simpler.
682*32a712daSGarrett D'AmoreAt this time, mandoc supports only
683*32a712daSGarrett D'Amore.Sq n ,
684*32a712daSGarrett D'Amoreevaluating to true;
685*32a712daSGarrett D'Amoreand
686*32a712daSGarrett D'Amore.Sq t ,
687*32a712daSGarrett D'Amore.Sq e ,
688*32a712daSGarrett D'Amoreand
689*32a712daSGarrett D'Amore.Sq o ,
690*32a712daSGarrett D'Amoreevaluating to false.
691*32a712daSGarrett D'AmoreAll other invocations are read up to the next end of line or space and
692*32a712daSGarrett D'Amoreevaluate as false.
693*32a712daSGarrett D'Amore.Pp
694*32a712daSGarrett D'AmoreIf the BODY section is begun by an escaped brace
695*32a712daSGarrett D'Amore.Sq \e{ ,
696*32a712daSGarrett D'Amorescope continues until a closing-brace escape sequence
697*32a712daSGarrett D'Amore.Sq \.\e} .
698*32a712daSGarrett D'AmoreIf the BODY is not enclosed in braces, scope continues until
699*32a712daSGarrett D'Amorethe end of the line.
700*32a712daSGarrett D'AmoreIf the COND is followed by a BODY on the same line, whether after a
701*32a712daSGarrett D'Amorebrace or not, then requests and macros
702*32a712daSGarrett D'Amore.Em must
703*32a712daSGarrett D'Amorebegin with a control character.
704*32a712daSGarrett D'AmoreIt is generally more intuitive, in this case, to write
705*32a712daSGarrett D'Amore.Bd -literal -offset indent
706*32a712daSGarrett D'Amore\&.if COND \e{\e
707*32a712daSGarrett D'Amore\&.foo
708*32a712daSGarrett D'Amorebar
709*32a712daSGarrett D'Amore\&.\e}
710*32a712daSGarrett D'Amore.Ed
711*32a712daSGarrett D'Amore.Pp
712*32a712daSGarrett D'Amorethan having the request or macro follow as
713*32a712daSGarrett D'Amore.Pp
714*32a712daSGarrett D'Amore.D1 \&.if COND \e{ .foo
715*32a712daSGarrett D'Amore.Pp
716*32a712daSGarrett D'AmoreThe scope of a conditional is always parsed, but only executed if the
717*32a712daSGarrett D'Amoreconditional evaluates to true.
718*32a712daSGarrett D'Amore.Pp
719*32a712daSGarrett D'AmoreNote that the
720*32a712daSGarrett D'Amore.Sq \e}
721*32a712daSGarrett D'Amoreis converted into a zero-width escape sequence if not passed as a
722*32a712daSGarrett D'Amorestandalone macro
723*32a712daSGarrett D'Amore.Sq \&.\e} .
724*32a712daSGarrett D'AmoreFor example,
725*32a712daSGarrett D'Amore.Pp
726*32a712daSGarrett D'Amore.D1 \&.Fl a \e} b
727*32a712daSGarrett D'Amore.Pp
728*32a712daSGarrett D'Amorewill result in
729*32a712daSGarrett D'Amore.Sq \e}
730*32a712daSGarrett D'Amorebeing considered an argument of the
731*32a712daSGarrett D'Amore.Sq \&Fl
732*32a712daSGarrett D'Amoremacro.
733*32a712daSGarrett D'Amore.Ss \&ig
734*32a712daSGarrett D'AmoreIgnore input.
735*32a712daSGarrett D'AmoreIts syntax can be either
736*32a712daSGarrett D'Amore.Bd -literal -offset indent
737*32a712daSGarrett D'Amore.Pf . Cm \&ig
738*32a712daSGarrett D'Amore.Ar ignored text
739*32a712daSGarrett D'Amore\&..
740*32a712daSGarrett D'Amore.Ed
741*32a712daSGarrett D'Amore.Pp
742*32a712daSGarrett D'Amoreor
743*32a712daSGarrett D'Amore.Bd -literal -offset indent
744*32a712daSGarrett D'Amore.Pf . Cm \&ig Ar end
745*32a712daSGarrett D'Amore.Ar ignored text
746*32a712daSGarrett D'Amore.Pf . Ar end
747*32a712daSGarrett D'Amore.Ed
748*32a712daSGarrett D'Amore.Pp
749*32a712daSGarrett D'AmoreIn the first case, input is ignored until a
750*32a712daSGarrett D'Amore.Sq \&..
751*32a712daSGarrett D'Amorerequest is encountered on its own line.
752*32a712daSGarrett D'AmoreIn the second case, input is ignored until the specified
753*32a712daSGarrett D'Amore.Sq Pf . Ar end
754*32a712daSGarrett D'Amoremacro is encountered.
755*32a712daSGarrett D'AmoreDo not use the escape character
756*32a712daSGarrett D'Amore.Sq \e
757*32a712daSGarrett D'Amoreanywhere in the definition of
758*32a712daSGarrett D'Amore.Ar end ;
759*32a712daSGarrett D'Amoreit would cause very strange behaviour.
760*32a712daSGarrett D'Amore.Pp
761*32a712daSGarrett D'AmoreWhen the
762*32a712daSGarrett D'Amore.Ar end
763*32a712daSGarrett D'Amoremacro is a roff request or a roff macro, like in
764*32a712daSGarrett D'Amore.Pp
765*32a712daSGarrett D'Amore.D1 \&.ig if
766*32a712daSGarrett D'Amore.Pp
767*32a712daSGarrett D'Amorethe subsequent invocation of
768*32a712daSGarrett D'Amore.Sx \&if
769*32a712daSGarrett D'Amorewill first terminate the
770*32a712daSGarrett D'Amore.Ar ignored text ,
771*32a712daSGarrett D'Amorethen be invoked as usual.
772*32a712daSGarrett D'AmoreOtherwise, it only terminates the
773*32a712daSGarrett D'Amore.Ar ignored text ,
774*32a712daSGarrett D'Amoreand arguments following it or the
775*32a712daSGarrett D'Amore.Sq \&..
776*32a712daSGarrett D'Amorerequest are discarded.
777*32a712daSGarrett D'Amore.Ss \&ne
778*32a712daSGarrett D'AmoreDeclare the need for the specified minimum vertical space
779*32a712daSGarrett D'Amorebefore the next trap or the bottom of the page.
780*32a712daSGarrett D'AmoreThis line-scoped request is currently ignored.
781*32a712daSGarrett D'Amore.Ss \&nh
782*32a712daSGarrett D'AmoreTurn off automatic hyphenation mode.
783*32a712daSGarrett D'AmoreThis line-scoped request is currently ignored.
784*32a712daSGarrett D'Amore.Ss \&rm
785*32a712daSGarrett D'AmoreRemove a request, macro or string.
786*32a712daSGarrett D'AmoreThis request is intended to have one argument,
787*32a712daSGarrett D'Amorethe name of the request, macro or string to be undefined.
788*32a712daSGarrett D'AmoreCurrently, it is ignored including its arguments,
789*32a712daSGarrett D'Amoreand the number of arguments is not checked.
790*32a712daSGarrett D'Amore.Ss \&nr
791*32a712daSGarrett D'AmoreDefine a register.
792*32a712daSGarrett D'AmoreA register is an arbitrary string value that defines some sort of state,
793*32a712daSGarrett D'Amorewhich influences parsing and/or formatting.
794*32a712daSGarrett D'AmoreIts syntax is as follows:
795*32a712daSGarrett D'Amore.Pp
796*32a712daSGarrett D'Amore.D1 Pf \. Cm \&nr Ar name Ar value
797*32a712daSGarrett D'Amore.Pp
798*32a712daSGarrett D'AmoreThe
799*32a712daSGarrett D'Amore.Ar value
800*32a712daSGarrett D'Amoremay, at the moment, only be an integer.
801*32a712daSGarrett D'AmoreSo far, only the following register
802*32a712daSGarrett D'Amore.Ar name
803*32a712daSGarrett D'Amoreis recognised:
804*32a712daSGarrett D'Amore.Bl -tag -width Ds
805*32a712daSGarrett D'Amore.It Cm nS
806*32a712daSGarrett D'AmoreIf set to a positive integer value, certain
807*32a712daSGarrett D'Amore.Xr mdoc 5
808*32a712daSGarrett D'Amoremacros will behave in the same way as in the
809*32a712daSGarrett D'Amore.Em SYNOPSIS
810*32a712daSGarrett D'Amoresection.
811*32a712daSGarrett D'AmoreIf set to 0, these macros will behave in the same way as outside the
812*32a712daSGarrett D'Amore.Em SYNOPSIS
813*32a712daSGarrett D'Amoresection, even when called within the
814*32a712daSGarrett D'Amore.Em SYNOPSIS
815*32a712daSGarrett D'Amoresection itself.
816*32a712daSGarrett D'AmoreNote that starting a new
817*32a712daSGarrett D'Amore.Xr mdoc 5
818*32a712daSGarrett D'Amoresection with the
819*32a712daSGarrett D'Amore.Cm \&Sh
820*32a712daSGarrett D'Amoremacro will reset this register.
821*32a712daSGarrett D'Amore.El
822*32a712daSGarrett D'Amore.Ss \&ns
823*32a712daSGarrett D'AmoreTurn on no-space mode.
824*32a712daSGarrett D'AmoreThis line-scoped request is intended to take no arguments.
825*32a712daSGarrett D'AmoreCurrently, it is ignored including its arguments,
826*32a712daSGarrett D'Amoreand the number of arguments is not checked.
827*32a712daSGarrett D'Amore.Ss \&ps
828*32a712daSGarrett D'AmoreChange point size.
829*32a712daSGarrett D'AmoreThis line-scoped request is intended to take one numerical argument.
830*32a712daSGarrett D'AmoreCurrently, it is ignored including its arguments,
831*32a712daSGarrett D'Amoreand the number of arguments is not checked.
832*32a712daSGarrett D'Amore.Ss \&so
833*32a712daSGarrett D'AmoreInclude a source file.
834*32a712daSGarrett D'AmoreIts syntax is as follows:
835*32a712daSGarrett D'Amore.Pp
836*32a712daSGarrett D'Amore.D1 Pf \. Cm \&so Ar file
837*32a712daSGarrett D'Amore.Pp
838*32a712daSGarrett D'AmoreThe
839*32a712daSGarrett D'Amore.Ar file
840*32a712daSGarrett D'Amorewill be read and its contents processed as input in place of the
841*32a712daSGarrett D'Amore.Sq \&.so
842*32a712daSGarrett D'Amorerequest line.
843*32a712daSGarrett D'AmoreTo avoid inadvertent inclusion of unrelated files,
844*32a712daSGarrett D'Amore.Xr mandoc 1
845*32a712daSGarrett D'Amoreonly accepts relative paths not containing the strings
846*32a712daSGarrett D'Amore.Qq ../
847*32a712daSGarrett D'Amoreand
848*32a712daSGarrett D'Amore.Qq /.. .
849*32a712daSGarrett D'Amore.Pp
850*32a712daSGarrett D'AmoreThis request requires
851*32a712daSGarrett D'Amore.Xr man 1
852*32a712daSGarrett D'Amoreto change to the right directory before calling
853*32a712daSGarrett D'Amore.Xr mandoc 1 ,
854*32a712daSGarrett D'Amoreper convention to the root of the manual tree.
855*32a712daSGarrett D'AmoreTypical usage looks like:
856*32a712daSGarrett D'Amore.Pp
857*32a712daSGarrett D'Amore.Dl \&.so man3/Xcursor.3
858*32a712daSGarrett D'Amore.Pp
859*32a712daSGarrett D'AmoreAs the whole concept is rather fragile, the use of
860*32a712daSGarrett D'Amore.Sx \&so
861*32a712daSGarrett D'Amoreis discouraged.
862*32a712daSGarrett D'AmoreUse
863*32a712daSGarrett D'Amore.Xr ln 1
864*32a712daSGarrett D'Amoreinstead.
865*32a712daSGarrett D'Amore.Ss \&ta
866*32a712daSGarrett D'AmoreSet tab stops.
867*32a712daSGarrett D'AmoreThis line-scoped request can take an arbitrary number of arguments.
868*32a712daSGarrett D'AmoreCurrently, it is ignored including its arguments.
869*32a712daSGarrett D'Amore.Ss \&tr
870*32a712daSGarrett D'AmoreOutput character translation.
871*32a712daSGarrett D'AmoreIts syntax is as follows:
872*32a712daSGarrett D'Amore.Pp
873*32a712daSGarrett D'Amore.D1 Pf \. Cm \&tr Ar [ab]+
874*32a712daSGarrett D'Amore.Pp
875*32a712daSGarrett D'AmorePairs of
876*32a712daSGarrett D'Amore.Ar ab
877*32a712daSGarrett D'Amorecharacters are replaced
878*32a712daSGarrett D'Amore.Ar ( a
879*32a712daSGarrett D'Amorefor
880*32a712daSGarrett D'Amore.Ar b ) .
881*32a712daSGarrett D'AmoreReplacement (or origin) characters may also be character escapes; thus,
882*32a712daSGarrett D'Amore.Pp
883*32a712daSGarrett D'Amore.Dl tr \e(xx\e(yy
884*32a712daSGarrett D'Amore.Pp
885*32a712daSGarrett D'Amorereplaces all invocations of \e(xx with \e(yy.
886*32a712daSGarrett D'Amore.Ss \&T&
887*32a712daSGarrett D'AmoreRe-start a table layout, retaining the options of the prior table
888*32a712daSGarrett D'Amoreinvocation.
889*32a712daSGarrett D'AmoreSee
890*32a712daSGarrett D'Amore.Sx \&TS .
891*32a712daSGarrett D'Amore.Ss \&TE
892*32a712daSGarrett D'AmoreEnd a table context.
893*32a712daSGarrett D'AmoreSee
894*32a712daSGarrett D'Amore.Sx \&TS .
895*32a712daSGarrett D'Amore.Ss \&TS
896*32a712daSGarrett D'AmoreBegin a table, which formats input in aligned rows and columns.
897*32a712daSGarrett D'AmoreSee
898*32a712daSGarrett D'Amore.Xr tbl 5
899*32a712daSGarrett D'Amorefor a description of the tbl language.
900*32a712daSGarrett D'Amore.Sh COMPATIBILITY
901*32a712daSGarrett D'AmoreThis section documents compatibility between mandoc and other other
902*32a712daSGarrett D'Amore.Nm
903*32a712daSGarrett D'Amoreimplementations, at this time limited to GNU troff
904*32a712daSGarrett D'Amore.Pq Qq groff .
905*32a712daSGarrett D'AmoreThe term
906*32a712daSGarrett D'Amore.Qq historic groff
907*32a712daSGarrett D'Amorerefers to groff version 1.15.
908*32a712daSGarrett D'Amore.Pp
909*32a712daSGarrett D'Amore.Bl -dash -compact
910*32a712daSGarrett D'Amore.It
911*32a712daSGarrett D'AmoreIn mandoc, the
912*32a712daSGarrett D'Amore.Sx \&EQ ,
913*32a712daSGarrett D'Amore.Sx \&TE ,
914*32a712daSGarrett D'Amore.Sx \&TS ,
915*32a712daSGarrett D'Amoreand
916*32a712daSGarrett D'Amore.Sx \&T& ,
917*32a712daSGarrett D'Amoremacros are considered regular macros.
918*32a712daSGarrett D'AmoreIn all other
919*32a712daSGarrett D'Amore.Nm
920*32a712daSGarrett D'Amoreimplementations, these are special macros that must be specified without
921*32a712daSGarrett D'Amorespacing between the control character (which must be a period) and the
922*32a712daSGarrett D'Amoremacro name.
923*32a712daSGarrett D'Amore.It
924*32a712daSGarrett D'AmoreThe
925*32a712daSGarrett D'Amore.Cm nS
926*32a712daSGarrett D'Amoreregister is only compatible with OpenBSD's groff-1.15.
927*32a712daSGarrett D'Amore.It
928*32a712daSGarrett D'AmoreHistoric groff did not accept white-space before a custom
929*32a712daSGarrett D'Amore.Ar end
930*32a712daSGarrett D'Amoremacro for the
931*32a712daSGarrett D'Amore.Sx \&ig
932*32a712daSGarrett D'Amorerequest.
933*32a712daSGarrett D'Amore.It
934*32a712daSGarrett D'AmoreThe
935*32a712daSGarrett D'Amore.Sx \&if
936*32a712daSGarrett D'Amoreand family would print funny white-spaces with historic groff when
937*32a712daSGarrett D'Amoreusing the next-line syntax.
938*32a712daSGarrett D'Amore.El
939*32a712daSGarrett D'Amore.Sh SEE ALSO
940*32a712daSGarrett D'Amore.Xr mandoc 1 ,
941*32a712daSGarrett D'Amore.Xr eqn 5 ,
942*32a712daSGarrett D'Amore.Xr man 5 ,
943*32a712daSGarrett D'Amore.Xr mandoc_char 5 ,
944*32a712daSGarrett D'Amore.Xr mdoc 5 ,
945*32a712daSGarrett D'Amore.Xr tbl 5
946*32a712daSGarrett D'Amore.Rs
947*32a712daSGarrett D'Amore.%A Joseph F. Ossanna
948*32a712daSGarrett D'Amore.%A Brian W. Kernighan
949*32a712daSGarrett D'Amore.%I AT&T Bell Laboratories
950*32a712daSGarrett D'Amore.%T Troff User's Manual
951*32a712daSGarrett D'Amore.%R Computing Science Technical Report
952*32a712daSGarrett D'Amore.%N 54
953*32a712daSGarrett D'Amore.%C Murray Hill, New Jersey
954*32a712daSGarrett D'Amore.%D 1976 and 1992
955*32a712daSGarrett D'Amore.%U http://www.kohala.com/start/troff/cstr54.ps
956*32a712daSGarrett D'Amore.Re
957*32a712daSGarrett D'Amore.Rs
958*32a712daSGarrett D'Amore.%A Joseph F. Ossanna
959*32a712daSGarrett D'Amore.%A Brian W. Kernighan
960*32a712daSGarrett D'Amore.%A Gunnar Ritter
961*32a712daSGarrett D'Amore.%T Heirloom Documentation Tools Nroff/Troff User's Manual
962*32a712daSGarrett D'Amore.%D September 17, 2007
963*32a712daSGarrett D'Amore.%U http://heirloom.sourceforge.net/doctools/troff.pdf
964*32a712daSGarrett D'Amore.Re
965*32a712daSGarrett D'Amore.Sh HISTORY
966*32a712daSGarrett D'AmoreThe RUNOFF typesetting system, whose input forms the basis for
967*32a712daSGarrett D'Amore.Nm ,
968*32a712daSGarrett D'Amorewas written in MAD and FAP for the CTSS operating system by Jerome E.
969*32a712daSGarrett D'AmoreSaltzer in 1964.
970*32a712daSGarrett D'AmoreDoug McIlroy rewrote it in BCPL in 1969, renaming it
971*32a712daSGarrett D'Amore.Nm .
972*32a712daSGarrett D'AmoreDennis M. Ritchie rewrote McIlroy's
973*32a712daSGarrett D'Amore.Nm
974*32a712daSGarrett D'Amorein PDP-11 assembly for
975*32a712daSGarrett D'Amore.At v1 ,
976*32a712daSGarrett D'AmoreJoseph F. Ossanna improved roff and renamed it nroff
977*32a712daSGarrett D'Amorefor
978*32a712daSGarrett D'Amore.At v2 ,
979*32a712daSGarrett D'Amorethen ported nroff to C as troff, which Brian W. Kernighan released with
980*32a712daSGarrett D'Amore.At v7 .
981*32a712daSGarrett D'AmoreIn 1989, James Clarke re-implemented troff in C++, naming it groff.
982*32a712daSGarrett D'Amore.Sh AUTHORS
983*32a712daSGarrett D'Amore.An -nosplit
984*32a712daSGarrett D'AmoreThis
985*32a712daSGarrett D'Amore.Nm
986*32a712daSGarrett D'Amorereference was written by
987*32a712daSGarrett D'Amore.An Kristaps Dzonsons ,
988*32a712daSGarrett D'Amore.Mt kristaps@bsd.lv ;
989*32a712daSGarrett D'Amoreand
990*32a712daSGarrett D'Amore.An Ingo Schwarze ,
991*32a712daSGarrett D'Amore.Mt schwarze@openbsd.org .
992