.TH "MAN" "7" "January 29, 2015" "Debian" "Miscellaneous Information Manual" .nh .if n .ad l .SH "NAME" \fBman\fR \- legacy formatting language for manual pages .SH "DESCRIPTION" Traditionally, the \fBman\fR language has been used to write UNIX manuals for the man(1) utility. It supports limited control of presentational details like fonts, indentation and spacing. This reference document describes the structure of manual pages and the syntax and usage of the man language. .PP \fIDo not use \fBman\fI to write your manuals:\fR It lacks support for semantic markup. Use the mdoc(7) language, instead. .PP In a \fBman\fR document, lines beginning with the control character \(oq\&.\(cq are called \(Lqmacro lines\(Rq. The first word is the macro name. It usually consists of two capital letters. For a list of available macros, see \fIMACRO OVERVIEW\fR. The words following the macro name are arguments to the macro. .PP Lines not beginning with the control character are called \(Lqtext lines\(Rq. They provide free-form text to be printed; the formatting of the text depends on the respective processing context: .nf .sp .RS 6n \&.SH Macro lines change control state. Text lines are interpreted within the current state. .RE .fi .PP Many aspects of the basic syntax of the \fBman\fR language are based on the roff(7) language; see the \fILANGUAGE SYNTAX\fR and \fIMACRO SYNTAX\fR sections in the roff(7) manual for details, in particular regarding comments, escape sequences, whitespace, and quoting. .SH "MANUAL STRUCTURE" Each \fBman\fR document must contain the \fI\&TH\fR macro describing the document's section and title. It may occur anywhere in the document, although conventionally it appears as the first macro. .PP Beyond \fI\&TH\fR, at least one macro or text line must appear in the document. .PP The following is a well-formed skeleton \fBman\fR file for a utility "progname": .nf .sp .RS 6n \&.TH PROGNAME 1 2009-10-10 \&.SH NAME \efBprogname\efR \e(en one line about what it does \&.\e\(dq .SH LIBRARY \&.\e\(dq For sections 2, 3, and 9 only. \&.\e\(dq Not used in OpenBSD. \&.SH SYNOPSIS \efBprogname\efR [\efB\e-options\efR] \efIfile ...\efR \&.SH DESCRIPTION The \efBfoo\efR utility processes files ... \&.\e\(dq .Sh CONTEXT \&.\e\(dq For section 9 functions only. \&.\e\(dq .SH IMPLEMENTATION NOTES \&.\e\(dq Not used in OpenBSD. \&.\e\(dq .SH RETURN VALUES \&.\e\(dq For sections 2, 3, and 9 function return values only. \&.\e\(dq .SH ENVIRONMENT \&.\e\(dq For sections 1, 6, 7, and 8 only. \&.\e\(dq .SH FILES \&.\e\(dq .SH EXIT STATUS \&.\e\(dq For sections 1, 6, and 8 only. \&.\e\(dq .SH EXAMPLES \&.\e\(dq .SH DIAGNOSTICS \&.\e\(dq For sections 1, 4, 6, 7, 8, and 9 printf/stderr messages only. \&.\e\(dq .SH ERRORS \&.\e\(dq For sections 2, 3, 4, and 9 errno settings only. \&.\e\(dq .SH SEE ALSO \&.\e\(dq .BR foobar ( 1 ) \&.\e\(dq .SH STANDARDS \&.\e\(dq .SH HISTORY \&.\e\(dq .SH AUTHORS \&.\e\(dq .SH CAVEATS \&.\e\(dq .SH BUGS \&.\e\(dq .SH SECURITY CONSIDERATIONS \&.\e\(dq Not used in OpenBSD. .RE .fi .PP The sections in a \fBman\fR document are conventionally ordered as they appear above. Sections should be composed as follows: .RS 6n .PP .R "\fINAME\fR .br The name(s) and a short description of the documented material. The syntax for this is generally as follows: .sp .RS 6n \efBname\efR \e(en description .RE .PP .R "\fILIBRARY\fR .br The name of the library containing the documented material, which is assumed to be a function in a section 2 or 3 manual. For functions in the C library, this may be as follows: .sp .RS 6n Standard C Library (libc, -lc) .RE .PP .R "\fISYNOPSIS\fR .br Documents the utility invocation syntax, function call syntax, or device configuration. .sp For the first, utilities (sections 1, 6, and 8), this is generally structured as follows: .sp .RS 6n \efBname\efR [-\efBab\efR] [-\efBc\efR\efIarg\efR] \efBpath\efR... .RE .sp For the second, function calls (sections 2, 3, 9): .sp .RS 6n \&.B char *name(char *\efIarg\efR); .RE .sp And for the third, configurations (section 4): .sp .RS 6n \&.B name* at cardbus? function .RE ? .sp Manuals not in these sections generally don't need a \fISYNOPSIS\fR. .PP .R "\fIDESCRIPTION\fR .br This expands upon the brief, one-line description in \fINAME\fR. It usually contains a break-down of the options (if documenting a command). .PP .R "\fICONTEXT\fR .br This section lists the contexts in which functions can be called in section 9. The contexts are autoconf, process, or interrupt. .PP .R "\fIIMPLEMENTATION NOTES\fR .br Implementation-specific notes should be kept here. This is useful when implementing standard functions that may have side effects or notable algorithmic implications. .PP .R "\fIRETURN VALUES\fR .br This section documents the return values of functions in sections 2, 3, and 9. .PP .R "\fIENVIRONMENT\fR .br Documents any usages of environment variables, e.g., environ(7). .PP .R "\fIFILES\fR .br Documents files used. It's helpful to document both the file name and a short description of how the file is used (created, modified, etc.). .PP .R "\fIEXIT STATUS\fR .br This section documents the command exit status for section 1, 6, and 8 utilities. Historically, this information was described in \fIDIAGNOSTICS\fR, a practise that is now discouraged. .PP .R "\fIEXAMPLES\fR .br Example usages. This often contains snippets of well-formed, well-tested invocations. Make sure that examples work properly! .PP .R "\fIDIAGNOSTICS\fR .br Documents error conditions. In section 4 and 9 manuals, these are usually messages printed by the kernel to the console and to the kernel log. In section 1, 6, 7, and 8, these are usually messages printed by userland programs to the standard error output. .sp Historically, this section was used in place of \fIEXIT STATUS\fR for manuals in sections 1, 6, and 8; however, this practise is discouraged. .PP .R "\fIERRORS\fR .br Documents errno(2) settings in sections 2, 3, 4, and 9. .PP .R "\fISEE ALSO\fR .br References other manuals with related topics. This section should exist for most manuals. .sp .RS 6n \&.BR bar \&( 1 \&), .RE .sp Cross-references should conventionally be ordered first by section, then alphabetically. .PP .R "\fISTANDARDS\fR .br References any standards implemented or used, such as .sp .RS 6n IEEE Std 1003.2 (\e(lqPOSIX.2\e(rq) .RE .sp If not adhering to any standards, the \fIHISTORY\fR section should be used. .PP .R "\fIHISTORY\fR .br A brief history of the subject, including where support first appeared. .PP .R "\fIAUTHORS\fR .br Credits to the person or persons who wrote the code and/or documentation. Authors should generally be noted by both name and email address. .PP .R "\fICAVEATS\fR .br Common misuses and misunderstandings should be explained in this section. .PP .R "\fIBUGS\fR .br Known bugs, limitations, and work-arounds should be described in this section. .PP .R "\fISECURITY CONSIDERATIONS\fR .br Documents any security precautions that operators should consider. .RE .SH "MACRO OVERVIEW" This overview is sorted such that macros of similar purpose are listed together, to help find the best macro for any given purpose. Deprecated macros are not included in the overview, but can be found in the alphabetical reference below. .SS "Page header and footer meta-data" .TS l l. .PP \fITH\fR set the title: \fItitle section date\fR [\fIsource\fR [\fIvolume\fR]] .PP \fIAT\fR display AT&T UNIX version in the page footer (<= 1 argument) .PP \fIUC\fR display BSD version in the page footer (<= 1 argument) .TE .SS "Sections and paragraphs" .TS l l. .PP \fISH\fR section header (one line) .PP \fISS\fR subsection header (one line) .PP \fIPP\fR, \fILP\fR, \fIP\fR start an undecorated paragraph (no arguments) .PP \fIRS\fR, \fIRE\fR reset the left margin: [\fIwidth\fR] .PP \fIIP\fR indented paragraph: [\fIhead\fR [\fIwidth\fR]] .PP \fITP\fR tagged paragraph: [\fIwidth\fR] .PP \fIHP\fR hanged paragraph: [\fIwidth\fR] .PP \fIPD\fR set vertical paragraph distance: [\fIheight\fR] .PP \fI\&br\fR force output line break in text mode (no arguments) .PP \fI\&sp\fR force vertical space: [\fIheight\fR] .PP \fIfi\fR, \fInf\fR fill mode and no-fill mode (no arguments) .PP \fIin\fR additional indent: [\fIwidth\fR] .TE .SS "Physical markup" .TS l l. .PP \fIB\fR boldface font .PP \fII\fR italic font .PP \fIR\fR roman (default) font .PP \fISB\fR small boldface font .PP \fISM\fR small roman font .PP \fIBI\fR alternate between boldface and italic fonts .PP \fIBR\fR alternate between boldface and roman fonts .PP \fIIB\fR alternate between italic and boldface fonts .PP \fIIR\fR alternate between italic and roman fonts .PP \fIRB\fR alternate between roman and boldface fonts .PP \fIRI\fR alternate between roman and italic fonts .TE .SH "MACRO REFERENCE" This section is a canonical reference to all macros, arranged alphabetically. For the scoping of individual macros, see \fIMACRO SYNTAX\fR. .SS "\&AT" Sets the volume for the footer for compatibility with man pages from AT&T UNIX releases. The optional arguments specify which release it is from. .SS "\&B" Text is rendered in bold face. .PP See also \fI\&I\fR and \fI\&R\fR. .SS "\&BI" Text is rendered alternately in bold face and italic. Thus, \(oq.BI this word and that\(cq causes \(oqthis\(cq and \(oqand\(cq to render in bold face, while \(oqword\(cq and \(oqthat\(cq render in italics. Whitespace between arguments is omitted in output. .PP Examples: .PP .RS 6n \&.BI bold italic bold italic .RE .PP The output of this example will be emboldened \(Lqbold\(Rq and italicised \(Lqitalic\(Rq, with spaces stripped between arguments. .PP See also \fI\&IB\fR, \fI\&BR\fR, \fI\&RB\fR, \fI\&RI\fR, and \fI\&IR\fR. .SS "\&BR" Text is rendered alternately in bold face and roman (the default font). Whitespace between arguments is omitted in output. .PP See \fI\&BI\fR for an equivalent example. .PP See also \fI\&BI\fR, \fI\&IB\fR, \fI\&RB\fR, \fI\&RI\fR, and \fI\&IR\fR. .SS "\&DT" Has no effect. Included for compatibility. .SS "\&EE" This is a non-standard GNU extension, included only for compatibility. In mandoc(1), it does the same as \fI\&fi\fR. .SS "\&EX" This is a non-standard GNU extension, included only for compatibility. In mandoc(1), it does the same as \fI\&nf\fR. .SS "\&HP" Begin a paragraph whose initial output line is left-justified, but subsequent output lines are indented, with the following syntax: .sp .RS 6n \.\fI\&HP\fR [\fIwidth\fR] .RE .PP The \fIwidth\fR argument is a roff(7) scaling width. If specified, it's saved for later paragraph left-margins; if unspecified, the saved or default width is used. .PP See also \fI\&IP\fR, \fI\&LP\fR, \fI\&P\fR, \fI\&PP\fR, and \fI\&TP\fR. .SS "\&I" Text is rendered in italics. .PP See also \fI\&B\fR and \fI\&R\fR. .SS "\&IB" Text is rendered alternately in italics and bold face. Whitespace between arguments is omitted in output. .PP See \fI\&BI\fR for an equivalent example. .PP See also \fI\&BI\fR, \fI\&BR\fR, \fI\&RB\fR, \fI\&RI\fR, and \fI\&IR\fR. .SS "\&IP" Begin an indented paragraph with the following syntax: .sp .RS 6n \.\fI\&IP\fR [\fIhead\fR [\fIwidth\fR]] .RE .PP The \fIwidth\fR argument is a roff(7) scaling width defining the left margin. It's saved for later paragraph left-margins; if unspecified, the saved or default width is used. .PP The \fIhead\fR argument is used as a leading term, flushed to the left margin. This is useful for bulleted paragraphs and so on. .PP See also \fI\&HP\fR, \fI\&LP\fR, \fI\&P\fR, \fI\&PP\fR, and \fI\&TP\fR. .SS "\&IR" Text is rendered alternately in italics and roman (the default font). Whitespace between arguments is omitted in output. .PP See \fI\&BI\fR for an equivalent example. .PP See also \fI\&BI\fR, \fI\&IB\fR, \fI\&BR\fR, \fI\&RB\fR, and \fI\&RI\fR. .SS "\&LP" Begin an undecorated paragraph. The scope of a paragraph is closed by a subsequent paragraph, sub-section, section, or end of file. The saved paragraph left-margin width is reset to the default. .PP See also \fI\&HP\fR, \fI\&IP\fR, \fI\&P\fR, \fI\&PP\fR, and \fI\&TP\fR. .SS "\&OP" Optional command-line argument. This is a non-standard GNU extension, included only for compatibility. It has the following syntax: .sp .RS 6n \.\fI\&OP\fR \fIkey\fR [\fIvalue\fR] .RE .PP The \fIkey\fR is usually a command-line flag and \fIvalue\fR its argument. .SS "\&P" Synonym for \fI\&LP\fR. .PP See also \fI\&HP\fR, \fI\&IP\fR, \fI\&LP\fR, \fI\&PP\fR, and \fI\&TP\fR. .SS "\&PD" Specify the vertical space to be inserted before each new paragraph. .br The syntax is as follows: .sp .RS 6n \.\fI\&PD\fR [\fIheight\fR] .RE .PP The \fIheight\fR argument is a roff(7) scaling width. It defaults to \fB1v\fR. If the unit is omitted, \fBv\fR is assumed. .PP This macro affects the spacing before any subsequent instances of \fI\&HP\fR, \fI\&IP\fR, \fI\&LP\fR, \fI\&P\fR, \fI\&PP\fR, \fI\&SH\fR, \fI\&SS\fR, and \fI\&TP\fR. .SS "\&PP" Synonym for \fI\&LP\fR. .PP See also \fI\&HP\fR, \fI\&IP\fR, \fI\&LP\fR, \fI\&P\fR, and \fI\&TP\fR. .SS "\&R" Text is rendered in roman (the default font). .PP See also \fI\&I\fR and \fI\&B\fR. .SS "\&RB" Text is rendered alternately in roman (the default font) and bold face. Whitespace between arguments is omitted in output. .PP See \fI\&BI\fR for an equivalent example. .PP See also \fI\&BI\fR, \fI\&IB\fR, \fI\&BR\fR, \fI\&RI\fR, and \fI\&IR\fR. .SS "\&RE" Explicitly close out the scope of a prior \fI\&RS\fR. The default left margin is restored to the state before that \fI\&RS\fR invocation. .PP The syntax is as follows: .sp .RS 6n \.\fI\&RE\fR [\fIlevel\fR] .RE .PP Without an argument, the most recent \fI\&RS\fR block is closed out. If \fIlevel\fR is 1, all open \fI\&RS\fR blocks are closed out. Otherwise, \fIlevel\fR \(mi 1 nested \fI\&RS\fR blocks remain open. .SS "\&RI" Text is rendered alternately in roman (the default font) and italics. Whitespace between arguments is omitted in output. .PP See \fI\&BI\fR for an equivalent example. .PP See also \fI\&BI\fR, \fI\&IB\fR, \fI\&BR\fR, \fI\&RB\fR, and \fI\&IR\fR. .SS "\&RS" Temporarily reset the default left margin. This has the following syntax: .sp .RS 6n \.\fI\&RS\fR [\fIwidth\fR] .RE .PP The \fIwidth\fR argument is a roff(7) scaling width. If not specified, the saved or default width is used. .PP See also \fI\&RE\fR. .SS "\&SB" Text is rendered in small size (one point smaller than the default font) bold face. .SS "\&SH" Begin a section. The scope of a section is only closed by another section or the end of file. The paragraph left-margin width is reset to the default. .SS "\&SM" Text is rendered in small size (one point smaller than the default font). .SS "\&SS" Begin a sub-section. The scope of a sub-section is closed by a subsequent sub-section, section, or end of file. The paragraph left-margin width is reset to the default. .SS "\&TH" Sets the title of the manual page for use in the page header and footer with the following syntax: .sp .RS 6n \.\fI\&TH\fR \fItitle section date\fR [\fIsource\fR [\fIvolume\fR]] .RE .PP Conventionally, the document \fItitle\fR is given in all caps. The recommended \fIdate\fR format is \fBYYYY-MM-DD\fR as specified in the ISO-8601 standard; if the argument does not conform, it is printed verbatim. If the \fIdate\fR is empty or not specified, the current date is used. The optional \fIsource\fR string specifies the organisation providing the utility. When unspecified, mandoc(1) uses its \fB\-Ios\fR argument. The \fIvolume\fR string replaces the default rendered volume, which is dictated by the manual section. .PP Examples: .PP .RS 6n \&.TH CVS 5 1992-02-12 GNU .RE .SS "\&TP" Begin a paragraph where the head, if exceeding the indentation width, is followed by a newline; if not, the body follows on the same line after a buffer to the indentation width. Subsequent output lines are indented. The syntax is as follows: .sp .RS 6n \.\fI\&TP\fR [\fIwidth\fR] .RE .PP The \fIwidth\fR argument is a roff(7) scaling width. If specified, it's saved for later paragraph left-margins; if unspecified, the saved or default width is used. .PP See also \fI\&HP\fR, \fI\&IP\fR, \fI\&LP\fR, \fI\&P\fR, and \fI\&PP\fR. .SS "\&UC" Sets the volume for the footer for compatibility with man pages from BSD releases. The optional first argument specifies which release it is from. .SS "\&UE" End a uniform resource identifier block. This is a non-standard GNU extension, included only for compatibility. See \fI\&UE\fR. .SS "\&UR" Begin a uniform resource identifier block. This is a non-standard GNU extension, included only for compatibility. It has the following syntax: .nf .sp .RS 6n \.\fI\&UR\fR \fIuri\fR link description to be shown \.\fIUE\fR .RE .fi .SS "\&br" Breaks the current line. Consecutive invocations have no further effect. .PP See also \fI\&sp\fR. .SS "\&fi" End literal mode begun by \fI\&nf\fR. .SS "\&in" Indent relative to the current indentation: .PP .RS 6n \.\fI\&in\fR [\fIwidth\fR] .RE .PP If \fIwidth\fR is signed, the new offset is relative. Otherwise, it is absolute. This value is reset upon the next paragraph, section, or sub-section. .SS "\&nf" Begin literal mode: all subsequent free-form lines have their end of line boundaries preserved. May be ended by \fI\&fi\fR. Literal mode is implicitly ended by \fI\&SH\fR or \fI\&SS\fR. .SS "\&sp" Insert vertical spaces into output with the following syntax: .sp .RS 6n \.\fI\&sp\fR [\fIheight\fR] .RE .PP The \fIheight\fR argument is a scaling width as described in roff(7). If 0, this is equivalent to the \fI\&br\fR macro. Defaults to 1, if unspecified. .PP See also \fI\&br\fR. .SH "MACRO SYNTAX" The \fBman\fR macros are classified by scope: line scope or block scope. Line macros are only scoped to the current line (and, in some situations, the subsequent line). Block macros are scoped to the current line and subsequent lines until closed by another block macro. .SS "Line Macros" Line macros are generally scoped to the current line, with the body consisting of zero or more arguments. If a macro is scoped to the next line and the line arguments are empty, the next line, which must be text, is used instead. Thus: .nf .sp .RS 6n \&.I foo .RE .fi .PP is equivalent to \(oq\&.I foo\(cq. If next-line macros are invoked consecutively, only the last is used. If a next-line macro is followed by a non-next-line macro, an error is raised, except for \fI\&br\fR and \fI\&sp\fR. .PP The syntax is as follows: .nf .sp .RS 6n \&.YO \(lBbody...\(rB \(lBbody...\(rB .RE .fi .RS 6n .TS l l l l. .PP \fIMacro\fR \fIArguments\fR \fIScope\fR \fINotes\fR .PP \fI\&AT\fR <=1 current \& .PP \fI\&B\fR n next-line \& .PP \fI\&BI\fR n current \& .PP \fI\&BR\fR n current \& .PP \fI\&DT\fR 0 current \& .PP \fI\&EE\fR 0 current compat .PP \fI\&EX\fR 0 current compat .PP \fI\&I\fR n next-line \& .PP \fI\&IB\fR n current \& .PP \fI\&IR\fR n current \& .PP \fI\&OP\fR 0, 1 current compat .PP \fI\&PD\fR 1 current \& .PP \fI\&R\fR n next-line \& .PP \fI\&RB\fR n current \& .PP \fI\&RI\fR n current \& .PP \fI\&SB\fR n next-line \& .PP \fI\&SM\fR n next-line \& .PP \fI\&TH\fR >1, <6 current \& .PP \fI\&UC\fR <=1 current \& .PP \fI\&br\fR 0 current compat .PP \fI\&fi\fR 0 current compat .PP \fI\&in\fR 1 current compat .PP \fI\&nf\fR 0 current compat .PP \fI\&sp\fR 1 current compat .TE .RE .PP Macros marked as "compat" are included for compatibility with the significant corpus of existing manuals that mix dialects of roff. These macros should not be used for portable \fBman\fR manuals. .SS "Block Macros" Block macros comprise a head and body. As with in-line macros, the head is scoped to the current line and, in one circumstance, the next line (the next-line stipulations as in \fILine Macros\fR apply here as well). .PP The syntax is as follows: .nf .sp .RS 6n \&.YO \(lBhead...\(rB \(lBhead...\(rB \(lBbody...\(rB .RE .fi .PP The closure of body scope may be to the section, where a macro is closed by \fI\&SH\fR; sub-section, closed by a section or \fI\&SS\fR; part, closed by a section, sub-section, or \fI\&RE\fR; or paragraph, closed by a section, sub-section, part, \fI\&HP\fR, \fI\&IP\fR, \fI\&LP\fR, \fI\&P\fR, \fI\&PP\fR, or \fI\&TP\fR. No closure refers to an explicit block closing macro. .PP As a rule, block macros may not be nested; thus, calling a block macro while another block macro scope is open, and the open scope is not implicitly closed, is syntactically incorrect. .RS 6n .TS l l l l l. .PP \fIMacro\fR \fIArguments\fR \fIHead Scope\fR \fIBody Scope\fR \fINotes\fR .PP \fI\&HP\fR <2 current paragraph \& .PP \fI\&IP\fR <3 current paragraph \& .PP \fI\&LP\fR 0 current paragraph \& .PP \fI\&P\fR 0 current paragraph \& .PP \fI\&PP\fR 0 current paragraph \& .PP \fI\&RE\fR 0 current none compat .PP \fI\&RS\fR 1 current part compat .PP \fI\&SH\fR >0 next-line section \& .PP \fI\&SS\fR >0 next-line sub-section \& .PP \fI\&TP\fR n next-line paragraph \& .PP \fI\&UE\fR 0 current none compat .PP \fI\&UR\fR 1 current part compat .TE .RE .PP Macros marked "compat" are as mentioned in \fILine Macros\fR. .PP If a block macro is next-line scoped, it may only be followed by in-line macros for decorating text. .SS "Font handling" In \fBman\fR documents, both \fIPhysical markup\fR macros and roff(7) \(oq\ef\(cq font escape sequences can be used to choose fonts. In text lines, the effect of manual font selection by escape sequences only lasts until the next macro invocation; in macro lines, it only lasts until the end of the macro scope. Note that macros like \fI\&BR\fR open and close a font scope for each argument. .SH "SEE ALSO" man(1), mandoc(1), eqn(7), mandoc_char(7), mdoc(7), roff(7), tbl(7) .SH "HISTORY" The \fBman\fR language first appeared as a macro package for the roff typesetting system in Version\~7 AT&T UNIX. It was later rewritten by James Clark as a macro package for groff. Eric S. Raymond wrote the extended \fBman\fR macros for groff in 2007. The stand-alone implementation that is part of the mandoc(1) utility written by Kristaps Dzonsons appeared in OpenBSD 4.6. .SH "AUTHORS" This \fBman\fR reference was written by Kristaps Dzonsons <\fIkristaps@bsd.lv\fR>. .SH "CAVEATS" Do not use this language. Use mdoc(7), instead.