xref: /netbsd-src/external/bsd/mdocml/dist/man.7 (revision 544c191c349c1704c9d5e679d12ec15cff579663)
1*544c191cSchristos.\"	Id: man.7,v 1.143 2019/03/02 22:04:40 schwarze Exp
24154958bSjoerg.\"
370f041f9Sjoerg.\" Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
4*544c191cSchristos.\" Copyright (c) 2011-2015,2017,2018,2019 Ingo Schwarze <schwarze@openbsd.org>
5*544c191cSchristos.\" Copyright (c) 2017 Anthony Bentley <bentley@openbsd.org>
6fec65c98Schristos.\" Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org>
74154958bSjoerg.\"
84154958bSjoerg.\" Permission to use, copy, modify, and distribute this software for any
94154958bSjoerg.\" purpose with or without fee is hereby granted, provided that the above
104154958bSjoerg.\" copyright notice and this permission notice appear in all copies.
114154958bSjoerg.\"
124154958bSjoerg.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
134154958bSjoerg.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
144154958bSjoerg.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
154154958bSjoerg.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
164154958bSjoerg.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
174154958bSjoerg.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
184154958bSjoerg.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
194154958bSjoerg.\"
20*544c191cSchristos.Dd March 2, 2019
214154958bSjoerg.Dt MAN 7
224154958bSjoerg.Os
234154958bSjoerg.Sh NAME
244154958bSjoerg.Nm man
25c5f73b34Sjoerg.Nd legacy formatting language for manual pages
264154958bSjoerg.Sh DESCRIPTION
27*544c191cSchristosThe
284154958bSjoerg.Nm man
29*544c191cSchristoslanguage was the standard formatting language for
30*544c191cSchristos.At
31*544c191cSchristosmanual pages from 1979 to 1989.
32*544c191cSchristosDo not use it to write new manual pages: it is a purely presentational
33*544c191cSchristoslanguage and lacks support for semantic markup.
344154958bSjoergUse the
354154958bSjoerg.Xr mdoc 7
364154958bSjoerglanguage, instead.
374154958bSjoerg.Pp
38c5f73b34SjoergIn a
394154958bSjoerg.Nm
40c5f73b34Sjoergdocument, lines beginning with the control character
414154958bSjoerg.Sq \&.
42c5f73b34Sjoergare called
43c5f73b34Sjoerg.Dq macro lines .
44c5f73b34SjoergThe first word is the macro name.
45c5f73b34SjoergIt usually consists of two capital letters.
46*544c191cSchristosFor a list of portable macros, see
47c5f73b34Sjoerg.Sx MACRO OVERVIEW .
48c5f73b34SjoergThe words following the macro name are arguments to the macro.
49c5f73b34Sjoerg.Pp
50c5f73b34SjoergLines not beginning with the control character are called
51c5f73b34Sjoerg.Dq text lines .
52c5f73b34SjoergThey provide free-form text to be printed; the formatting of the text
53c5f73b34Sjoergdepends on the respective processing context:
544154958bSjoerg.Bd -literal -offset indent
554154958bSjoerg\&.SH Macro lines change control state.
56c5f73b34SjoergText lines are interpreted within the current state.
574154958bSjoerg.Ed
58c5f73b34Sjoerg.Pp
59c5f73b34SjoergMany aspects of the basic syntax of the
604154958bSjoerg.Nm
61c5f73b34Sjoerglanguage are based on the
62c5f73b34Sjoerg.Xr roff 7
63c5f73b34Sjoerglanguage; see the
64c5f73b34Sjoerg.Em LANGUAGE SYNTAX
654154958bSjoergand
66c5f73b34Sjoerg.Em MACRO SYNTAX
67c5f73b34Sjoergsections in the
68c5f73b34Sjoerg.Xr roff 7
69c5f73b34Sjoergmanual for details, in particular regarding
70c5f73b34Sjoergcomments, escape sequences, whitespace, and quoting.
71*544c191cSchristos.Pp
724154958bSjoergEach
734154958bSjoerg.Nm
74*544c191cSchristosdocument starts with the
75*544c191cSchristos.Ic TH
76*544c191cSchristosmacro specifying the document's name and section, followed by the
77*544c191cSchristos.Sx NAME
78*544c191cSchristossection formatted as follows:
794154958bSjoerg.Bd -literal -offset indent
80*544c191cSchristos\&.TH PROGNAME 1 1979-01-10
814154958bSjoerg\&.SH NAME
82fec65c98Schristos\efBprogname\efR \e(en one line about what it does
834154958bSjoerg.Ed
84c5f73b34Sjoerg.Sh MACRO OVERVIEW
85c5f73b34SjoergThis overview is sorted such that macros of similar purpose are listed
86*544c191cSchristostogether.
87*544c191cSchristosDeprecated and non-portable macros are not included in the overview,
88*544c191cSchristosbut can be found in the alphabetical reference below.
89c5f73b34Sjoerg.Ss Page header and footer meta-data
90*544c191cSchristos.Bl -column "RS, RE" description
91*544c191cSchristos.It Ic TH Ta set the title: Ar name section date Op Ar source Op Ar volume
92*544c191cSchristos.It Ic AT Ta display AT&T UNIX version in the page footer (<= 1 argument)
93*544c191cSchristos.It Ic UC Ta display BSD version in the page footer (<= 1 argument)
944154958bSjoerg.El
95c5f73b34Sjoerg.Ss Sections and paragraphs
96*544c191cSchristos.Bl -column "RS, RE" description
97*544c191cSchristos.It Ic SH Ta section header (one line)
98*544c191cSchristos.It Ic SS Ta subsection header (one line)
99*544c191cSchristos.It Ic PP Ta start an undecorated paragraph (no arguments)
100*544c191cSchristos.It Ic RS , RE Ta reset the left margin: Op Ar width
101*544c191cSchristos.It Ic IP Ta indented paragraph: Op Ar head Op Ar width
102*544c191cSchristos.It Ic TP Ta tagged paragraph: Op Ar width
103*544c191cSchristos.It Ic PD Ta set vertical paragraph distance: Op Ar height
104*544c191cSchristos.It Ic in Ta additional indent: Op Ar width
1054154958bSjoerg.El
106c5f73b34Sjoerg.Ss Physical markup
107*544c191cSchristos.Bl -column "RS, RE" description
108*544c191cSchristos.It Ic B Ta boldface font
109*544c191cSchristos.It Ic I Ta italic font
110*544c191cSchristos.It Ic SB Ta small boldface font
111*544c191cSchristos.It Ic SM Ta small roman font
112*544c191cSchristos.It Ic BI Ta alternate between boldface and italic fonts
113*544c191cSchristos.It Ic BR Ta alternate between boldface and roman fonts
114*544c191cSchristos.It Ic IB Ta alternate between italic and boldface fonts
115*544c191cSchristos.It Ic IR Ta alternate between italic and roman fonts
116*544c191cSchristos.It Ic RB Ta alternate between roman and boldface fonts
117*544c191cSchristos.It Ic RI Ta alternate between roman and italic fonts
118c5f73b34Sjoerg.El
119c5f73b34Sjoerg.Sh MACRO REFERENCE
1204154958bSjoergThis section is a canonical reference to all macros, arranged
1210a84adc5Sjoergalphabetically.
1220a84adc5SjoergFor the scoping of individual macros, see
1234154958bSjoerg.Sx MACRO SYNTAX .
124*544c191cSchristos.Bl -tag -width 3n
125*544c191cSchristos.It Ic AT
1260a84adc5SjoergSets the volume for the footer for compatibility with man pages from
127fec65c98Schristos.At
1280a84adc5Sjoergreleases.
1290a84adc5SjoergThe optional arguments specify which release it is from.
130*544c191cSchristos.It Ic B
1314154958bSjoergText is rendered in bold face.
132*544c191cSchristos.It Ic BI
1330a84adc5SjoergText is rendered alternately in bold face and italic.
1340a84adc5SjoergThus,
1354154958bSjoerg.Sq .BI this word and that
1364154958bSjoergcauses
1374154958bSjoerg.Sq this
1384154958bSjoergand
1394154958bSjoerg.Sq and
1404154958bSjoergto render in bold face, while
1414154958bSjoerg.Sq word
1424154958bSjoergand
1434154958bSjoerg.Sq that
1440a84adc5Sjoergrender in italics.
1450a84adc5SjoergWhitespace between arguments is omitted in output.
1463514411fSjoerg.Pp
147*544c191cSchristosExample:
1483514411fSjoerg.Pp
149c0d9444aSjoerg.Dl \&.BI bold italic bold italic
150*544c191cSchristos.It Ic BR
1514154958bSjoergText is rendered alternately in bold face and roman (the default font).
1524154958bSjoergWhitespace between arguments is omitted in output.
1533514411fSjoergSee also
154*544c191cSchristos.Ic BI .
155*544c191cSchristos.It Ic DT
156c9bcef03SchristosRestore the default tabulator positions.
157c9bcef03SchristosThey are at intervals of 0.5 inches.
158c9bcef03SchristosThis has no effect unless the tabulator positions were changed with the
159c9bcef03Schristos.Xr roff 7
160*544c191cSchristos.Ic ta
161c9bcef03Schristosrequest.
162*544c191cSchristos.It Ic EE
163*544c191cSchristosThis is a non-standard GNU extension.
16470f041f9SjoergIn
16570f041f9Sjoerg.Xr mandoc 1 ,
166*544c191cSchristosit does the same as the
167*544c191cSchristos.Xr roff 7
168*544c191cSchristos.Ic fi
169*544c191cSchristosrequest (switch to fill mode).
170*544c191cSchristos.It Ic EX
171*544c191cSchristosThis is a non-standard GNU extension.
17270f041f9SjoergIn
17370f041f9Sjoerg.Xr mandoc 1 ,
174*544c191cSchristosit does the same as the
175*544c191cSchristos.Xr roff 7
176*544c191cSchristos.Ic nf
177*544c191cSchristosrequest (switch to no-fill mode).
178*544c191cSchristos.It Ic HP
1794154958bSjoergBegin a paragraph whose initial output line is left-justified, but
1804154958bSjoergsubsequent output lines are indented, with the following syntax:
181*544c191cSchristos.Pp
182*544c191cSchristos.D1 Pf . Ic HP Op Ar width
1834154958bSjoerg.Pp
1843514411fSjoergThe
185fec65c98Schristos.Ar width
18670f041f9Sjoergargument is a
18770f041f9Sjoerg.Xr roff 7
18870f041f9Sjoergscaling width.
189*544c191cSchristosIf specified, it's saved for later paragraph left margins;
190*544c191cSchristosif unspecified, the saved or default width is used.
1913514411fSjoerg.Pp
192*544c191cSchristosThis macro is portable, but deprecated
193*544c191cSchristosbecause it has no good representation in HTML output,
194*544c191cSchristosusually ending up indistinguishable from
195*544c191cSchristos.Ic PP .
196*544c191cSchristos.It Ic I
1974154958bSjoergText is rendered in italics.
198*544c191cSchristos.It Ic IB
1997da9b934SjoergText is rendered alternately in italics and bold face.
2007da9b934SjoergWhitespace between arguments is omitted in output.
2013514411fSjoergSee also
202*544c191cSchristos.Ic BI .
203*544c191cSchristos.It Ic IP
2043514411fSjoergBegin an indented paragraph with the following syntax:
205*544c191cSchristos.Pp
206*544c191cSchristos.D1 Pf . Ic IP Op Ar head Op Ar width
2073514411fSjoerg.Pp
2083514411fSjoergThe
209fec65c98Schristos.Ar width
21070f041f9Sjoergargument is a
21170f041f9Sjoerg.Xr roff 7
21270f041f9Sjoergscaling width defining the left margin.
2133514411fSjoergIt's saved for later paragraph left-margins; if unspecified, the saved or
2143514411fSjoergdefault width is used.
2153514411fSjoerg.Pp
2163514411fSjoergThe
217fec65c98Schristos.Ar head
2180a84adc5Sjoergargument is used as a leading term, flushed to the left margin.
2190a84adc5SjoergThis is useful for bulleted paragraphs and so on.
220*544c191cSchristos.It Ic IR
2214154958bSjoergText is rendered alternately in italics and roman (the default font).
2224154958bSjoergWhitespace between arguments is omitted in output.
2233514411fSjoergSee also
224*544c191cSchristos.Ic BI .
225*544c191cSchristos.It Ic LP
226*544c191cSchristosA synonym for
227*544c191cSchristos.Ic PP .
228*544c191cSchristos.It Ic ME
229*544c191cSchristosEnd a mailto block started with
230*544c191cSchristos.Ic MT .
231*544c191cSchristosThis is a non-standard GNU extension.
232*544c191cSchristos.It Ic MT
233c9bcef03SchristosBegin a mailto block.
234*544c191cSchristosThis is a non-standard GNU extension.
235c9bcef03SchristosIt has the following syntax:
236*544c191cSchristos.Bd -unfilled -offset indent
237*544c191cSchristos.Pf . Ic MT Ar address
238c9bcef03Schristoslink description to be shown
239*544c191cSchristos.Pf . Ic ME
240c9bcef03Schristos.Ed
241*544c191cSchristos.It Ic OP
24294561435SjoergOptional command-line argument.
243*544c191cSchristosThis is a non-standard GNU extension.
24470f041f9SjoergIt has the following syntax:
245*544c191cSchristos.Pp
246*544c191cSchristos.D1 Pf . Ic OP Ar key Op Ar value
24794561435Sjoerg.Pp
24894561435SjoergThe
249fec65c98Schristos.Ar key
25094561435Sjoergis usually a command-line flag and
251fec65c98Schristos.Ar value
25294561435Sjoergits argument.
253*544c191cSchristos.It Ic P
254*544c191cSchristosA synonym for
255*544c191cSchristos.Ic PP .
256*544c191cSchristos.It Ic PD
25770f041f9SjoergSpecify the vertical space to be inserted before each new paragraph.
25870f041f9Sjoerg.br
25970f041f9SjoergThe syntax is as follows:
260*544c191cSchristos.Pp
261*544c191cSchristos.D1 Pf . Ic PD Op Ar height
26270f041f9Sjoerg.Pp
26370f041f9SjoergThe
264fec65c98Schristos.Ar height
26570f041f9Sjoergargument is a
26670f041f9Sjoerg.Xr roff 7
26770f041f9Sjoergscaling width.
26870f041f9SjoergIt defaults to
26970f041f9Sjoerg.Cm 1v .
27070f041f9SjoergIf the unit is omitted,
27170f041f9Sjoerg.Cm v
27270f041f9Sjoergis assumed.
27370f041f9Sjoerg.Pp
27470f041f9SjoergThis macro affects the spacing before any subsequent instances of
275*544c191cSchristos.Ic HP ,
276*544c191cSchristos.Ic IP ,
277*544c191cSchristos.Ic LP ,
278*544c191cSchristos.Ic P ,
279*544c191cSchristos.Ic PP ,
280*544c191cSchristos.Ic SH ,
281*544c191cSchristos.Ic SS ,
282*544c191cSchristos.Ic SY ,
28370f041f9Sjoergand
284*544c191cSchristos.Ic TP .
285*544c191cSchristos.It Ic PP
286*544c191cSchristosBegin an undecorated paragraph.
287*544c191cSchristosThe scope of a paragraph is closed by a subsequent paragraph,
288*544c191cSchristossub-section, section, or end of file.
289*544c191cSchristosThe saved paragraph left-margin width is reset to the default.
290*544c191cSchristos.It Ic RB
2914154958bSjoergText is rendered alternately in roman (the default font) and bold face.
2924154958bSjoergWhitespace between arguments is omitted in output.
2933514411fSjoergSee also
294*544c191cSchristos.Ic BI .
295*544c191cSchristos.It Ic RE
2964154958bSjoergExplicitly close out the scope of a prior
297*544c191cSchristos.Ic RS .
298fec65c98SchristosThe default left margin is restored to the state before that
299*544c191cSchristos.Ic RS
300c5f73b34Sjoerginvocation.
301fec65c98Schristos.Pp
302fec65c98SchristosThe syntax is as follows:
303*544c191cSchristos.Pp
304*544c191cSchristos.D1 Pf . Ic RE Op Ar level
305fec65c98Schristos.Pp
306fec65c98SchristosWithout an argument, the most recent
307*544c191cSchristos.Ic RS
308fec65c98Schristosblock is closed out.
309fec65c98SchristosIf
310fec65c98Schristos.Ar level
311fec65c98Schristosis 1, all open
312*544c191cSchristos.Ic RS
313fec65c98Schristosblocks are closed out.
314fec65c98SchristosOtherwise,
315fec65c98Schristos.Ar level No \(mi 1
316fec65c98Schristosnested
317*544c191cSchristos.Ic RS
318fec65c98Schristosblocks remain open.
319*544c191cSchristos.It Ic RI
3204154958bSjoergText is rendered alternately in roman (the default font) and italics.
3214154958bSjoergWhitespace between arguments is omitted in output.
3223514411fSjoergSee also
323*544c191cSchristos.Ic BI .
324*544c191cSchristos.It Ic RS
325c5f73b34SjoergTemporarily reset the default left margin.
3263514411fSjoergThis has the following syntax:
327*544c191cSchristos.Pp
328*544c191cSchristos.D1 Pf . Ic RS Op Ar width
3294154958bSjoerg.Pp
3303514411fSjoergThe
331fec65c98Schristos.Ar width
33270f041f9Sjoergargument is a
33370f041f9Sjoerg.Xr roff 7
33470f041f9Sjoergscaling width.
3353514411fSjoergIf not specified, the saved or default width is used.
336c5f73b34Sjoerg.Pp
337c5f73b34SjoergSee also
338*544c191cSchristos.Ic RE .
339*544c191cSchristos.It Ic SB
3404154958bSjoergText is rendered in small size (one point smaller than the default font)
3414154958bSjoergbold face.
342*544c191cSchristos.It Ic SH
3430a84adc5SjoergBegin a section.
3440a84adc5SjoergThe scope of a section is only closed by another section or the end of
3450a84adc5Sjoergfile.
3467da9b934SjoergThe paragraph left-margin width is reset to the default.
347*544c191cSchristos.It Ic SM
3484154958bSjoergText is rendered in small size (one point smaller than the default
3494154958bSjoergfont).
350*544c191cSchristos.It Ic SS
3510a84adc5SjoergBegin a sub-section.
3520a84adc5SjoergThe scope of a sub-section is closed by a subsequent sub-section,
3530a84adc5Sjoergsection, or end of file.
3547da9b934SjoergThe paragraph left-margin width is reset to the default.
355*544c191cSchristos.It Ic SY
356*544c191cSchristosBegin a synopsis block with the following syntax:
357*544c191cSchristos.Bd -unfilled -offset indent
358*544c191cSchristos.Pf . Ic SY Ar command
359*544c191cSchristos.Ar arguments
360*544c191cSchristos.Pf . Ic YS
3614154958bSjoerg.Ed
3624154958bSjoerg.Pp
363*544c191cSchristosThis is a non-standard GNU extension
364*544c191cSchristosand very rarely used even in GNU manual pages.
365*544c191cSchristosFormatting is similar to
366*544c191cSchristos.Ic IP .
367*544c191cSchristos.It Ic TH
368*544c191cSchristosSet the name of the manual page for use in the page header
369*544c191cSchristosand footer with the following syntax:
370*544c191cSchristos.Pp
371*544c191cSchristos.D1 Pf . Ic TH Ar name section date Op Ar source Op Ar volume
372*544c191cSchristos.Pp
37348741257SjoergConventionally, the document
374*544c191cSchristos.Ar name
37548741257Sjoergis given in all caps.
376*544c191cSchristosThe
377*544c191cSchristos.Ar section
378*544c191cSchristosis usually a single digit, in a few cases followed by a letter.
37948741257SjoergThe recommended
38048741257Sjoerg.Ar date
38148741257Sjoergformat is
38248741257Sjoerg.Sy YYYY-MM-DD
38348741257Sjoergas specified in the ISO-8601 standard;
38448741257Sjoergif the argument does not conform, it is printed verbatim.
38548741257SjoergIf the
38648741257Sjoerg.Ar date
38748741257Sjoergis empty or not specified, the current date is used.
38848741257SjoergThe optional
38948741257Sjoerg.Ar source
3900a84adc5Sjoergstring specifies the organisation providing the utility.
391fec65c98SchristosWhen unspecified,
392fec65c98Schristos.Xr mandoc 1
393fec65c98Schristosuses its
394fec65c98Schristos.Fl Ios
395fec65c98Schristosargument.
3960a84adc5SjoergThe
39748741257Sjoerg.Ar volume
398*544c191cSchristosstring replaces the default volume title of the
399*544c191cSchristos.Ar section .
4003514411fSjoerg.Pp
4013514411fSjoergExamples:
4023514411fSjoerg.Pp
403c0d9444aSjoerg.Dl \&.TH CVS 5 "1992-02-12" GNU
404*544c191cSchristos.It Ic TP
4054154958bSjoergBegin a paragraph where the head, if exceeding the indentation width, is
406*544c191cSchristosfollowed by a newline; if not, the body follows on the same line after
407*544c191cSchristosadvancing to the indentation width.
4080a84adc5SjoergSubsequent output lines are indented.
4093514411fSjoergThe syntax is as follows:
410*544c191cSchristos.Bd -unfilled -offset indent
411*544c191cSchristos.Pf . Ic TP Op Ar width
412*544c191cSchristos.Ar head No \e" one line
413*544c191cSchristos.Ar body
4144154958bSjoerg.Ed
4154154958bSjoerg.Pp
4163514411fSjoergThe
417fec65c98Schristos.Ar width
41870f041f9Sjoergargument is a
41970f041f9Sjoerg.Xr roff 7
42070f041f9Sjoergscaling width.
4213514411fSjoergIf specified, it's saved for later paragraph left-margins; if
4224154958bSjoergunspecified, the saved or default width is used.
423*544c191cSchristos.It Ic TQ
424*544c191cSchristosLike
425*544c191cSchristos.Ic TP ,
426*544c191cSchristosexcept that no vertical spacing is inserted before the paragraph.
427*544c191cSchristosThis is a non-standard GNU extension
428*544c191cSchristosand very rarely used even in GNU manual pages.
429*544c191cSchristos.It Ic UC
4300a84adc5SjoergSets the volume for the footer for compatibility with man pages from
43170f041f9Sjoerg.Bx
43270f041f9Sjoergreleases.
4330a84adc5SjoergThe optional first argument specifies which release it is from.
434*544c191cSchristos.It Ic UE
435*544c191cSchristosEnd a uniform resource identifier block started with
436*544c191cSchristos.Ic UR .
437*544c191cSchristosThis is a non-standard GNU extension.
438*544c191cSchristos.It Ic UR
43970f041f9SjoergBegin a uniform resource identifier block.
440*544c191cSchristosThis is a non-standard GNU extension.
44170f041f9SjoergIt has the following syntax:
442*544c191cSchristos.Bd -unfilled -offset indent
443*544c191cSchristos.Pf . Ic UR Ar uri
44470f041f9Sjoerglink description to be shown
445*544c191cSchristos.Pf . Ic UE
44670f041f9Sjoerg.Ed
447*544c191cSchristos.It Ic YS
448*544c191cSchristosEnd a synopsis block started with
449*544c191cSchristos.Ic SY .
450*544c191cSchristosThis is a non-standard GNU extension.
451*544c191cSchristos.It Ic in
4527da9b934SjoergIndent relative to the current indentation:
4537da9b934Sjoerg.Pp
454*544c191cSchristos.D1 Pf . Ic in Op Ar width
4557da9b934Sjoerg.Pp
4567da9b934SjoergIf
457fec65c98Schristos.Ar width
4587da9b934Sjoergis signed, the new offset is relative.
4597da9b934SjoergOtherwise, it is absolute.
4607da9b934SjoergThis value is reset upon the next paragraph, section, or sub-section.
461*544c191cSchristos.El
462c5f73b34Sjoerg.Sh MACRO SYNTAX
463c5f73b34SjoergThe
464c5f73b34Sjoerg.Nm
465c5f73b34Sjoergmacros are classified by scope: line scope or block scope.
466c5f73b34SjoergLine macros are only scoped to the current line (and, in some
467c5f73b34Sjoergsituations, the subsequent line).
468c5f73b34SjoergBlock macros are scoped to the current line and subsequent lines until
469c5f73b34Sjoergclosed by another block macro.
470c5f73b34Sjoerg.Ss Line Macros
471c5f73b34SjoergLine macros are generally scoped to the current line, with the body
472c5f73b34Sjoergconsisting of zero or more arguments.
473c5f73b34SjoergIf a macro is scoped to the next line and the line arguments are empty,
474c5f73b34Sjoergthe next line, which must be text, is used instead.
475c5f73b34SjoergThus:
476c5f73b34Sjoerg.Bd -literal -offset indent
477c5f73b34Sjoerg\&.I
478c5f73b34Sjoergfoo
479c5f73b34Sjoerg.Ed
480c5f73b34Sjoerg.Pp
481c5f73b34Sjoergis equivalent to
482*544c191cSchristos.Sq .I foo .
483c5f73b34SjoergIf next-line macros are invoked consecutively, only the last is used.
484c5f73b34SjoergIf a next-line macro is followed by a non-next-line macro, an error is
485c9bcef03Schristosraised.
486c5f73b34Sjoerg.Pp
487c5f73b34SjoergThe syntax is as follows:
488c5f73b34Sjoerg.Bd -literal -offset indent
489c5f73b34Sjoerg\&.YO \(lBbody...\(rB
490c5f73b34Sjoerg\(lBbody...\(rB
491c5f73b34Sjoerg.Ed
492c5f73b34Sjoerg.Bl -column "MacroX" "ArgumentsX" "ScopeXXXXX" "CompatX" -offset indent
493c5f73b34Sjoerg.It Em Macro Ta Em Arguments Ta Em Scope     Ta Em Notes
494*544c191cSchristos.It Ic AT  Ta    <=1       Ta    current   Ta    \&
495*544c191cSchristos.It Ic B   Ta    n         Ta    next-line Ta    \&
496*544c191cSchristos.It Ic BI  Ta    n         Ta    current   Ta    \&
497*544c191cSchristos.It Ic BR  Ta    n         Ta    current   Ta    \&
498*544c191cSchristos.It Ic DT  Ta    0         Ta    current   Ta    \&
499*544c191cSchristos.It Ic EE  Ta    0         Ta    current   Ta    GNU
500*544c191cSchristos.It Ic EX  Ta    0         Ta    current   Ta    GNU
501*544c191cSchristos.It Ic I   Ta    n         Ta    next-line Ta    \&
502*544c191cSchristos.It Ic IB  Ta    n         Ta    current   Ta    \&
503*544c191cSchristos.It Ic IR  Ta    n         Ta    current   Ta    \&
504*544c191cSchristos.It Ic OP  Ta    >=1       Ta    current   Ta    GNU
505*544c191cSchristos.It Ic PD  Ta    1         Ta    current   Ta    \&
506*544c191cSchristos.It Ic RB  Ta    n         Ta    current   Ta    \&
507*544c191cSchristos.It Ic RI  Ta    n         Ta    current   Ta    \&
508*544c191cSchristos.It Ic SB  Ta    n         Ta    next-line Ta    \&
509*544c191cSchristos.It Ic SM  Ta    n         Ta    next-line Ta    \&
510*544c191cSchristos.It Ic TH  Ta    >1, <6    Ta    current   Ta    \&
511*544c191cSchristos.It Ic UC  Ta    <=1       Ta    current   Ta    \&
512*544c191cSchristos.It Ic in  Ta    1         Ta    current   Ta    Xr roff 7
513c5f73b34Sjoerg.El
514c5f73b34Sjoerg.Ss Block Macros
515c5f73b34SjoergBlock macros comprise a head and body.
516c5f73b34SjoergAs with in-line macros, the head is scoped to the current line and, in
517c5f73b34Sjoergone circumstance, the next line (the next-line stipulations as in
518c5f73b34Sjoerg.Sx Line Macros
519c5f73b34Sjoergapply here as well).
520c5f73b34Sjoerg.Pp
521c5f73b34SjoergThe syntax is as follows:
522c5f73b34Sjoerg.Bd -literal -offset indent
523c5f73b34Sjoerg\&.YO \(lBhead...\(rB
524c5f73b34Sjoerg\(lBhead...\(rB
525c5f73b34Sjoerg\(lBbody...\(rB
526c5f73b34Sjoerg.Ed
527c5f73b34Sjoerg.Pp
528c5f73b34SjoergThe closure of body scope may be to the section, where a macro is closed
529c5f73b34Sjoergby
530*544c191cSchristos.Ic SH ;
531c5f73b34Sjoergsub-section, closed by a section or
532*544c191cSchristos.Ic SS ;
533*544c191cSchristosor paragraph, closed by a section, sub-section,
534*544c191cSchristos.Ic HP ,
535*544c191cSchristos.Ic IP ,
536*544c191cSchristos.Ic LP ,
537*544c191cSchristos.Ic P ,
538*544c191cSchristos.Ic PP ,
539*544c191cSchristos.Ic RE ,
540*544c191cSchristos.Ic SY ,
541c5f73b34Sjoergor
542*544c191cSchristos.Ic TP .
543c5f73b34SjoergNo closure refers to an explicit block closing macro.
544c5f73b34Sjoerg.Pp
545c5f73b34SjoergAs a rule, block macros may not be nested; thus, calling a block macro
546c5f73b34Sjoergwhile another block macro scope is open, and the open scope is not
547c5f73b34Sjoergimplicitly closed, is syntactically incorrect.
548c5f73b34Sjoerg.Bl -column "MacroX" "ArgumentsX" "Head ScopeX" "sub-sectionX" "compatX" -offset indent
549c5f73b34Sjoerg.It Em Macro Ta Em Arguments Ta Em Head Scope Ta Em Body Scope  Ta Em Notes
550*544c191cSchristos.It Ic HP  Ta    <2        Ta    current    Ta    paragraph   Ta    \&
551*544c191cSchristos.It Ic IP  Ta    <3        Ta    current    Ta    paragraph   Ta    \&
552*544c191cSchristos.It Ic LP  Ta    0         Ta    current    Ta    paragraph   Ta    \&
553*544c191cSchristos.It Ic ME  Ta    0         Ta    none       Ta    none        Ta    GNU
554*544c191cSchristos.It Ic MT  Ta    1         Ta    current    Ta    to \&ME     Ta    GNU
555*544c191cSchristos.It Ic P   Ta    0         Ta    current    Ta    paragraph   Ta    \&
556*544c191cSchristos.It Ic PP  Ta    0         Ta    current    Ta    paragraph   Ta    \&
557*544c191cSchristos.It Ic RE  Ta    <=1       Ta    current    Ta    none        Ta    \&
558*544c191cSchristos.It Ic RS  Ta    1         Ta    current    Ta    to \&RE     Ta    \&
559*544c191cSchristos.It Ic SH  Ta    >0        Ta    next-line  Ta    section     Ta    \&
560*544c191cSchristos.It Ic SS  Ta    >0        Ta    next-line  Ta    sub-section Ta    \&
561*544c191cSchristos.It Ic SY  Ta    1         Ta    current    Ta    to \&YS     Ta    GNU
562*544c191cSchristos.It Ic TP  Ta    n         Ta    next-line  Ta    paragraph   Ta    \&
563*544c191cSchristos.It Ic TQ  Ta    n         Ta    next-line  Ta    paragraph   Ta    GNU
564*544c191cSchristos.It Ic UE  Ta    0         Ta    current    Ta    none        Ta    GNU
565*544c191cSchristos.It Ic UR  Ta    1         Ta    current    Ta    part        Ta    GNU
566*544c191cSchristos.It Ic YS  Ta    0         Ta    none       Ta    none        Ta    GNU
567c5f73b34Sjoerg.El
568c5f73b34Sjoerg.Pp
569c5f73b34SjoergIf a block macro is next-line scoped, it may only be followed by in-line
570c5f73b34Sjoergmacros for decorating text.
571c5f73b34Sjoerg.Ss Font handling
572c5f73b34SjoergIn
573c5f73b34Sjoerg.Nm
574c5f73b34Sjoergdocuments, both
575c5f73b34Sjoerg.Sx Physical markup
576c5f73b34Sjoergmacros and
577c5f73b34Sjoerg.Xr roff 7
578c5f73b34Sjoerg.Ql \ef
579c5f73b34Sjoergfont escape sequences can be used to choose fonts.
580c5f73b34SjoergIn text lines, the effect of manual font selection by escape sequences
581c5f73b34Sjoergonly lasts until the next macro invocation; in macro lines, it only lasts
582c5f73b34Sjoerguntil the end of the macro scope.
583c5f73b34SjoergNote that macros like
584*544c191cSchristos.Ic BR
585c5f73b34Sjoergopen and close a font scope for each argument.
5864154958bSjoerg.Sh SEE ALSO
587c0d9444aSjoerg.Xr man 1 ,
5884154958bSjoerg.Xr mandoc 1 ,
58948741257Sjoerg.Xr eqn 7 ,
590c0d9444aSjoerg.Xr mandoc_char 7 ,
591c0d9444aSjoerg.Xr mdoc 7 ,
592c0d9444aSjoerg.Xr roff 7 ,
593c0d9444aSjoerg.Xr tbl 7
5947da9b934Sjoerg.Sh HISTORY
5954154958bSjoergThe
5964154958bSjoerg.Nm
5977da9b934Sjoerglanguage first appeared as a macro package for the roff typesetting
5987da9b934Sjoergsystem in
5997da9b934Sjoerg.At v7 .
6007da9b934SjoergIt was later rewritten by James Clark as a macro package for groff.
60194561435SjoergEric S. Raymond wrote the extended
60294561435Sjoerg.Nm
60394561435Sjoergmacros for groff in 2007.
6047da9b934SjoergThe stand-alone implementation that is part of the
6057da9b934Sjoerg.Xr mandoc 1
6067da9b934Sjoergutility written by Kristaps Dzonsons appeared in
6077da9b934Sjoerg.Ox 4.6 .
6087da9b934Sjoerg.Sh AUTHORS
6097da9b934SjoergThis
6107da9b934Sjoerg.Nm
6114154958bSjoergreference was written by
61270f041f9Sjoerg.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
613