MDOC(7) | Miscellaneous Information Manual | MDOC(7) |
This reference document describes the structure of manual pages and the syntax and usage of the mdoc language. The reference implementation of a parsing and formatting tool is mandoc(1); the COMPATIBILITY section describes compatibility with other implementations.
In an mdoc document, lines beginning with the control character ‘.' are called “macro lines”. The first word is the macro name. It consists of two or three letters. Most macro names begin with a capital letter. For a list of available macros, see MACRO OVERVIEW. The words following the macro name are arguments to the macro, optionally including the names of other, callable macros; see MACRO SYNTAX for details.
Lines not beginning with the control character are called “text lines”. They provide free-form text to be printed; the formatting of the text depends on the respective processing context:
.Sh Macro lines change control state. Text lines are interpreted within the current state.
Many aspects of the basic syntax of the mdoc language are based on the roff(7) language; see the LANGUAGE SYNTAX and MACRO SYNTAX sections in the roff(7) manual for details, in particular regarding comments, escape sequences, whitespace, and quoting. However, using roff(7) requests in mdoc documents is discouraged; mandoc(1) supports some of them merely for backward compatibility.
The prologue, which consists of the Dd, Dt, and Os macros in that order, is required for every document.
The first section (sections are denoted by Sh) must be the NAME section, consisting of at least one Nm followed by Nd.
Following that, convention dictates specifying at least the SYNOPSIS and DESCRIPTION sections, although this varies between manual sections.
The following is a well-formed skeleton mdoc file for a utility “progname”:
.Dd $Mdocdate$ .Dt PROGNAME section .Os .Sh NAME .Nm progname .Nd one line about what it does .\" .Sh LIBRARY .\" For sections 2, 3, & 9 only. .\" Not used in OpenBSD. .Sh SYNOPSIS .Nm progname .Op Fl options .Ar .Sh DESCRIPTION The .Nm utility processes files ... .\" .Sh IMPLEMENTATION NOTES .\" Not used in OpenBSD. .\" .Sh RETURN VALUES .\" For sections 2, 3, & 9 only. .\" .Sh ENVIRONMENT .\" For sections 1, 6, 7, & 8 only. .\" .Sh FILES .\" .Sh EXIT STATUS .\" For sections 1, 6, & 8 only. .\" .Sh EXAMPLES .\" .Sh DIAGNOSTICS .\" For sections 1, 4, 6, 7, & 8 only. .\" .Sh ERRORS .\" For sections 2, 3, & 9 only. .\" .Sh SEE ALSO .\" .Xr foobar 1 .\" .Sh STANDARDS .\" .Sh HISTORY .\" .Sh AUTHORS .\" .Sh CAVEATS .\" .Sh BUGS .\" .Sh SECURITY CONSIDERATIONS .\" Not used in OpenBSD.
The sections in an mdoc document are conventionally ordered as they appear above. Sections should be composed as follows:
.Nm name0 , .Nm name1 , .Nm name2 .Nd a one line description
Multiple ‘Nm' names should be separated by commas.
.Lb libarm
See Lb.
For the first, utilities (sections 1, 6, and 8), this is generally structured as follows:
.Nm bar .Op Fl v .Op Fl o Ar file .Op Ar .Nm foo .Op Fl v .Op Fl o Ar file .Op Ar
Commands should be ordered alphabetically.
For the second, function calls (sections 2, 3, 9):
.In header.h .Vt extern const char *global; .Ft "char *" .Fn foo "const char *src" .Ft "char *" .Fn bar "const char *src"
Ordering of In, Vt, Fn, and Fo macros should follow C header-file conventions.
And for the third, configurations (section 4):
.Cd "it* at isa? port 0x2e" .Cd "it* at isa? port 0x4e"
Manuals not in these sections generally don't need a SYNOPSIS.
Some macros are displayed differently in the SYNOPSIS section, particularly Nm, Cd, Fd, Fn, Fo, In, Vt, and Ft. All of these macros are output on their own line. If two such dissimilar macros are pairwise invoked (except for Ft before Fo or Fn), they are separated by a vertical space, unless in the case of Fo, Fn, and Ft, which are always separated by vertical space.
When text and macros following an Nm macro starting an input line span multiple output lines, all output lines but the first will be indented to align with the text immediately following the Nm macro, up to the next Nm, Sh, or Ss macro or the end of an enclosing block, whichever comes first.
The .Nm utility does this, that, and the other.
It usually follows with a breakdown of the options (if documenting a command), such as:
The arguments are as follows: .Bl -tag -width Ds .It Fl v Print verbose information. .El
Manuals not documenting a command won't include the above fragment.
Since the DESCRIPTION section usually contains most of the text of a manual, longer manuals often use the Ss macro to form subsections. In very long manuals, the DESCRIPTION may be split into multiple sections, each started by an Sh macro followed by a non-standard section name, and each having several subsections, like in the present mdoc manual.
See Rv.
See Ev.
See Pa.
See Ex.
See Bl -diag.
See Er.
References to other documentation concerning the topic of the manual page, for example authoritative books or journal articles, may also be provided in this section.
See St.
See An.
Dd | document date: $Mdocdate$ | month day, year |
Dt | document title: TITLE section [volume | arch] |
Os | operating system version: [system [version]] |
Nm | document name (one argument) |
Nd | document description (one line) |
Sh | section header (one line) |
Ss | subsection header (one line) |
Sx | internal cross reference to a section or subsection |
Xr | cross reference to another manual page: name section |
Pp, Lp | start a text paragraph (no arguments) |
Bd, Ed | display block: -type [-offset width] [-compact] |
D1 | indented display (one line) |
Dl | indented literal display (one line) |
Bl, El | list block: -type [-width val] [-offset val] [-compact] |
It | list item (syntax depends on -type) |
Ta | table cell separator in Bl -column lists |
Rs, %*, Re | bibliographic block (references) |
Pf | prefix, no following horizontal space (one argument) |
Ns | roman font, no preceding horizontal space (no arguments) |
Ap | apostrophe without surrounding whitespace (no arguments) |
Sm | switch horizontal spacing mode: on | off |
Bk, Ek | keep block: -words |
br | force output line break in text mode (no arguments) |
sp | force vertical space: [height] |
Nm | start a SYNOPSIS block with the name of a utility |
Fl | command line options (flags) (>=0 arguments) |
Cm | command modifier (>0 arguments) |
Ar | command arguments (>=0 arguments) |
Op, Oo, Oc | optional syntax elements (enclosure) |
Ic | internal or interactive command (>0 arguments) |
Ev | environmental variable (>0 arguments) |
Pa | file system path (>=0 arguments) |
Lb | function library (one argument) |
In | include file (one argument) |
Ft | function type (>0 arguments) |
Fo, Fc | function block: funcname |
Fn | function name: [functype] funcname [[argtype] argname] |
Fa | function argument (>0 arguments) |
Vt | variable type (>0 arguments) |
Va | variable name (>0 arguments) |
Dv | defined variable or preprocessor constant (>0 arguments) |
Er | error constant (>0 arguments) |
Ev | environmental variable (>0 arguments) |
An | author name (>0 arguments) |
Lk | hyperlink: uri [name] |
Mt | “mailto” hyperlink: address |
Cd | kernel configuration declaration (>0 arguments) |
Ad | memory address (>0 arguments) |
Ms | mathematical symbol (>0 arguments) |
Tn | tradename (>0 arguments) |
Em | italic font or underline (emphasis) (>0 arguments) |
Sy | boldface font (symbolic) (>0 arguments) |
Li | typewriter font (literal) (>0 arguments) |
No | return to roman font (normal) (no arguments) |
Bf, Ef | font block: [-type | Em | Li | Sy] |
Dq, Do, Dc | enclose in typographic double quotes: “text” |
Qq, Qo, Qc | enclose in typewriter double quotes: “text” |
Sq, So, Sc | enclose in single quotes: ‘text' |
Ql |
single-quoted literal text: ‘text ' |
Pq, Po, Pc | enclose in parentheses: (text) |
Bq, Bo, Bc | enclose in square brackets: [text] |
Brq, Bro, Brc | enclose in curly braces: {text} |
Aq, Ao, Ac | enclose in angle brackets: <text> |
Eo, Ec | generic enclosure |
Examples:
.Ad [0,$]
.Ad 0x00000000
The default is -nosplit. The effect of selecting either of the -split modes ends at the beginning of the AUTHORS section. In the AUTHORS section, the default is -nosplit for the first author listing and -split for all other author listings.
Examples:
.An -nosplit
.An Kristaps Dzonsons Aq kristaps@bsd.lv
Examples:
.Fl -key= Ns Ao Ar val Ac
See also Aq.
Examples:
.Fn execve Ap d
Examples:
.Fl -key= Ns Aq Ar val
Remarks: this macro is often abused for rendering URIs, which should instead use Lk or Mt, or to note pre-processor “#include
” statements, which should use In.
See also Ao.
Examples:
.Fl o Ar file
.Ar
.Ar arg1 , arg2 .
The arguments to the Ar macro are names and placeholders for command arguments; for fixed strings to be passed verbatim as arguments, use Fl or Cm.
Note that these arguments do not begin with a hyphen.
Examples:
.At
.At III
.At V.1
Display blocks are used to select a different indentation and justification than the one used by the surrounding text. They may contain both macro lines and text lines. By default, a display block is preceded by a vertical space.
The type must be one of the following:
The type must be provided first. Additional arguments may follow:
When the argument is missing, -offset is ignored.
Examples:
.Bd -literal -offset indent -compact Hello world. .Ed
The -emphasis and Em argument are equivalent, as are -symbolic and Sy, and -literal and Li. Without an argument, this macro does nothing. The font mode continues until broken by a new font mode in a nested scope or Ef is encountered.
.Bk -words
The -words argument is required; additional arguments are ignored.
The following example will not break within each Op macro line:
.Bk -words .Op Fl f Ar flags .Op Fl o Ar output .Ek
Be careful in using over-long lines within a keep block! Doing so will clobber the right margin.
The list type is mandatory and must be specified first. The -width and -offset arguments accept Scaling Widths or use the length of the given string. The -offset is a global indentation for the whole list, affecting both item heads and bodies. For those list types supporting it, the -width argument requests an additional indentation of item bodies, to be added to the -offset. Unless the -compact argument is specified, list entries are separated by vertical space.
A list must specify one of the following list types:
Lists may be nested within lists and displays. Nesting of -column and -enum lists may not be portable.
Examples:
.Bo 1 , .Dv BUFSIZ Bc
See also Bq.
Examples:
.Bq 1, Dv BUFSIZ
Remarks: this macro is sometimes abused to emulate optional arguments for commands; the correct macros to use for this purpose are Op, Oo, and Oc.
See also Bo.
Examples:
.Bro 1 , ... , .Va n Brc
See also Brq.
Examples:
.Bsx 1.0
.Bsx
Examples:
.Bx 4.3 Tahoe
.Bx 4.4
.Bx
Examples:
.Cd device le0 at scode?
Remarks: this macro is commonly abused by using quoted literals to retain whitespace and align consecutive Cd declarations. This practise is discouraged.
Examples:
.Nm mt Fl f Ar device Cm rewind
.Nm ps Fl o Cm pid , Ns Cm command
.Nm dd Cm if= Ns Ar file1 Cm of= Ns Ar file2
.Cm IdentityFile Pa ~/.ssh/id_rsa
.Cm LogLevel Dv DEBUG
Examples:
.D1 Fl abcdefgh
.Db on | off
This macro is ignored by mandoc(1).
.Dd month day, year
The month is the full English month name, the day is an optionally zero-padded numeral, and the year is the full four-digit year.
Other arguments are not portable; the mandoc(1) utility handles them as follows:
Examples:
.Dd $Mdocdate$
.Dd $Mdocdate: July 21 2007$
.Dd July 21, 2007
Examples:
.Dl % mandoc mdoc.7 \(ba less
Examples:
.Do April is the cruellest month .Dc \(em T.S. Eliot
See also Dq.
Examples:
.Dq April is the cruellest month \(em T.S. Eliot
Its arguments are as follows:
Examples:
.Dt FOO 1
.Dt FOO 4 KM
.Dt FOO 9 i386
Examples:
.Dv NULL
.Dv BUFSIZ
.Dv STDOUT_FILENO
See also Er and Ev for special-purpose constants and Va for variable symbols.
Examples:
.Dx 2.4.1
.Dx
.Ec [TERM]
The TERM argument is used as the enclosure tail, for example, specifying \(rq will emulate Dc.
Examples:
.Em Warnings!
.Em Remarks:
.Eo [TERM]
The TERM argument is used as the enclosure head, for example, specifying \(lq will emulate Do.
Examples:
.Er EPERM
.Er ENOENT
See also Dv for general constants.
Examples:
.Ev DISPLAY
.Ev PATH
See also Dv for general constants.
.Ex -std [utility ...]
If utility is not specified, the document's name set by Nm is used. Multiple utility arguments are treated as separate utilities.
See also Rv.
This may be invoked for names with or without the corresponding type. It is also used to specify the field name of a structure. Most often, the Fa macro is used in the SYNOPSIS within Fo section when documenting multi-line function prototypes. If invoked with multiple arguments, the arguments are separated by a comma. Furthermore, if the following macro is another Fa, the last argument will also have a trailing comma.
Examples:
.Fa "const char *p"
.Fa "int a" "int b" "int c"
.Fa foo
See also Fo.
See also MANUAL STRUCTURE and In.
Examples:
.Fl R Op Fl H | L | P
.Op Fl 1AaCcdFfgHhikLlmnopqRrSsTtux
.Fl type Cm d Fl name Pa CVS
.Fl Ar signal_number
.Fl o Fl
See also Cm.
Function arguments are surrounded in parenthesis and are delimited by commas. If no arguments are specified, blank parenthesis are output. In the SYNOPSIS section, this macro starts a new output line, and a blank line is automatically inserted between function definitions.
Examples:
.Fn "int funcname" "int arg0" "int arg1"
.Fn funcname "int arg0"
.Fn funcname arg0
.Ft functype .Fn funcname
When referring to a function documented in another manual page, use Xr instead. See also MANUAL STRUCTURE, Fo, and Ft.
.Fo funcname
Invocations usually occur in the following context:
See also MANUAL STRUCTURE, Fa, Fc, and Ft.
It was used to show function return values. The syntax was:
.Fr value
.Ft functype
In the SYNOPSIS section, a new output line is started after this macro.
Examples:
.Ft int
.Ft functype .Fn funcname
See also MANUAL STRUCTURE, Fn, and Fo.
Examples:
.Fx 7.1
.Fx
It was used to include the contents of a (header) file literally. The syntax was:
.Hf filename
Examples:
.Ic :wq
.Ic hash
.Ic alias
Note that using Bd -literal or D1 is preferred for displaying code; the Ic macro is used when referring to specific instructions.
Examples:
.In sys/types.h
See also MANUAL STRUCTURE.
Lists of type -hang, -ohang, -inset, and -diag have the following syntax:
.It args
Lists of type -bullet, -dash, -enum, -hyphen and -item have the following syntax:
.It
with subsequent lines interpreted within the scope of the It until either a closing El or another It.
The -tag list has the following syntax:
.It [args]
Subsequent lines are interpreted as with -bullet and family. The line arguments correspond to the list's left-hand side; body arguments correspond to the list's contents.
The -column list is the most complicated. Its syntax is as follows:
.It cell [<TAB> cell ...]
The arguments consist of one or more lines of text and macros representing a complete table line. Cells within the line are delimited by tabs or by the special Ta block macro. The tab cell delimiter may only be used within the It line itself; on following lines, only the Ta macro can be used to delimit cells, and Ta is only recognised as a macro when called by other macros, not as the first macro on a line.
Note that quoted strings may span tab-delimited cells on an It line. For example,
.It "col1; <TAB> col2 ;" ;
will preserve the semicolon whitespace except for the last.
See also Bl.
.Lb library
The library parameter may be a system library, such as libz or libpam, in which case a small library description is printed next to the linker invocation; or a custom library, in which case the library name is printed in quotes. This is most commonly used in the SYNOPSIS section as described in MANUAL STRUCTURE.
Examples:
.Lb libz
.Lb mdoc
literal
font mode. Note that this is a presentation term and should not be used for stylistically decorating technical terms.On terminal output devices, this is often indistinguishable from normal text.
.Lk uri [name]
Examples:
.Lk http://bsd.lv "The BSD.lv Project"
.Lk http://bsd.lv
See also Mt.
.Ms symbol
Examples:
.Ms sigma
.Ms aleph
.Mt address
Examples:
.Mt discuss@manpages.bsd.lv
Examples:
The Nd macro technically accepts child macros and terminates with a subsequent Sh invocation. Do not assume this behaviour: some whatis(1) database generators are not smart enough to parse more than the line arguments and will display macros verbatim.
See also Nm.
Examples:
.Sh SYNOPSIS .Nm cat .Op Fl benstuv .Op Ar
In the SYNOPSIS of section 2, 3 and 9 manual pages, use the Fn macro rather than Nm to mark up the name of the manual page.
Examples:
.Em italic , Sy bold , No and roman
.Sm off .Cm :C No / Ar pattern No / Ar replacement No / .Sm on
This has no effect when invoked at the start of a macro line.
Examples:
.Ar name Ns = Ns Ar value
.Cm :M Ns Ar pattern
.Fl o Ns Ar output
Examples:
.Nx 5.01
.Nx
Examples:
.Op Fl a Ar b
.Op Ar a | b
See also Oo.
.Os [system [version]]
The optional system parameter specifies the relevant operating system or environment. Left unspecified, it defaults to the local operating system version. This is the suggested form.
Examples:
.Os
.Os KTH/CSC/TCS
.Os BSD 4.3
Historical mdoc(7) packages described it as “old function type (FORTRAN)”.
Examples:
.Ox 4.5
.Ox
Examples:
.Pa /usr/bin/mandoc
.Pa /usr/share/man/man7/mdoc.7
See also Lk.
.Pf prefix macro arguments ...
This is equivalent to:
.No prefix Ns macro arguments ...
Examples:
.Pf $ Ar variable_name
.Pf 0x Ar hex_digits
Paragraph breaks are not needed before or after Sh or Ss macros or before displays (Bd) or lists (Bl) unless the -compact flag is given.
See also Po.
Examples:
.Rs .%A J. E. Hopcroft .%A J. D. Ullman .%B Introduction to Automata Theory, Languages, and Computation .%I Addison-Wesley .%C Reading, Massachusettes .%D 1979 .Re
If an Rs block is used within a SEE ALSO section, a vertical space is asserted before the rendered output, else the block continues on the current line.
.Rv -std [function ...]
If function is not specified, the document's name set by Nm is used. Multiple function arguments are treated as separate functions.
See also Ex.
Section names should be unique so that they may be keyed by Sx. Although this macro is parsed, it should not consist of child node or it may not be linked with Sx.
.Sm on | off
By default, spacing is on. When switched off, no white space is inserted between macro arguments and between the output generated from adjacent macros, but text lines still get normal spacing between words and sentences.
Sub-section names should be unique so that they may be keyed by Sx. Although this macro is parsed, it should not consist of child node or it may not be linked with Sx.
Examples:
.Sx MANUAL STRUCTURE
Since this macro is often implemented to use a small caps font, it has historically been used for acronyms (like ASCII) as well. Such usage is not recommended because it would use the same macro sometimes for semantical annotation, sometimes for physical formatting.
Examples:
.Tn IBM
Examples:
.Ux
Examples:
.Va foo
.Va const char *bar;
Note that this should not be confused with Ft, which is used for function return types.
Examples:
.Vt unsigned char
.Vt extern const char * const sys_signame[] ;
See also MANUAL STRUCTURE and Va.
.Xr name section
The name and section are the name and section of the linked manual. If section is followed by non-punctuation, an Ns is inserted into the token stream. This behaviour is for compatibility with GNU troff.
Examples:
.Xr mandoc 1
.Xr mandoc 1 ;
.Xr mandoc 1 Ns s behaviour
Consider using Pp in the event of natural paragraph breaks.
.sp [height]
The height argument must be formatted as described in Scaling Widths. If unspecified, sp asserts a single vertical space.
The Callable column indicates that the macro may also be called by passing its name as an argument to another macro. For example, ‘.Op Fl O Ar file' produces ‘[-O file]'. To prevent a macro call and render the macro name literally, escape it by prepending a zero-width space, ‘\&'. For example, ‘Op \&Fl O' produces ‘[Fl O]'. If a macro is not callable but its name appears as an argument to another macro, it is interpreted as opaque text. For example, ‘.Fl Sh' produces ‘-Sh'.
The Parsed column indicates whether the macro may call other macros by receiving their names as arguments. If a macro is not parsed but the name of another macro appears as an argument, it is interpreted as opaque text.
The Scope column, if applicable, describes closure rules.
.Yo [-arg [parm...]] [head...] [body...] .Yc
Macro | Callable | Parsed | Scope |
Bd | No | No | closed by Ed |
Bf | No | No | closed by Ef |
Bk | No | No | closed by Ek |
Bl | No | No | closed by El |
Ed | No | No | opened by Bd |
Ef | No | No | opened by Bf |
Ek | No | No | opened by Bk |
El | No | No | opened by Bl |
.Yo [-arg [parm...]] [head... [Ta head...]] [body...]
Macro | Callable | Parsed | Scope |
It | No | Yes | closed by It, El |
Nd | No | No | closed by Sh |
Nm | No | Yes | closed by Nm, Sh, Ss |
Sh | No | Yes | closed by Sh |
Ss | No | Yes | closed by Sh, Ss |
Note that the Nm macro is a Block full-implicit macro only when invoked as the first macro in a SYNOPSIS section line, else it is In-line.
.Yo [-arg [parm...]] [head...] [body...] .Yc [tail...] .Yo [-arg [parm...]] [head...] [body...] Yc [tail...]
Macro | Callable | Parsed | Scope |
Ac | Yes | Yes | opened by Ao |
Ao | Yes | Yes | closed by Ac |
Bc | Yes | Yes | closed by Bo |
Bo | Yes | Yes | opened by Bc |
Brc | Yes | Yes | opened by Bro |
Bro | Yes | Yes | closed by Brc |
Dc | Yes | Yes | opened by Do |
Do | Yes | Yes | closed by Dc |
Ec | Yes | Yes | opened by Eo |
Eo | Yes | Yes | closed by Ec |
Fc | Yes | Yes | opened by Fo |
Fo | No | No | closed by Fc |
Oc | Yes | Yes | closed by Oo |
Oo | Yes | Yes | opened by Oc |
Pc | Yes | Yes | closed by Po |
Po | Yes | Yes | opened by Pc |
Qc | Yes | Yes | opened by Oo |
Qo | Yes | Yes | closed by Oc |
Re | No | No | opened by Rs |
Rs | No | No | closed by Re |
Sc | Yes | Yes | opened by So |
So | Yes | Yes | closed by Sc |
Xc | Yes | Yes | opened by Xo |
Xo | Yes | Yes | closed by Xc |
.Yo [-arg [val...]] [body...] [res...]
Macro | Callable | Parsed |
Aq | Yes | Yes |
Bq | Yes | Yes |
Brq | Yes | Yes |
D1 | No | Yes |
Dl | No | Yes |
Dq | Yes | Yes |
Op | Yes | Yes |
Pq | Yes | Yes |
Ql | Yes | Yes |
Yes | Yes | |
Sq | Yes | Yes |
Vt | Yes | Yes |
Note that the Vt macro is a Block partial-implicit only when invoked as the first macro in a SYNOPSIS section line, else it is In-line.
Macro | Callable | Parsed | Scope |
Ta | Yes | Yes | closed by Ta, It |
.Yo [-arg [val...]] [args...] [res...] .Yo [-arg [val...]] [args...] Yc... .Yo [-arg [val...]] arg0 arg1 argN
Macro | Callable | Parsed | Arguments |
%A | No | No | >0 |
%B | No | No | >0 |
%C | No | No | >0 |
%D | No | No | >0 |
%I | No | No | >0 |
%J | No | No | >0 |
%N | No | No | >0 |
%O | No | No | >0 |
%P | No | No | >0 |
%Q | No | No | >0 |
%R | No | No | >0 |
%T | No | No | >0 |
%U | No | No | >0 |
%V | No | No | >0 |
Ad | Yes | Yes | >0 |
An | Yes | Yes | >0 |
Ap | Yes | Yes | 0 |
Ar | Yes | Yes | n |
At | Yes | Yes | 1 |
Bsx | Yes | Yes | n |
Bt | No | No | 0 |
Bx | Yes | Yes | n |
Cd | Yes | Yes | >0 |
Cm | Yes | Yes | >0 |
Db | No | No | 1 |
Dd | No | No | n |
Dt | No | No | n |
Dv | Yes | Yes | >0 |
Dx | Yes | Yes | n |
Em | Yes | Yes | >0 |
En | No | No | 0 |
Er | Yes | Yes | >0 |
Es | No | No | 0 |
Ev | Yes | Yes | >0 |
Ex | No | No | n |
Fa | Yes | Yes | >0 |
Fd | No | No | >0 |
Fl | Yes | Yes | n |
Fn | Yes | Yes | >0 |
Fr | No | No | n |
Ft | Yes | Yes | >0 |
Fx | Yes | Yes | n |
Hf | No | No | n |
Ic | Yes | Yes | >0 |
In | No | No | 1 |
Lb | No | No | 1 |
Li | Yes | Yes | >0 |
Lk | Yes | Yes | >0 |
Lp | No | No | 0 |
Ms | Yes | Yes | >0 |
Mt | Yes | Yes | >0 |
Nm | Yes | Yes | n |
No | Yes | Yes | 0 |
Ns | Yes | Yes | 0 |
Nx | Yes | Yes | n |
Os | No | No | n |
Ot | No | No | n |
Ox | Yes | Yes | n |
Pa | Yes | Yes | n |
Pf | Yes | Yes | 1 |
Pp | No | No | 0 |
Rv | No | No | n |
Sm | No | No | 1 |
St | No | Yes | 1 |
Sx | Yes | Yes | >0 |
Sy | Yes | Yes | >0 |
Tn | Yes | Yes | >0 |
Ud | No | No | 0 |
Ux | Yes | Yes | n |
Va | Yes | Yes | n |
Vt | Yes | Yes | >0 |
Xr | Yes | Yes | >0 |
br | No | No | 0 |
sp | No | No | 1 |
For many macros, when the leading arguments are opening delimiters, these delimiters are put before the macro scope, and when the trailing arguments are closing delimiters, these delimiters are put after the macro scope. For example,
.Aq ( [ word ] ) .
renders as:
([<word>]).
Opening delimiters are:
Closing delimiters are:
Note that even a period preceded by a backslash (‘\.') gets this special handling; use ‘\&.' to prevent that.
Many in-line macros interrupt their scope when they encounter delimiters, and resume their scope when more arguments follow that are not delimiters. For example,
.Fl a ( b | c \*(Ba d ) e
renders as:
-a (-b | -c | -d) -e
This applies to both opening and closing delimiters, and also to the middle delimiter:
As a special case, the predefined string \*(Ba is handled and rendered in the same way as a plain ‘|' character. Using this predefined string is not recommended in new manuals.
\f
' font escape sequences is never required.Heirloom troff, the other significant troff implementation accepting -mdoc, is similar to historic groff.
The following problematic behaviour is found in groff:
The following features are unimplemented in mandoc:
January 3, 2012 | NetBSD 6.1 |