version 1.37, 2009/09/05 10:37:09 |
version 1.41, 2009/10/26 10:36:46 |
Line 119 from input. These are later re-added, if applicable, |
|
Line 119 from input. These are later re-added, if applicable, |
|
utility such as |
utility such as |
.Xr mandoc 1 . |
.Xr mandoc 1 . |
. |
. |
|
.Ss Scaling Widths |
|
Many macros support scaled widths for their arguments, such as |
|
stipulating a two-inch paragraph indentation with the following: |
|
.Bd -literal -offset indent |
|
\&.HP 2i |
|
.Ed |
. |
. |
|
.Pp |
|
The syntax for scaled widths is |
|
.Sq Li [+-]?[0-9]*.[0-9]*[:unit:]? , |
|
where a decimal must be preceded or proceeded by at least one digit. |
|
Negative numbers, while accepted, are truncated to zero. The following |
|
scaling units are accepted: |
|
. |
|
.Pp |
|
.Bl -tag -width Ds -offset indent -compact |
|
.It c |
|
centimetre |
|
.It i |
|
inch |
|
.It P |
|
pica (~1/6 inch) |
|
.It p |
|
point (~1/72 inch) |
|
.It f |
|
synonym for |
|
.Sq u |
|
.It v |
|
default vertical span |
|
.It m |
|
width of rendered |
|
.Sq m |
|
.Pq em |
|
character |
|
.It n |
|
width of rendered |
|
.Sq n |
|
.Pq en |
|
character |
|
.It u |
|
default horizontal span |
|
.It M |
|
mini-em (~1/100 em) |
|
.El |
|
.Pp |
|
Using anything other than |
|
.Sq m , |
|
.Sq n , |
|
.Sq u , |
|
or |
|
.Sq v |
|
is necessarily non-portable across output media. See |
|
.Sx COMPATIBILITY . |
|
. |
|
.Pp |
|
If a scaling unit is not provided, the numerical value is interpreted |
|
under the default rules of |
|
.Sq v |
|
for vertical spaces and |
|
.Sq u |
|
for horizontal ones. |
|
.Em Note : |
|
this differs from |
|
.Xr mdoc 7 , |
|
which, if a unit is not provided, will instead interpret the string as |
|
literal text. |
|
. |
|
. |
.Sh MANUAL STRUCTURE |
.Sh MANUAL STRUCTURE |
Each |
Each |
.Nm |
.Nm |
document must contain contains at least the |
document must contain contains at least the |
.Sq TH |
.Sx \&TH |
macro describing the document's section and title. It may occur |
macro describing the document's section and title. It may occur |
anywhere in the document, although conventionally, it appears as the |
anywhere in the document, although conventionally, it appears as the |
first macro. |
first macro. |
. |
. |
.Pp |
.Pp |
Beyond |
Beyond |
.Sq TH , |
.Sx \&TH , |
at least one macro or text node must appear in the document. Documents |
at least one macro or text node must appear in the document. Documents |
are generally structured as follows: |
are generally structured as follows: |
.Bd -literal -offset indent |
.Bd -literal -offset indent |
Line 170 The \efBfoo\efR utility processes files... |
|
Line 237 The \efBfoo\efR utility processes files... |
|
\&.\e\*q .SH BUGS |
\&.\e\*q .SH BUGS |
\&.\e\*q .SH SECURITY CONSIDERATIONS |
\&.\e\*q .SH SECURITY CONSIDERATIONS |
.Ed |
.Ed |
|
.Pp |
|
The sections in a |
|
.Nm |
|
document are conventionally ordered as they appear above. Sections |
|
should be composed as follows: |
|
.Bl -tag -width Ds -offset Ds |
|
.It NAME |
|
The name(s) and a short description of the documented material. The |
|
syntax for this is generally as follows: |
|
.Pp |
|
.D1 \efBname\efR \e(en description |
|
.It LIBRARY |
|
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: |
|
.Pp |
|
.D1 Standard C Library (libc, -lc) |
|
.It SYNOPSIS |
|
Documents the utility invocation syntax, function call syntax, or device |
|
configuration. |
|
.Pp |
|
For the first, utilities (sections 1, 6, and 8), this is |
|
generally structured as follows: |
|
.Pp |
|
.D1 \efBname\efR [-\efBab\efR] [-\efBc\efR\efIarg\efR] \efBpath\efR... |
|
.Pp |
|
For the second, function calls (sections 2, 3, 9): |
|
.Pp |
|
.D1 \. Ns Sx \&B No char *name(char *\efIarg\efR); |
|
.Pp |
|
And for the third, configurations (section 4): |
|
.Pp |
|
.D1 \. Ns Sx \&B No name* at cardbus ? function ? |
|
.Pp |
|
Manuals not in these sections generally don't need a SYNOPSIS. |
|
.It DESCRIPTION |
|
This expands upon the brief, one-line description in NAME. It usually |
|
contains a break-down of the options (if documenting a command). |
|
.It IMPLEMENTATION NOTES |
|
Implementation-specific notes should be kept here. This is useful when |
|
implementing standard functions that may have side effects or notable |
|
algorithmic implications. |
|
.It EXIT STATUS |
|
.It RETURN VALUES |
|
.It ENVIRONMENT |
|
.It FILES |
|
.It EXAMPLES |
|
.It DIAGNOSTICS |
|
.It ERRORS |
|
.It SEE ALSO |
|
.It STANDARDS |
|
.It HISTORY |
|
.It AUTHORS |
|
.It CAVEATS |
|
.It BUGS |
|
.It SECURITY CONSIDERATIONS |
|
.El |
. |
. |
. |
. |
.Sh MACRO SYNTAX |
.Sh MACRO SYNTAX |
Line 177 Macros are one to three three characters in length and |
|
Line 301 Macros are one to three three characters in length and |
|
control character , |
control character , |
.Sq \&. , |
.Sq \&. , |
at the beginning of the line. An arbitrary amount of whitespace may |
at the beginning of the line. An arbitrary amount of whitespace may |
sit between the control character and the macro name. Thus, |
sit between the control character and the macro name. Thus, the |
.Sq .PP |
following are equivalent: |
and |
.Bd -literal -offset indent |
.Sq \&.\ \ \ PP |
\&.PP |
are equivalent. |
\&.\ \ \ PP |
|
.Ed |
. |
. |
.Pp |
.Pp |
The |
The |
Line 215 If a next-line macro is proceded by a block macro, it |
|
Line 340 If a next-line macro is proceded by a block macro, it |
|
.Pp |
.Pp |
.Bl -column -compact -offset indent "MacroX" "ArgumentsX" "ScopeXXXXX" |
.Bl -column -compact -offset indent "MacroX" "ArgumentsX" "ScopeXXXXX" |
.It Em Macro Ta Em Arguments Ta Em Scope |
.It Em Macro Ta Em Arguments Ta Em Scope |
.It B Ta n Ta next-line |
.It Sx \&B Ta n Ta next-line |
.It BI Ta n Ta current |
.It Sx \&BI Ta n Ta current |
.It BR Ta n Ta current |
.It Sx \&BR Ta n Ta current |
.It DT Ta 0 Ta current |
.It Sx \&DT Ta 0 Ta current |
.It I Ta n Ta next-line |
.It Sx \&I Ta n Ta next-line |
.It IB Ta n Ta current |
.It Sx \&IB Ta n Ta current |
.It IR Ta n Ta current |
.It Sx \&IR Ta n Ta current |
.It R Ta n Ta next-line |
.It Sx \&PD Ta n Ta current |
.It RB Ta n Ta current |
.It Sx \&R Ta n Ta next-line |
.It RI Ta n Ta current |
.It Sx \&RB Ta n Ta current |
.It SB Ta n Ta next-line |
.It Sx \&RI Ta n Ta current |
.It SM Ta n Ta next-line |
.It Sx \&SB Ta n Ta next-line |
.It TH Ta >1, <6 Ta current |
.It Sx \&SM Ta n Ta next-line |
.It UC Ta n Ta current |
.It Sx \&TH Ta >1, <6 Ta current |
.It br Ta 0 Ta current |
.It Sx \&UC Ta n Ta current |
.It fi Ta 0 Ta current |
.It Sx \&br Ta 0 Ta current |
.It i Ta n Ta current |
.It Sx \&fi Ta 0 Ta current |
.It na Ta 0 Ta current |
.It Sx \&i Ta n Ta current |
.It nf Ta 0 Ta current |
.It Sx \&na Ta 0 Ta current |
.It r Ta 0 Ta current |
.It Sx \&nf Ta 0 Ta current |
.It sp Ta 1 Ta current |
.It Sx \&r Ta 0 Ta current |
|
.It Sx \&sp Ta 1 Ta current |
.El |
.El |
. |
. |
.Pp |
.Pp |
The |
The |
.Sq RS , |
.Sx \&PD , |
.Sq RE , |
.Sx \&RS , |
.Sq UC , |
.Sx \&RE , |
.Sq br , |
.Sx \&UC , |
.Sq fi , |
.Sx \&br , |
.Sq i , |
.Sx \&fi , |
.Sq na , |
.Sx \&i , |
.Sq nf , |
.Sx \&na , |
.Sq r , |
.Sx \&nf , |
|
.Sx \&r , |
and |
and |
.Sq sp |
.Sx \&sp |
macros should not be used. They're included for compatibility. |
macros should not be used. They're included for compatibility. |
. |
. |
. |
. |
Line 268 subsequent block macro invocation. |
|
Line 395 subsequent block macro invocation. |
|
.Pp |
.Pp |
The closure of body scope may be to the section, where a macro is closed |
The closure of body scope may be to the section, where a macro is closed |
by |
by |
.Sq SH ; |
.Sx \&SH ; |
sub-section, closed by a section or |
sub-section, closed by a section or |
.Sq SS ; |
.Sx \&SS ; |
part, closed by a section, sub-section, or |
part, closed by a section, sub-section, or |
.Sq RE ; |
.Sx \&RE ; |
or paragraph, closed by a section, sub-section, part, |
or paragraph, closed by a section, sub-section, part, |
.Sq HP , |
.Sx \&HP , |
.Sq IP , |
.Sx \&IP , |
.Sq LP , |
.Sx \&LP , |
.Sq P , |
.Sx \&P , |
.Sq PP , |
.Sx \&PP , |
or |
or |
.Sq TP . |
.Sx \&TP . |
No closure refers to an explicit block closing macro. |
No closure refers to an explicit block closing macro. |
. |
. |
.Pp |
.Pp |
.Bl -column "MacroX" "ArgumentsX" "Head ScopeX" "sub-sectionX" -compact -offset indent |
.Bl -column "MacroX" "ArgumentsX" "Head ScopeX" "sub-sectionX" -compact -offset indent |
.It Em Macro Ta Em Arguments Ta Em Head Scope Ta Em Body Scope |
.It Em Macro Ta Em Arguments Ta Em Head Scope Ta Em Body Scope |
.It HP Ta <2 Ta current Ta paragraph |
.It Sx \&HP Ta <2 Ta current Ta paragraph |
.It IP Ta <3 Ta current Ta paragraph |
.It Sx \&IP Ta <3 Ta current Ta paragraph |
.It LP Ta 0 Ta current Ta paragraph |
.It Sx \&LP Ta 0 Ta current Ta paragraph |
.It P Ta 0 Ta current Ta paragraph |
.It Sx \&P Ta 0 Ta current Ta paragraph |
.It PP Ta 0 Ta current Ta paragraph |
.It Sx \&PP Ta 0 Ta current Ta paragraph |
.It RE Ta 0 Ta current Ta none |
.It Sx \&RE Ta 0 Ta current Ta none |
.It RS Ta 1 Ta current Ta part |
.It Sx \&RS Ta 1 Ta current Ta part |
.It SH Ta >0 Ta next-line Ta section |
.It Sx \&SH Ta >0 Ta next-line Ta section |
.It SS Ta >0 Ta next-line Ta sub-section |
.It Sx \&SS Ta >0 Ta next-line Ta sub-section |
.It TP Ta n Ta next-line Ta paragraph |
.It Sx \&TP Ta n Ta next-line Ta paragraph |
.El |
.El |
. |
. |
.Pp |
.Pp |
If a block macro is next-line scoped, it may only be followed by in-line |
If a block macro is next-line scoped, it may only be followed by in-line |
macros (excluding |
macros (excluding |
.Sq DT , |
.Sx \&DT , |
.Sq TH , |
.Sx \&PD , |
.Sq UC , |
.Sx \&TH , |
.Sq br , |
.Sx \&UC , |
.Sq na , |
.Sx \&br , |
.Sq sp , |
.Sx \&na , |
.Sq nf , |
.Sx \&sp , |
|
.Sx \&nf , |
and |
and |
.Sq fi ) . |
.Sx \&fi ) . |
. |
. |
. |
. |
.Sh REFERENCE |
.Sh REFERENCE |
Line 317 This section is a canonical reference to all macros, a |
|
Line 445 This section is a canonical reference to all macros, a |
|
alphabetically. For the scoping of individual macros, see |
alphabetically. For the scoping of individual macros, see |
.Sx MACRO SYNTAX . |
.Sx MACRO SYNTAX . |
. |
. |
. |
.Ss \&B |
.Ss Definitions |
|
In this reference, a numerical width may be either a standalone natural |
|
number (such as 3, 4, 10, etc.) or a natural number followed by a width |
|
multiplier |
|
.Qq n , |
|
corresponding to the width of the formatted letter n, or |
|
.Qq m , |
|
corresponding to the width of the formatted letter m. The latter is the |
|
default, if unspecified. Thus, |
|
.Bd -literal -offset indent |
|
\&.HP 12n |
|
.Ed |
|
. |
|
.Pp |
|
indicates an offset of 12 |
|
.Qq n |
|
.Ns -sized |
|
letters. |
|
. |
|
. |
|
.Ss Macro Reference |
|
.Bl -tag -width Ds |
|
.It B |
|
Text is rendered in bold face. |
Text is rendered in bold face. |
.It BI |
.Ss \&BI |
Text is rendered alternately in bold face and italic. Thus, |
Text is rendered alternately in bold face and italic. Thus, |
.Sq .BI this word and that |
.Sq .BI this word and that |
causes |
causes |
Line 354 to render in bold face, while |
|
Line 459 to render in bold face, while |
|
and |
and |
.Sq that |
.Sq that |
render in italics. Whitespace between arguments is omitted in output. |
render in italics. Whitespace between arguments is omitted in output. |
.It BR |
.Ss \&BR |
Text is rendered alternately in bold face and roman (the default font). |
Text is rendered alternately in bold face and roman (the default font). |
Whitespace between arguments is omitted in output. |
Whitespace between arguments is omitted in output. |
.It DT |
.Ss \&DT |
Has no effect. Included for compatibility. |
Has no effect. Included for compatibility. |
.It HP |
.Ss \&HP |
Begin a paragraph whose initial output line is left-justified, but |
Begin a paragraph whose initial output line is left-justified, but |
subsequent output lines are indented, with the following syntax: |
subsequent output lines are indented, with the following syntax: |
.Bd -literal -offset indent |
.Bd -literal -offset indent |
Line 367 subsequent output lines are indented, with the followi |
|
Line 472 subsequent output lines are indented, with the followi |
|
.Ed |
.Ed |
. |
. |
.Pp |
.Pp |
If |
If scaling width |
.Va width |
.Va width |
is specified, it's saved for later paragraph left-margins; if |
is specified, it's saved for later paragraph left-margins; if |
unspecified, the saved or default width is used. |
unspecified, the saved or default width is used. |
.It I |
.Ss \&I |
Text is rendered in italics. |
Text is rendered in italics. |
.It IB |
.Ss \&IB |
Text is rendered alternately in italics and bold face. Whitespace |
Text is rendered alternately in italics and bold face. Whitespace |
between arguments is omitted in output. |
between arguments is omitted in output. |
.It IP |
.Ss \&IP |
Begin a paragraph with the following syntax: |
Begin a paragraph with the following syntax: |
.Bd -literal -offset indent |
.Bd -literal -offset indent |
\&.IP [head [width]] |
\&.IP [head [width]] |
Line 384 Begin a paragraph with the following syntax: |
|
Line 489 Begin a paragraph with the following syntax: |
|
. |
. |
.Pp |
.Pp |
This follows the behaviour of the |
This follows the behaviour of the |
.Sq TP |
.Sx \&TP |
except for the macro syntax (all arguments on the line, instead of |
except for the macro syntax (all arguments on the line, instead of |
having next-line scope). If |
having next-line scope). If |
.Va width |
.Va width |
is specified, it's saved for later paragraph left-margins; if |
is specified, it's saved for later paragraph left-margins; if |
unspecified, the saved or default width is used. |
unspecified, the saved or default width is used. |
.It IR |
.Ss \&IR |
Text is rendered alternately in italics and roman (the default font). |
Text is rendered alternately in italics and roman (the default font). |
Whitespace between arguments is omitted in output. |
Whitespace between arguments is omitted in output. |
.It LP, P, PP |
.Ss \&LP |
Begin an undecorated paragraph. The scope of a paragraph is closed by a |
Begin an undecorated paragraph. The scope of a paragraph is closed by a |
subsequent paragraph, sub-section, section, or end of file. The saved |
subsequent paragraph, sub-section, section, or end of file. The saved |
paragraph left-margin width is re-set to the default. |
paragraph left-margin width is re-set to the default. |
.It R |
.Ss \&P |
|
Synonym for |
|
.Sx \&LP . |
|
.Ss \&PP |
|
Synonym for |
|
.Sx \&LP . |
|
.Ss \&R |
Text is rendered in roman (the default font). |
Text is rendered in roman (the default font). |
.It RB |
.Ss \&RB |
Text is rendered alternately in roman (the default font) and bold face. |
Text is rendered alternately in roman (the default font) and bold face. |
Whitespace between arguments is omitted in output. |
Whitespace between arguments is omitted in output. |
.It RE |
.Ss \&RE |
Explicitly close out the scope of a prior |
Explicitly close out the scope of a prior |
.Sq RS . |
.Sx \&RS . |
.It RI |
.Ss \&RI |
Text is rendered alternately in roman (the default font) and italics. |
Text is rendered alternately in roman (the default font) and italics. |
Whitespace between arguments is omitted in output. |
Whitespace between arguments is omitted in output. |
.It RS |
.Ss \&RS |
Begin a part setting the left margin. The left margin controls the |
Begin a part setting the left margin. The left margin controls the |
offset, following an initial indentation, to un-indented text such as |
offset, following an initial indentation, to un-indented text such as |
that of |
that of |
.Sq PP . |
.Sx \&PP . |
The width may be specified as following: |
A scaling width may be specified as following: |
.Bd -literal -offset indent |
.Bd -literal -offset indent |
\&.RS [width] |
\&.RS [width] |
.Ed |
.Ed |
Line 422 The width may be specified as following: |
|
Line 533 The width may be specified as following: |
|
If |
If |
.Va width |
.Va width |
is not specified, the saved or default width is used. |
is not specified, the saved or default width is used. |
.It SB |
.Ss \&SB |
Text is rendered in small size (one point smaller than the default font) |
Text is rendered in small size (one point smaller than the default font) |
bold face. |
bold face. |
.It SH |
.Ss \&SH |
Begin a section. The scope of a section is only closed by another |
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 re-set |
section or the end of file. The paragraph left-margin width is re-set |
to the default. |
to the default. |
.It SM |
.Ss \&SM |
Text is rendered in small size (one point smaller than the default |
Text is rendered in small size (one point smaller than the default |
font). |
font). |
.It SS |
.Ss \&SS |
Begin a sub-section. The scope of a sub-section is closed by a |
Begin a sub-section. The scope of a sub-section is closed by a |
subsequent sub-section, section, or end of file. The paragraph |
subsequent sub-section, section, or end of file. The paragraph |
left-margin width is re-set to the default. |
left-margin width is re-set to the default. |
.It TH |
.Ss \&TH |
Sets the title of the manual page with the following syntax: |
Sets the title of the manual page with the following syntax: |
.Bd -literal -offset indent |
.Bd -literal -offset indent |
\&.TH title section [date [source [volume]]] |
\&.TH title section [date [source [volume]]] |
|
|
string specifies the organisation providing the utility. The |
string specifies the organisation providing the utility. The |
.Va volume |
.Va volume |
replaces the default rendered volume as dictated by the manual section. |
replaces the default rendered volume as dictated by the manual section. |
.It TP |
.Ss \&TP |
Begin a paragraph where the head, if exceeding the indentation width, is |
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 |
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. |
buffer to the indentation width. Subsequent output lines are indented. |
. |
. |
.Pp |
.Pp |
The indentation width may be set as follows: |
The indentation scaling width may be set as follows: |
.Bd -literal -offset indent |
.Bd -literal -offset indent |
\&.TP [width] |
\&.TP [width] |
.Ed |
.Ed |
. |
. |
.Pp |
.Pp |
Where |
If |
.Va width |
.Va width |
must be a properly-formed numeric width. If |
|
.Va width |
|
is specified, it's saved for later paragraph left-margins; if |
is specified, it's saved for later paragraph left-margins; if |
unspecified, the saved or default width is used. |
unspecified, the saved or default width is used. |
.It UC |
.Ss \&PD |
Has no effect. Included for compatibility. |
Has no effect. Included for compatibility. |
.It br |
.Ss \&UC |
|
Has no effect. Included for compatibility. |
|
.Ss \&br |
Breaks the current line. Consecutive invocations have no further effect. |
Breaks the current line. Consecutive invocations have no further effect. |
.It fi |
.Ss \&fi |
End literal mode begun by |
End literal mode begun by |
.Sq nf . |
.Sx \&nf . |
.It i |
.Ss \&i |
Italicise arguments. If no arguments are specified, all subsequent text |
Italicise arguments. If no arguments are specified, all subsequent text |
is italicised. |
is italicised. |
.It na |
.Ss \&na |
Don't align to the right margin. |
Don't align to the right margin. |
.It nf |
.Ss \&nf |
Begin literal mode: all subsequent free-form lines have their end of |
Begin literal mode: all subsequent free-form lines have their end of |
line boundaries preserved. May be ended by |
line boundaries preserved. May be ended by |
.Sq fi . |
.Sx \&fi . |
.It r |
.Ss \&r |
Fonts and styles (bold face, italics) reset to roman (default font). |
Fonts and styles (bold face, italics) reset to roman (default font). |
.It sp |
.Ss \&sp |
Insert n spaces, where n is the macro's positive numeric argument. If |
Insert n spaces, where n is the macro's positive numeric argument. If |
0, this is equivalent to the |
0, this is equivalent to the |
.Sq br |
.Sx \&br |
macro. |
macro. |
.El |
|
. |
. |
. |
. |
.Sh COMPATIBILITY |
.Sh COMPATIBILITY |