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