]> git.cameronkatri.com Git - mandoc.git/blob - man.7
Allow ERRORS in section 4; OpenBSD rev. 1.121.
[mandoc.git] / man.7
1 .\" $Id: man.7,v 1.125 2014/03/17 06:57:48 schwarze Exp $
2 .\"
3 .\" Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
4 .\" Copyright (c) 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
5 .\" Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org>
6 .\"
7 .\" Permission to use, copy, modify, and distribute this software for any
8 .\" purpose with or without fee is hereby granted, provided that the above
9 .\" copyright notice and this permission notice appear in all copies.
10 .\"
11 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 .\"
19 .Dd $Mdocdate: March 17 2014 $
20 .Dt MAN 7
21 .Os
22 .Sh NAME
23 .Nm man
24 .Nd legacy formatting language for manual pages
25 .Sh DESCRIPTION
26 Traditionally, the
27 .Nm man
28 language has been used to write
29 .Ux
30 manuals for the
31 .Xr man 1
32 utility.
33 It supports limited control of presentational details like fonts,
34 indentation and spacing.
35 This reference document describes the structure of manual pages
36 and the syntax and usage of the man language.
37 .Pp
38 .Bf -emphasis
39 Do not use
40 .Nm
41 to write your manuals:
42 .Ef
43 It lacks support for semantic markup.
44 Use the
45 .Xr mdoc 7
46 language, instead.
47 .Pp
48 In a
49 .Nm
50 document, lines beginning with the control character
51 .Sq \&.
52 are called
53 .Dq macro lines .
54 The first word is the macro name.
55 It usually consists of two capital letters.
56 For a list of available macros, see
57 .Sx MACRO OVERVIEW .
58 The words following the macro name are arguments to the macro.
59 .Pp
60 Lines not beginning with the control character are called
61 .Dq text lines .
62 They provide free-form text to be printed; the formatting of the text
63 depends on the respective processing context:
64 .Bd -literal -offset indent
65 \&.SH Macro lines change control state.
66 Text lines are interpreted within the current state.
67 .Ed
68 .Pp
69 Many aspects of the basic syntax of the
70 .Nm
71 language are based on the
72 .Xr roff 7
73 language; see the
74 .Em LANGUAGE SYNTAX
75 and
76 .Em MACRO SYNTAX
77 sections in the
78 .Xr roff 7
79 manual for details, in particular regarding
80 comments, escape sequences, whitespace, and quoting.
81 .Sh MANUAL STRUCTURE
82 Each
83 .Nm
84 document must contain the
85 .Sx \&TH
86 macro describing the document's section and title.
87 It may occur anywhere in the document, although conventionally it
88 appears as the first macro.
89 .Pp
90 Beyond
91 .Sx \&TH ,
92 at least one macro or text line must appear in the document.
93 .Pp
94 The following is a well-formed skeleton
95 .Nm
96 file for a utility
97 .Qq progname :
98 .Bd -literal -offset indent
99 \&.TH PROGNAME 1 2009-10-10
100 \&.SH NAME
101 \efBprogname\efR \e(en one line about what it does
102 \&.\e\(dq .SH LIBRARY
103 \&.\e\(dq For sections 2, 3, and 9 only.
104 \&.\e\(dq Not used in OpenBSD.
105 \&.SH SYNOPSIS
106 \efBprogname\efR [\efB\e-options\efR] \efIfile ...\efR
107 \&.SH DESCRIPTION
108 The \efBfoo\efR utility processes files ...
109 \&.\e\(dq .SH IMPLEMENTATION NOTES
110 \&.\e\(dq Not used in OpenBSD.
111 \&.\e\(dq .SH RETURN VALUES
112 \&.\e\(dq For sections 2, 3, and 9 function return values only.
113 \&.\e\(dq .SH ENVIRONMENT
114 \&.\e\(dq For sections 1, 6, 7, and 8 only.
115 \&.\e\(dq .SH FILES
116 \&.\e\(dq .SH EXIT STATUS
117 \&.\e\(dq For sections 1, 6, and 8 only.
118 \&.\e\(dq .SH EXAMPLES
119 \&.\e\(dq .SH DIAGNOSTICS
120 \&.\e\(dq For sections 1, 4, 6, 7, 8, and 9 printf/stderr messages only.
121 \&.\e\(dq .SH ERRORS
122 \&.\e\(dq For sections 2, 3, 4, and 9 errno settings only.
123 \&.\e\(dq .SH SEE ALSO
124 \&.\e\(dq .BR foobar ( 1 )
125 \&.\e\(dq .SH STANDARDS
126 \&.\e\(dq .SH HISTORY
127 \&.\e\(dq .SH AUTHORS
128 \&.\e\(dq .SH CAVEATS
129 \&.\e\(dq .SH BUGS
130 \&.\e\(dq .SH SECURITY CONSIDERATIONS
131 \&.\e\(dq Not used in OpenBSD.
132 .Ed
133 .Pp
134 The sections in a
135 .Nm
136 document are conventionally ordered as they appear above.
137 Sections should be composed as follows:
138 .Bl -ohang -offset indent
139 .It Em NAME
140 The name(s) and a short description of the documented material.
141 The syntax for this is generally as follows:
142 .Pp
143 .D1 \efBname\efR \e(en description
144 .It Em LIBRARY
145 The name of the library containing the documented material, which is
146 assumed to be a function in a section 2 or 3 manual.
147 For functions in the C library, this may be as follows:
148 .Pp
149 .D1 Standard C Library (libc, -lc)
150 .It Em SYNOPSIS
151 Documents the utility invocation syntax, function call syntax, or device
152 configuration.
153 .Pp
154 For the first, utilities (sections 1, 6, and 8), this is
155 generally structured as follows:
156 .Pp
157 .D1 \efBname\efR [-\efBab\efR] [-\efBc\efR\efIarg\efR] \efBpath\efR...
158 .Pp
159 For the second, function calls (sections 2, 3, 9):
160 .Pp
161 .D1 \&.B char *name(char *\efIarg\efR);
162 .Pp
163 And for the third, configurations (section 4):
164 .Pp
165 .D1 \&.B name* at cardbus ? function ?
166 .Pp
167 Manuals not in these sections generally don't need a
168 .Em SYNOPSIS .
169 .It Em DESCRIPTION
170 This expands upon the brief, one-line description in
171 .Em NAME .
172 It usually contains a break-down of the options (if documenting a
173 command).
174 .It Em IMPLEMENTATION NOTES
175 Implementation-specific notes should be kept here.
176 This is useful when implementing standard functions that may have side
177 effects or notable algorithmic implications.
178 .It Em RETURN VALUES
179 This section documents the return values of functions in sections 2, 3, and 9.
180 .It Em ENVIRONMENT
181 Documents any usages of environment variables, e.g.,
182 .Xr environ 7 .
183 .It Em FILES
184 Documents files used.
185 It's helpful to document both the file name and a short description of how
186 the file is used (created, modified, etc.).
187 .It Em EXIT STATUS
188 This section documents the command exit status for
189 section 1, 6, and 8 utilities.
190 Historically, this information was described in
191 .Em DIAGNOSTICS ,
192 a practise that is now discouraged.
193 .It Em EXAMPLES
194 Example usages.
195 This often contains snippets of well-formed,
196 well-tested invocations.
197 Make sure that examples work properly!
198 .It Em DIAGNOSTICS
199 Documents error conditions.
200 In section 4 and 9 manuals, these are usually messages
201 printed by the kernel to the console and to the kernel log.
202 In section 1, 6, 7, and 8, these are usually messages
203 printed by userland programs to the standard error output.
204 .Pp
205 Historically, this section was used in place of
206 .Em EXIT STATUS
207 for manuals in sections 1, 6, and 8; however, this practise is
208 discouraged.
209 .It Em ERRORS
210 Documents
211 .Xr errno 2
212 settings in sections 2, 3, 4, and 9.
213 .It Em SEE ALSO
214 References other manuals with related topics.
215 This section should exist for most manuals.
216 .Pp
217 .D1 \&.BR bar \&( 1 \&),
218 .Pp
219 Cross-references should conventionally be ordered
220 first by section, then alphabetically.
221 .It Em STANDARDS
222 References any standards implemented or used, such as
223 .Pp
224 .D1 IEEE Std 1003.2 (\e(lqPOSIX.2\e(rq)
225 .Pp
226 If not adhering to any standards, the
227 .Em HISTORY
228 section should be used.
229 .It Em HISTORY
230 A brief history of the subject, including where support first appeared.
231 .It Em AUTHORS
232 Credits to the person or persons who wrote the code and/or documentation.
233 Authors should generally be noted by both name and email address.
234 .It Em CAVEATS
235 Common misuses and misunderstandings should be explained
236 in this section.
237 .It Em BUGS
238 Known bugs, limitations, and work-arounds should be described
239 in this section.
240 .It Em SECURITY CONSIDERATIONS
241 Documents any security precautions that operators should consider.
242 .El
243 .Sh MACRO OVERVIEW
244 This overview is sorted such that macros of similar purpose are listed
245 together, to help find the best macro for any given purpose.
246 Deprecated macros are not included in the overview, but can be found
247 in the alphabetical reference below.
248 .Ss Page header and footer meta-data
249 .Bl -column "PP, LP, P" description
250 .It Sx TH Ta set the title: Ar title section date Op Ar source Op Ar volume
251 .It Sx AT Ta display AT&T UNIX version in the page footer (<= 1 argument)
252 .It Sx UC Ta display BSD version in the page footer (<= 1 argument)
253 .El
254 .Ss Sections and paragraphs
255 .Bl -column "PP, LP, P" description
256 .It Sx SH Ta section header (one line)
257 .It Sx SS Ta subsection header (one line)
258 .It Sx PP , LP , P Ta start an undecorated paragraph (no arguments)
259 .It Sx RS , RE Ta reset the left margin: Op Ar width
260 .It Sx IP Ta indented paragraph: Op Ar head Op Ar width
261 .It Sx TP Ta tagged paragraph: Op Ar width
262 .It Sx HP Ta hanged paragraph: Op Ar width
263 .It Sx PD Ta set vertical paragraph distance: Op Ar height
264 .It Sx \&br Ta force output line break in text mode (no arguments)
265 .It Sx \&sp Ta force vertical space: Op Ar height
266 .It Sx fi , nf Ta fill mode and no-fill mode (no arguments)
267 .It Sx in Ta additional indent: Op Ar width
268 .El
269 .Ss Physical markup
270 .Bl -column "PP, LP, P" description
271 .It Sx B Ta boldface font
272 .It Sx I Ta italic font
273 .It Sx R Ta roman (default) font
274 .It Sx SB Ta small boldface font
275 .It Sx SM Ta small roman font
276 .It Sx BI Ta alternate between boldface and italic fonts
277 .It Sx BR Ta alternate between boldface and roman fonts
278 .It Sx IB Ta alternate between italic and boldface fonts
279 .It Sx IR Ta alternate between italic and roman fonts
280 .It Sx RB Ta alternate between roman and boldface fonts
281 .It Sx RI Ta alternate between roman and italic fonts
282 .El
283 .Sh MACRO REFERENCE
284 This section is a canonical reference to all macros, arranged
285 alphabetically.
286 For the scoping of individual macros, see
287 .Sx MACRO SYNTAX .
288 .Ss \&AT
289 Sets the volume for the footer for compatibility with man pages from
290 .At
291 releases.
292 The optional arguments specify which release it is from.
293 .Ss \&B
294 Text is rendered in bold face.
295 .Pp
296 See also
297 .Sx \&I
298 and
299 .Sx \&R .
300 .Ss \&BI
301 Text is rendered alternately in bold face and italic.
302 Thus,
303 .Sq .BI this word and that
304 causes
305 .Sq this
306 and
307 .Sq and
308 to render in bold face, while
309 .Sq word
310 and
311 .Sq that
312 render in italics.
313 Whitespace between arguments is omitted in output.
314 .Pp
315 Examples:
316 .Pp
317 .Dl \&.BI bold italic bold italic
318 .Pp
319 The output of this example will be emboldened
320 .Dq bold
321 and italicised
322 .Dq italic ,
323 with spaces stripped between arguments.
324 .Pp
325 See also
326 .Sx \&IB ,
327 .Sx \&BR ,
328 .Sx \&RB ,
329 .Sx \&RI ,
330 and
331 .Sx \&IR .
332 .Ss \&BR
333 Text is rendered alternately in bold face and roman (the default font).
334 Whitespace between arguments is omitted in output.
335 .Pp
336 See
337 .Sx \&BI
338 for an equivalent example.
339 .Pp
340 See also
341 .Sx \&BI ,
342 .Sx \&IB ,
343 .Sx \&RB ,
344 .Sx \&RI ,
345 and
346 .Sx \&IR .
347 .Ss \&DT
348 Has no effect.
349 Included for compatibility.
350 .Ss \&EE
351 This is a non-standard GNU extension, included only for compatibility.
352 In
353 .Xr mandoc 1 ,
354 it does the same as
355 .Sx \&fi .
356 .Ss \&EX
357 This is a non-standard GNU extension, included only for compatibility.
358 In
359 .Xr mandoc 1 ,
360 it does the same as
361 .Sx \&nf .
362 .Ss \&HP
363 Begin a paragraph whose initial output line is left-justified, but
364 subsequent output lines are indented, with the following syntax:
365 .Bd -filled -offset indent
366 .Pf \. Sx \&HP
367 .Op Cm width
368 .Ed
369 .Pp
370 The
371 .Cm width
372 argument is a
373 .Xr roff 7
374 scaling width.
375 If specified, it's saved for later paragraph left-margins; if unspecified, the
376 saved or default width is used.
377 .Pp
378 See also
379 .Sx \&IP ,
380 .Sx \&LP ,
381 .Sx \&P ,
382 .Sx \&PP ,
383 and
384 .Sx \&TP .
385 .Ss \&I
386 Text is rendered in italics.
387 .Pp
388 See also
389 .Sx \&B
390 and
391 .Sx \&R .
392 .Ss \&IB
393 Text is rendered alternately in italics and bold face.
394 Whitespace between arguments is omitted in output.
395 .Pp
396 See
397 .Sx \&BI
398 for an equivalent example.
399 .Pp
400 See also
401 .Sx \&BI ,
402 .Sx \&BR ,
403 .Sx \&RB ,
404 .Sx \&RI ,
405 and
406 .Sx \&IR .
407 .Ss \&IP
408 Begin an indented paragraph with the following syntax:
409 .Bd -filled -offset indent
410 .Pf \. Sx \&IP
411 .Op Cm head Op Cm width
412 .Ed
413 .Pp
414 The
415 .Cm width
416 argument is a
417 .Xr roff 7
418 scaling width defining the left margin.
419 It's saved for later paragraph left-margins; if unspecified, the saved or
420 default width is used.
421 .Pp
422 The
423 .Cm head
424 argument is used as a leading term, flushed to the left margin.
425 This is useful for bulleted paragraphs and so on.
426 .Pp
427 See also
428 .Sx \&HP ,
429 .Sx \&LP ,
430 .Sx \&P ,
431 .Sx \&PP ,
432 and
433 .Sx \&TP .
434 .Ss \&IR
435 Text is rendered alternately in italics and roman (the default font).
436 Whitespace between arguments is omitted in output.
437 .Pp
438 See
439 .Sx \&BI
440 for an equivalent example.
441 .Pp
442 See also
443 .Sx \&BI ,
444 .Sx \&IB ,
445 .Sx \&BR ,
446 .Sx \&RB ,
447 and
448 .Sx \&RI .
449 .Ss \&LP
450 Begin an undecorated paragraph.
451 The scope of a paragraph is closed by a subsequent paragraph,
452 sub-section, section, or end of file.
453 The saved paragraph left-margin width is reset to the default.
454 .Pp
455 See also
456 .Sx \&HP ,
457 .Sx \&IP ,
458 .Sx \&P ,
459 .Sx \&PP ,
460 and
461 .Sx \&TP .
462 .Ss \&OP
463 Optional command-line argument.
464 This is a non-standard GNU extension, included only for compatibility.
465 It has the following syntax:
466 .Bd -filled -offset indent
467 .Pf \. Sx \&OP
468 .Cm key Op Cm value
469 .Ed
470 .Pp
471 The
472 .Cm key
473 is usually a command-line flag and
474 .Cm value
475 its argument.
476 .Ss \&P
477 Synonym for
478 .Sx \&LP .
479 .Pp
480 See also
481 .Sx \&HP ,
482 .Sx \&IP ,
483 .Sx \&LP ,
484 .Sx \&PP ,
485 and
486 .Sx \&TP .
487 .Ss \&PD
488 Specify the vertical space to be inserted before each new paragraph.
489 .br
490 The syntax is as follows:
491 .Bd -filled -offset indent
492 .Pf \. Sx \&PD
493 .Op Cm height
494 .Ed
495 .Pp
496 The
497 .Cm height
498 argument is a
499 .Xr roff 7
500 scaling width.
501 It defaults to
502 .Cm 1v .
503 If the unit is omitted,
504 .Cm v
505 is assumed.
506 .Pp
507 This macro affects the spacing before any subsequent instances of
508 .Sx \&HP ,
509 .Sx \&IP ,
510 .Sx \&LP ,
511 .Sx \&P ,
512 .Sx \&PP ,
513 .Sx \&SH ,
514 .Sx \&SS ,
515 and
516 .Sx \&TP .
517 .Ss \&PP
518 Synonym for
519 .Sx \&LP .
520 .Pp
521 See also
522 .Sx \&HP ,
523 .Sx \&IP ,
524 .Sx \&LP ,
525 .Sx \&P ,
526 and
527 .Sx \&TP .
528 .Ss \&R
529 Text is rendered in roman (the default font).
530 .Pp
531 See also
532 .Sx \&I
533 and
534 .Sx \&B .
535 .Ss \&RB
536 Text is rendered alternately in roman (the default font) and bold face.
537 Whitespace between arguments is omitted in output.
538 .Pp
539 See
540 .Sx \&BI
541 for an equivalent example.
542 .Pp
543 See also
544 .Sx \&BI ,
545 .Sx \&IB ,
546 .Sx \&BR ,
547 .Sx \&RI ,
548 and
549 .Sx \&IR .
550 .Ss \&RE
551 Explicitly close out the scope of a prior
552 .Sx \&RS .
553 The default left margin is restored to the state of the original
554 .Sx \&RS
555 invocation.
556 .Ss \&RI
557 Text is rendered alternately in roman (the default font) and italics.
558 Whitespace between arguments is omitted in output.
559 .Pp
560 See
561 .Sx \&BI
562 for an equivalent example.
563 .Pp
564 See also
565 .Sx \&BI ,
566 .Sx \&IB ,
567 .Sx \&BR ,
568 .Sx \&RB ,
569 and
570 .Sx \&IR .
571 .Ss \&RS
572 Temporarily reset the default left margin.
573 This has the following syntax:
574 .Bd -filled -offset indent
575 .Pf \. Sx \&RS
576 .Op Cm width
577 .Ed
578 .Pp
579 The
580 .Cm width
581 argument is a
582 .Xr roff 7
583 scaling width.
584 If not specified, the saved or default width is used.
585 .Pp
586 See also
587 .Sx \&RE .
588 .Ss \&SB
589 Text is rendered in small size (one point smaller than the default font)
590 bold face.
591 .Ss \&SH
592 Begin a section.
593 The scope of a section is only closed by another section or the end of
594 file.
595 The paragraph left-margin width is reset to the default.
596 .Ss \&SM
597 Text is rendered in small size (one point smaller than the default
598 font).
599 .Ss \&SS
600 Begin a sub-section.
601 The scope of a sub-section is closed by a subsequent sub-section,
602 section, or end of file.
603 The paragraph left-margin width is reset to the default.
604 .Ss \&TH
605 Sets the title of the manual page with the following syntax:
606 .Bd -filled -offset indent
607 .Pf \. Sx \&TH
608 .Ar title section date
609 .Op Ar source Op Ar volume
610 .Ed
611 .Pp
612 Conventionally, the document
613 .Ar title
614 is given in all caps.
615 The recommended
616 .Ar date
617 format is
618 .Sy YYYY-MM-DD
619 as specified in the ISO-8601 standard;
620 if the argument does not conform, it is printed verbatim.
621 If the
622 .Ar date
623 is empty or not specified, the current date is used.
624 The optional
625 .Ar source
626 string specifies the organisation providing the utility.
627 The
628 .Ar volume
629 string replaces the default rendered volume, which is dictated by the
630 manual section.
631 .Pp
632 Examples:
633 .Pp
634 .Dl \&.TH CVS 5 "1992-02-12" GNU
635 .Ss \&TP
636 Begin a paragraph where the head, if exceeding the indentation width, is
637 followed by a newline; if not, the body follows on the same line after a
638 buffer to the indentation width.
639 Subsequent output lines are indented.
640 The syntax is as follows:
641 .Bd -filled -offset indent
642 .Pf \. Sx \&TP
643 .Op Cm width
644 .Ed
645 .Pp
646 The
647 .Cm width
648 argument is a
649 .Xr roff 7
650 scaling width.
651 If specified, it's saved for later paragraph left-margins; if
652 unspecified, the saved or default width is used.
653 .Pp
654 See also
655 .Sx \&HP ,
656 .Sx \&IP ,
657 .Sx \&LP ,
658 .Sx \&P ,
659 and
660 .Sx \&PP .
661 .Ss \&UC
662 Sets the volume for the footer for compatibility with man pages from
663 .Bx
664 releases.
665 The optional first argument specifies which release it is from.
666 .Ss \&UE
667 End a uniform resource identifier block.
668 This is a non-standard GNU extension, included only for compatibility.
669 See
670 .Sx \&UE .
671 .Ss \&UR
672 Begin a uniform resource identifier block.
673 This is a non-standard GNU extension, included only for compatibility.
674 It has the following syntax:
675 .Bd -literal -offset indent
676 .Pf \. Sx \&UR Ar uri
677 link description to be shown
678 .Pf \. Sx UE
679 .Ed
680 .Ss \&br
681 Breaks the current line.
682 Consecutive invocations have no further effect.
683 .Pp
684 See also
685 .Sx \&sp .
686 .Ss \&fi
687 End literal mode begun by
688 .Sx \&nf .
689 .Ss \&in
690 Indent relative to the current indentation:
691 .Pp
692 .D1 Pf \. Sx \&in Op Cm width
693 .Pp
694 If
695 .Cm width
696 is signed, the new offset is relative.
697 Otherwise, it is absolute.
698 This value is reset upon the next paragraph, section, or sub-section.
699 .Ss \&na
700 Don't align to the right margin.
701 .Ss \&nf
702 Begin literal mode: all subsequent free-form lines have their end of
703 line boundaries preserved.
704 May be ended by
705 .Sx \&fi .
706 Literal mode is implicitly ended by
707 .Sx \&SH
708 or
709 .Sx \&SS .
710 .Ss \&sp
711 Insert vertical spaces into output with the following syntax:
712 .Bd -filled -offset indent
713 .Pf \. Sx \&sp
714 .Op Cm height
715 .Ed
716 .Pp
717 The
718 .Cm height
719 argument is a scaling width as described in
720 .Xr roff 7 .
721 If 0, this is equivalent to the
722 .Sx \&br
723 macro.
724 Defaults to 1, if unspecified.
725 .Pp
726 See also
727 .Sx \&br .
728 .Sh MACRO SYNTAX
729 The
730 .Nm
731 macros are classified by scope: line scope or block scope.
732 Line macros are only scoped to the current line (and, in some
733 situations, the subsequent line).
734 Block macros are scoped to the current line and subsequent lines until
735 closed by another block macro.
736 .Ss Line Macros
737 Line macros are generally scoped to the current line, with the body
738 consisting of zero or more arguments.
739 If a macro is scoped to the next line and the line arguments are empty,
740 the next line, which must be text, is used instead.
741 Thus:
742 .Bd -literal -offset indent
743 \&.I
744 foo
745 .Ed
746 .Pp
747 is equivalent to
748 .Sq \&.I foo .
749 If next-line macros are invoked consecutively, only the last is used.
750 If a next-line macro is followed by a non-next-line macro, an error is
751 raised, except for
752 .Sx \&br ,
753 .Sx \&sp ,
754 and
755 .Sx \&na .
756 .Pp
757 The syntax is as follows:
758 .Bd -literal -offset indent
759 \&.YO \(lBbody...\(rB
760 \(lBbody...\(rB
761 .Ed
762 .Bl -column "MacroX" "ArgumentsX" "ScopeXXXXX" "CompatX" -offset indent
763 .It Em Macro Ta Em Arguments Ta Em Scope Ta Em Notes
764 .It Sx \&AT Ta <=1 Ta current Ta \&
765 .It Sx \&B Ta n Ta next-line Ta \&
766 .It Sx \&BI Ta n Ta current Ta \&
767 .It Sx \&BR Ta n Ta current Ta \&
768 .It Sx \&DT Ta 0 Ta current Ta \&
769 .It Sx \&EE Ta 0 Ta current Ta compat
770 .It Sx \&EX Ta 0 Ta current Ta compat
771 .It Sx \&I Ta n Ta next-line Ta \&
772 .It Sx \&IB Ta n Ta current Ta \&
773 .It Sx \&IR Ta n Ta current Ta \&
774 .It Sx \&OP Ta 0, 1 Ta current Ta compat
775 .It Sx \&PD Ta 1 Ta current Ta \&
776 .It Sx \&R Ta n Ta next-line Ta \&
777 .It Sx \&RB Ta n Ta current Ta \&
778 .It Sx \&RI Ta n Ta current Ta \&
779 .It Sx \&SB Ta n Ta next-line Ta \&
780 .It Sx \&SM Ta n Ta next-line Ta \&
781 .It Sx \&TH Ta >1, <6 Ta current Ta \&
782 .It Sx \&UC Ta <=1 Ta current Ta \&
783 .It Sx \&br Ta 0 Ta current Ta compat
784 .It Sx \&fi Ta 0 Ta current Ta compat
785 .It Sx \&in Ta 1 Ta current Ta compat
786 .It Sx \&na Ta 0 Ta current Ta compat
787 .It Sx \&nf Ta 0 Ta current Ta compat
788 .It Sx \&sp Ta 1 Ta current Ta compat
789 .El
790 .Pp
791 Macros marked as
792 .Qq compat
793 are included for compatibility with the significant corpus of existing
794 manuals that mix dialects of roff.
795 These macros should not be used for portable
796 .Nm
797 manuals.
798 .Ss Block Macros
799 Block macros comprise a head and body.
800 As with in-line macros, the head is scoped to the current line and, in
801 one circumstance, the next line (the next-line stipulations as in
802 .Sx Line Macros
803 apply here as well).
804 .Pp
805 The syntax is as follows:
806 .Bd -literal -offset indent
807 \&.YO \(lBhead...\(rB
808 \(lBhead...\(rB
809 \(lBbody...\(rB
810 .Ed
811 .Pp
812 The closure of body scope may be to the section, where a macro is closed
813 by
814 .Sx \&SH ;
815 sub-section, closed by a section or
816 .Sx \&SS ;
817 part, closed by a section, sub-section, or
818 .Sx \&RE ;
819 or paragraph, closed by a section, sub-section, part,
820 .Sx \&HP ,
821 .Sx \&IP ,
822 .Sx \&LP ,
823 .Sx \&P ,
824 .Sx \&PP ,
825 or
826 .Sx \&TP .
827 No closure refers to an explicit block closing macro.
828 .Pp
829 As a rule, block macros may not be nested; thus, calling a block macro
830 while another block macro scope is open, and the open scope is not
831 implicitly closed, is syntactically incorrect.
832 .Bl -column "MacroX" "ArgumentsX" "Head ScopeX" "sub-sectionX" "compatX" -offset indent
833 .It Em Macro Ta Em Arguments Ta Em Head Scope Ta Em Body Scope Ta Em Notes
834 .It Sx \&HP Ta <2 Ta current Ta paragraph Ta \&
835 .It Sx \&IP Ta <3 Ta current Ta paragraph Ta \&
836 .It Sx \&LP Ta 0 Ta current Ta paragraph Ta \&
837 .It Sx \&P Ta 0 Ta current Ta paragraph Ta \&
838 .It Sx \&PP Ta 0 Ta current Ta paragraph Ta \&
839 .It Sx \&RE Ta 0 Ta current Ta none Ta compat
840 .It Sx \&RS Ta 1 Ta current Ta part Ta compat
841 .It Sx \&SH Ta >0 Ta next-line Ta section Ta \&
842 .It Sx \&SS Ta >0 Ta next-line Ta sub-section Ta \&
843 .It Sx \&TP Ta n Ta next-line Ta paragraph Ta \&
844 .It Sx \&UE Ta 0 Ta current Ta none Ta compat
845 .It Sx \&UR Ta 1 Ta current Ta part Ta compat
846 .El
847 .Pp
848 Macros marked
849 .Qq compat
850 are as mentioned in
851 .Sx Line Macros .
852 .Pp
853 If a block macro is next-line scoped, it may only be followed by in-line
854 macros for decorating text.
855 .Ss Font handling
856 In
857 .Nm
858 documents, both
859 .Sx Physical markup
860 macros and
861 .Xr roff 7
862 .Ql \ef
863 font escape sequences can be used to choose fonts.
864 In text lines, the effect of manual font selection by escape sequences
865 only lasts until the next macro invocation; in macro lines, it only lasts
866 until the end of the macro scope.
867 Note that macros like
868 .Sx \&BR
869 open and close a font scope for each argument.
870 .Sh COMPATIBILITY
871 This section documents areas of questionable portability between
872 implementations of the
873 .Nm
874 language.
875 .Pp
876 .Bl -dash -compact
877 .It
878 Do not depend on
879 .Sx \&SH
880 or
881 .Sx \&SS
882 to close out a literal context opened with
883 .Sx \&nf .
884 This behaviour may not be portable.
885 .It
886 In quoted literals, GNU troff allowed pair-wise double-quotes to produce
887 a standalone double-quote in formatted output.
888 It is not known whether this behaviour is exhibited by other formatters.
889 .It
890 troff suppresses a newline before
891 .Sq \(aq
892 macro output; in mandoc, it is an alias for the standard
893 .Sq \&.
894 control character.
895 .It
896 The
897 .Sq \eh
898 .Pq horizontal position ,
899 .Sq \ev
900 .Pq vertical position ,
901 .Sq \em
902 .Pq text colour ,
903 .Sq \eM
904 .Pq text filling colour ,
905 .Sq \ez
906 .Pq zero-length character ,
907 .Sq \ew
908 .Pq string length ,
909 .Sq \ek
910 .Pq horizontal position marker ,
911 .Sq \eo
912 .Pq text overstrike ,
913 and
914 .Sq \es
915 .Pq text size
916 escape sequences are all discarded in mandoc.
917 .It
918 The
919 .Sq \ef
920 scaling unit is accepted by mandoc, but rendered as the default unit.
921 .It
922 The
923 .Sx \&sp
924 macro does not accept negative values in mandoc.
925 In GNU troff, this would result in strange behaviour.
926 .It
927 In page header lines, GNU troff versions up to and including 1.21
928 only print
929 .Ar volume
930 names explicitly specified in the
931 .Sx \&TH
932 macro; mandoc and newer groff print the default volume name
933 corresponding to the
934 .Ar section
935 number when no
936 .Ar volume
937 is given, like in
938 .Xr mdoc 7 .
939 .El
940 .Pp
941 The
942 .Sx OP
943 macro is part of the extended
944 .Nm
945 macro set, and may not be portable to non-GNU troff implementations.
946 .Sh SEE ALSO
947 .Xr man 1 ,
948 .Xr mandoc 1 ,
949 .Xr eqn 7 ,
950 .Xr mandoc_char 7 ,
951 .Xr mdoc 7 ,
952 .Xr roff 7 ,
953 .Xr tbl 7
954 .Sh HISTORY
955 The
956 .Nm
957 language first appeared as a macro package for the roff typesetting
958 system in
959 .At v7 .
960 It was later rewritten by James Clark as a macro package for groff.
961 Eric S. Raymond wrote the extended
962 .Nm
963 macros for groff in 2007.
964 The stand-alone implementation that is part of the
965 .Xr mandoc 1
966 utility written by Kristaps Dzonsons appeared in
967 .Ox 4.6 .
968 .Sh AUTHORS
969 This
970 .Nm
971 reference was written by
972 .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
973 .Sh CAVEATS
974 Do not use this language.
975 Use
976 .Xr mdoc 7 ,
977 instead.