1 .\" $Id: man.7,v 1.133 2017/05/05 02:31:35 schwarze Exp $
3 .\" Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
4 .\" Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org>
5 .\" Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org>
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.
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.
19 .Dd $Mdocdate: May 5 2017 $
24 .Nd legacy formatting language for manual pages
28 language has been used to write
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.
41 to write your manuals:
43 It lacks support for semantic markup.
50 document, lines beginning with the control character
54 The first word is the macro name.
55 It usually consists of two capital letters.
56 For a list of available macros, see
58 The words following the macro name are arguments to the macro.
60 Lines not beginning with the control character are called
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.
69 Many aspects of the basic syntax of the
71 language are based on the
79 manual for details, in particular regarding
80 comments, escape sequences, whitespace, and quoting.
84 document must contain the
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.
92 at least one macro or text line must appear in the document.
94 The following is a well-formed skeleton
98 .Bd -literal -offset indent
99 \&.TH PROGNAME 1 2009-10-10
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.
106 \efBprogname\efR [\efB\e-options\efR] \efIfile ...\efR
108 The \efBfoo\efR utility processes files ...
109 \&.\e\(dq .Sh CONTEXT
110 \&.\e\(dq For section 9 functions only.
111 \&.\e\(dq .SH IMPLEMENTATION NOTES
112 \&.\e\(dq Not used in OpenBSD.
113 \&.\e\(dq .SH RETURN VALUES
114 \&.\e\(dq For sections 2, 3, and 9 function return values only.
115 \&.\e\(dq .SH ENVIRONMENT
116 \&.\e\(dq For sections 1, 6, 7, and 8 only.
118 \&.\e\(dq .SH EXIT STATUS
119 \&.\e\(dq For sections 1, 6, and 8 only.
120 \&.\e\(dq .SH EXAMPLES
121 \&.\e\(dq .SH DIAGNOSTICS
122 \&.\e\(dq For sections 1, 4, 6, 7, 8, and 9 printf/stderr messages only.
124 \&.\e\(dq For sections 2, 3, 4, and 9 errno settings only.
125 \&.\e\(dq .SH SEE ALSO
126 \&.\e\(dq .BR foobar ( 1 )
127 \&.\e\(dq .SH STANDARDS
128 \&.\e\(dq .SH HISTORY
129 \&.\e\(dq .SH AUTHORS
130 \&.\e\(dq .SH CAVEATS
132 \&.\e\(dq .SH SECURITY CONSIDERATIONS
133 \&.\e\(dq Not used in OpenBSD.
138 document are conventionally ordered as they appear above.
139 Sections should be composed as follows:
140 .Bl -ohang -offset indent
142 The name(s) and a short description of the documented material.
143 The syntax for this is generally as follows:
145 .D1 \efBname\efR \e(en description
147 The name of the library containing the documented material, which is
148 assumed to be a function in a section 2 or 3 manual.
149 For functions in the C library, this may be as follows:
151 .D1 Standard C Library (libc, -lc)
153 Documents the utility invocation syntax, function call syntax, or device
156 For the first, utilities (sections 1, 6, and 8), this is
157 generally structured as follows:
159 .D1 \efBname\efR [-\efBab\efR] [-\efBc\efR\efIarg\efR] \efBpath\efR...
161 For the second, function calls (sections 2, 3, 9):
163 .D1 \&.B char *name(char *\efIarg\efR);
165 And for the third, configurations (section 4):
167 .D1 \&.B name* at cardbus ? function ?
169 Manuals not in these sections generally don't need a
172 This expands upon the brief, one-line description in
174 It usually contains a break-down of the options (if documenting a
177 This section lists the contexts in which functions can be called in section 9.
178 The contexts are autoconf, process, or interrupt.
179 .It Em IMPLEMENTATION NOTES
180 Implementation-specific notes should be kept here.
181 This is useful when implementing standard functions that may have side
182 effects or notable algorithmic implications.
184 This section documents the return values of functions in sections 2, 3, and 9.
186 Documents any usages of environment variables, e.g.,
189 Documents files used.
190 It's helpful to document both the file name and a short description of how
191 the file is used (created, modified, etc.).
193 This section documents the command exit status for
194 section 1, 6, and 8 utilities.
195 Historically, this information was described in
197 a practise that is now discouraged.
200 This often contains snippets of well-formed,
201 well-tested invocations.
202 Make sure that examples work properly!
204 Documents error conditions.
205 In section 4 and 9 manuals, these are usually messages
206 printed by the kernel to the console and to the kernel log.
207 In section 1, 6, 7, and 8, these are usually messages
208 printed by userland programs to the standard error output.
210 Historically, this section was used in place of
212 for manuals in sections 1, 6, and 8; however, this practise is
217 settings in sections 2, 3, 4, and 9.
219 References other manuals with related topics.
220 This section should exist for most manuals.
222 .D1 \&.BR bar \&( 1 \&),
224 Cross-references should conventionally be ordered
225 first by section, then alphabetically.
227 References any standards implemented or used, such as
229 .D1 IEEE Std 1003.2 (\e(lqPOSIX.2\e(rq)
231 If not adhering to any standards, the
233 section should be used.
235 A brief history of the subject, including where support first appeared.
237 Credits to the person or persons who wrote the code and/or documentation.
238 Authors should generally be noted by both name and email address.
240 Common misuses and misunderstandings should be explained
243 Known bugs, limitations, and work-arounds should be described
245 .It Em SECURITY CONSIDERATIONS
246 Documents any security precautions that operators should consider.
249 This overview is sorted such that macros of similar purpose are listed
250 together, to help find the best macro for any given purpose.
251 Deprecated macros are not included in the overview, but can be found
252 in the alphabetical reference below.
253 .Ss Page header and footer meta-data
254 .Bl -column "PP, LP, P" description
255 .It Sx TH Ta set the title: Ar title section date Op Ar source Op Ar volume
256 .It Sx AT Ta display AT&T UNIX version in the page footer (<= 1 argument)
257 .It Sx UC Ta display BSD version in the page footer (<= 1 argument)
259 .Ss Sections and paragraphs
260 .Bl -column "PP, LP, P" description
261 .It Sx SH Ta section header (one line)
262 .It Sx SS Ta subsection header (one line)
263 .It Sx PP , LP , P Ta start an undecorated paragraph (no arguments)
264 .It Sx RS , RE Ta reset the left margin: Op Ar width
265 .It Sx IP Ta indented paragraph: Op Ar head Op Ar width
266 .It Sx TP Ta tagged paragraph: Op Ar width
267 .It Sx HP Ta hanged paragraph: Op Ar width
268 .It Sx PD Ta set vertical paragraph distance: Op Ar height
269 .It Sx \&sp Ta force vertical space: Op Ar height
270 .It Sx fi , nf Ta fill mode and no-fill mode (no arguments)
271 .It Sx in Ta additional indent: Op Ar width
274 .Bl -column "PP, LP, P" description
275 .It Sx B Ta boldface font
276 .It Sx I Ta italic font
277 .It Sx R Ta roman (default) font
278 .It Sx SB Ta small boldface font
279 .It Sx SM Ta small roman font
280 .It Sx BI Ta alternate between boldface and italic fonts
281 .It Sx BR Ta alternate between boldface and roman fonts
282 .It Sx IB Ta alternate between italic and boldface fonts
283 .It Sx IR Ta alternate between italic and roman fonts
284 .It Sx RB Ta alternate between roman and boldface fonts
285 .It Sx RI Ta alternate between roman and italic fonts
288 This section is a canonical reference to all macros, arranged
290 For the scoping of individual macros, see
293 Sets the volume for the footer for compatibility with man pages from
296 The optional arguments specify which release it is from.
298 Text is rendered in bold face.
305 Text is rendered alternately in bold face and italic.
307 .Sq .BI this word and that
312 to render in bold face, while
317 Whitespace between arguments is omitted in output.
321 .Dl \&.BI bold italic bold italic
323 The output of this example will be emboldened
327 with spaces stripped between arguments.
337 Text is rendered alternately in bold face and roman (the default font).
338 Whitespace between arguments is omitted in output.
342 for an equivalent example.
353 Included for compatibility.
355 This is a non-standard GNU extension, included only for compatibility.
361 This is a non-standard GNU extension, included only for compatibility.
367 Begin a paragraph whose initial output line is left-justified, but
368 subsequent output lines are indented, with the following syntax:
369 .Bd -filled -offset indent
379 If specified, it's saved for later paragraph left-margins; if unspecified, the
380 saved or default width is used.
390 Text is rendered in italics.
397 Text is rendered alternately in italics and bold face.
398 Whitespace between arguments is omitted in output.
402 for an equivalent example.
412 Begin an indented paragraph with the following syntax:
413 .Bd -filled -offset indent
415 .Op Ar head Op Ar width
422 scaling width defining the left margin.
423 It's saved for later paragraph left-margins; if unspecified, the saved or
424 default width is used.
428 argument is used as a leading term, flushed to the left margin.
429 This is useful for bulleted paragraphs and so on.
439 Text is rendered alternately in italics and roman (the default font).
440 Whitespace between arguments is omitted in output.
444 for an equivalent example.
454 Begin an undecorated paragraph.
455 The scope of a paragraph is closed by a subsequent paragraph,
456 sub-section, section, or end of file.
457 The saved paragraph left-margin width is reset to the default.
467 Optional command-line argument.
468 This is a non-standard GNU extension, included only for compatibility.
469 It has the following syntax:
470 .Bd -filled -offset indent
477 is usually a command-line flag and
492 Specify the vertical space to be inserted before each new paragraph.
494 The syntax is as follows:
495 .Bd -filled -offset indent
507 If the unit is omitted,
511 This macro affects the spacing before any subsequent instances of
533 Text is rendered in roman (the default font).
540 Text is rendered alternately in roman (the default font) and bold face.
541 Whitespace between arguments is omitted in output.
545 for an equivalent example.
555 Explicitly close out the scope of a prior
557 The default left margin is restored to the state before that
561 The syntax is as follows:
562 .Bd -filled -offset indent
567 Without an argument, the most recent
574 blocks are closed out.
581 Text is rendered alternately in roman (the default font) and italics.
582 Whitespace between arguments is omitted in output.
586 for an equivalent example.
596 Temporarily reset the default left margin.
597 This has the following syntax:
598 .Bd -filled -offset indent
608 If not specified, the saved or default width is used.
613 Text is rendered in small size (one point smaller than the default font)
617 The scope of a section is only closed by another section or the end of
619 The paragraph left-margin width is reset to the default.
621 Text is rendered in small size (one point smaller than the default
625 The scope of a sub-section is closed by a subsequent sub-section,
626 section, or end of file.
627 The paragraph left-margin width is reset to the default.
629 Sets the title of the manual page for use in the page header
630 and footer with the following syntax:
631 .Bd -filled -offset indent
633 .Ar title section date
634 .Op Ar source Op Ar volume
637 Conventionally, the document
639 is given in all caps.
644 as specified in the ISO-8601 standard;
645 if the argument does not conform, it is printed verbatim.
648 is empty or not specified, the current date is used.
651 string specifies the organisation providing the utility.
659 string replaces the default rendered volume, which is dictated by the
664 .Dl \&.TH CVS 5 "1992-02-12" GNU
666 Begin a paragraph where the head, if exceeding the indentation width, is
667 followed by a newline; if not, the body follows on the same line after a
668 buffer to the indentation width.
669 Subsequent output lines are indented.
670 The syntax is as follows:
671 .Bd -filled -offset indent
681 If specified, it's saved for later paragraph left-margins; if
682 unspecified, the saved or default width is used.
692 Sets the volume for the footer for compatibility with man pages from
695 The optional first argument specifies which release it is from.
697 End a uniform resource identifier block.
698 This is a non-standard GNU extension, included only for compatibility.
702 Begin a uniform resource identifier block.
703 This is a non-standard GNU extension, included only for compatibility.
704 It has the following syntax:
705 .Bd -literal -offset indent
706 .Pf \. Sx \&UR Ar uri
707 link description to be shown
711 Breaks the current line.
712 Consecutive invocations have no further effect.
717 End literal mode begun by
720 Indent relative to the current indentation:
722 .D1 Pf \. Sx \&in Op Ar width
726 is signed, the new offset is relative.
727 Otherwise, it is absolute.
728 This value is reset upon the next paragraph, section, or sub-section.
730 Begin literal mode: all subsequent free-form lines have their end of
731 line boundaries preserved.
734 Literal mode is implicitly ended by
739 Insert vertical spaces into output with the following syntax:
740 .Bd -filled -offset indent
747 argument is a scaling width as described in
749 If 0, this is equivalent to the
753 Defaults to 1, if unspecified.
757 macros are classified by scope: line scope or block scope.
758 Line macros are only scoped to the current line (and, in some
759 situations, the subsequent line).
760 Block macros are scoped to the current line and subsequent lines until
761 closed by another block macro.
763 Line macros are generally scoped to the current line, with the body
764 consisting of zero or more arguments.
765 If a macro is scoped to the next line and the line arguments are empty,
766 the next line, which must be text, is used instead.
768 .Bd -literal -offset indent
775 If next-line macros are invoked consecutively, only the last is used.
776 If a next-line macro is followed by a non-next-line macro, an error is
780 The syntax is as follows:
781 .Bd -literal -offset indent
782 \&.YO \(lBbody...\(rB
785 .Bl -column "MacroX" "ArgumentsX" "ScopeXXXXX" "CompatX" -offset indent
786 .It Em Macro Ta Em Arguments Ta Em Scope Ta Em Notes
787 .It Sx \&AT Ta <=1 Ta current Ta \&
788 .It Sx \&B Ta n Ta next-line Ta \&
789 .It Sx \&BI Ta n Ta current Ta \&
790 .It Sx \&BR Ta n Ta current Ta \&
791 .It Sx \&DT Ta 0 Ta current Ta \&
792 .It Sx \&EE Ta 0 Ta current Ta compat
793 .It Sx \&EX Ta 0 Ta current Ta compat
794 .It Sx \&I Ta n Ta next-line Ta \&
795 .It Sx \&IB Ta n Ta current Ta \&
796 .It Sx \&IR Ta n Ta current Ta \&
797 .It Sx \&OP Ta 0, 1 Ta current Ta compat
798 .It Sx \&PD Ta 1 Ta current Ta \&
799 .It Sx \&R Ta n Ta next-line Ta \&
800 .It Sx \&RB Ta n Ta current Ta \&
801 .It Sx \&RI Ta n Ta current Ta \&
802 .It Sx \&SB Ta n Ta next-line Ta \&
803 .It Sx \&SM Ta n Ta next-line Ta \&
804 .It Sx \&TH Ta >1, <6 Ta current Ta \&
805 .It Sx \&UC Ta <=1 Ta current Ta \&
806 .It Sx \&fi Ta 0 Ta current Ta compat
807 .It Sx \&in Ta 1 Ta current Ta compat
808 .It Sx \&nf Ta 0 Ta current Ta compat
809 .It Sx \&sp Ta 1 Ta current Ta compat
814 are included for compatibility with the significant corpus of existing
815 manuals that mix dialects of roff.
816 These macros should not be used for portable
820 Block macros comprise a head and body.
821 As with in-line macros, the head is scoped to the current line and, in
822 one circumstance, the next line (the next-line stipulations as in
826 The syntax is as follows:
827 .Bd -literal -offset indent
828 \&.YO \(lBhead...\(rB
833 The closure of body scope may be to the section, where a macro is closed
836 sub-section, closed by a section or
838 part, closed by a section, sub-section, or
840 or paragraph, closed by a section, sub-section, part,
848 No closure refers to an explicit block closing macro.
850 As a rule, block macros may not be nested; thus, calling a block macro
851 while another block macro scope is open, and the open scope is not
852 implicitly closed, is syntactically incorrect.
853 .Bl -column "MacroX" "ArgumentsX" "Head ScopeX" "sub-sectionX" "compatX" -offset indent
854 .It Em Macro Ta Em Arguments Ta Em Head Scope Ta Em Body Scope Ta Em Notes
855 .It Sx \&HP Ta <2 Ta current Ta paragraph Ta \&
856 .It Sx \&IP Ta <3 Ta current Ta paragraph Ta \&
857 .It Sx \&LP Ta 0 Ta current Ta paragraph Ta \&
858 .It Sx \&P Ta 0 Ta current Ta paragraph Ta \&
859 .It Sx \&PP Ta 0 Ta current Ta paragraph Ta \&
860 .It Sx \&RE Ta 0 Ta current Ta none Ta compat
861 .It Sx \&RS Ta 1 Ta current Ta part Ta compat
862 .It Sx \&SH Ta >0 Ta next-line Ta section Ta \&
863 .It Sx \&SS Ta >0 Ta next-line Ta sub-section Ta \&
864 .It Sx \&TP Ta n Ta next-line Ta paragraph Ta \&
865 .It Sx \&UE Ta 0 Ta current Ta none Ta compat
866 .It Sx \&UR Ta 1 Ta current Ta part Ta compat
874 If a block macro is next-line scoped, it may only be followed by in-line
875 macros for decorating text.
884 font escape sequences can be used to choose fonts.
885 In text lines, the effect of manual font selection by escape sequences
886 only lasts until the next macro invocation; in macro lines, it only lasts
887 until the end of the macro scope.
888 Note that macros like
890 open and close a font scope for each argument.
902 language first appeared as a macro package for the roff typesetting
905 It was later rewritten by James Clark as a macro package for groff.
906 Eric S. Raymond wrote the extended
908 macros for groff in 2007.
909 The stand-alone implementation that is part of the
911 utility written by Kristaps Dzonsons appeared in
916 reference was written by
917 .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
919 Do not use this language.