man mdoc (Conventions) - mdoc
NAME
macro package
SYNOPSIS
DESCRIPTION
The -mdoc package is a set of content-based and domain-based macros used to format the man pages. The macro names and their meanings are listed below for quick reference; for a detailed explanation on using the package, see the tutorial sampler mdoc.samples(7) .
Note that this is not the usual macro package for Linux documentation, although it is used for documentation of several widely-used programs; see man(7) .
The macros are described in two groups, the first includes the structural and physical page layout macros. The second contains the manual and general text domain macros which differentiate the -mdoc package from other () formatting packages.
PAGE STRUCTURE DOMAIN
Title Macros
To create a valid manual page, these three macros, in this order, are required:
- .Dd Month day, year
- Document date.
- .Dt DOCUMENT_TITLE [section] [volume]
- Title, in upper case.
- .Os OPERATING_SYSTEM [version/release]
- Operating system
Page Layout Macros
Section headers, paragraph breaks, lists and displays.
- .Sh
-
Section Headers.
Valid headers, in the order of presentation:
- NAME
- Name section, should include the or and the macros.
- SYNOPSIS
- Usage.
- DESCRIPTION
- General description, should include options and parameters.
- RETURN VALUES
- Sections two and three function calls.
- ENVIRONMENT
- Describe environment variables.
- FILES
- Files associated with the subject.
- EXAMPLES
- Examples and suggestions.
- DIAGNOSTICS
- Normally used for section four device interface diagnostics.
- ERRORS
- Sections two and three error and signal handling.
- SEE ALSO
- Cross references and citations.
- CONFORMING TO
- Conformance to standards if applicable.
- HISTORY
- If a standard is not applicable, the history of the subject should be given.
- BUGS
- Gotchas and caveats.
- other
- Customized headers may be added at the authors discretion.
- .Ss
- Subsection Headers.
- .Pp
- Paragraph Break. Vertical space (one line).
- .D1
- (D-one) Display-one Indent and display one text line.
- .Dl
- (D-ell) Display-one literal. Indent and display one line of literal text.
- .Bd
-
Begin-display block.
Display options:
- -ragged
- Unjustified (ragged edges).
- -filled
- Justified.
- -literal
- Literal text or code.
- -file name
- Read in named file and display.
- -offset string
-
Offset display.
Acceptable
string
values:
- left
- Align block on left (default).
- center
- Approximate center margin.
- indent
- Six constant width spaces (a tab).
- indent-two
- Two tabs.
- right
- Left aligns block 2 inches from right.
- xx Ns n
- Where xx is a number from to
- Aa
- Where Aa is a callable macro name.
- string
- The width of string is used.
- .Ed
- End-display (matches .Bd).
- .Bl
-
Begin-list.
Create lists or columns. Options:
- List-types
-
- -bullet Ta Bullet Item List
- -item Ta Unlabeled List
- -enum Ta Enumerated List
- -tag Ta Tag Labeled List
- -diag Ta Diagnostic List
- -hang Ta Hanging Labeled List
- -ohang Ta Overhanging Labeled List
- -inset Ta Inset or Run-on Labeled List
- List-parameters
-
- -offset
- (All lists.) See begin-display above.
- -width
- and -hang lists only.) See
- -compact
- (All lists.) Suppresses blank lines.
- .El
- End-list.
- .It
- List item.
MANUAL AND GENERAL TEXT DOMAIN MACROS
The manual and general text domain macros are special in that most of them are parsed for callable macros for example:
- .Op Fl s Ar file
- Produces [-s file]
In this example, the option enclosure macro is parsed, and calls the callable content macro which operates on the argument and then calls the callable content macro which operates on the argument Some macros may be callable, but are not parsed and vice versa. These macros are indicated in the and columns below.
Unless stated, manual domain macros share a common syntax:
Opening and closing punctuation characters are only recognized as such if they are presented one at a time. The string is not recognized as punctuation and will be output with a leading white space and in what ever font the calling macro uses. The argument list is recognized as three sequential closing punctuation characters and a leading white space is not output between the characters and the previous argument (if any). The special meaning of a punctuation character may be escaped with the string For example the following string,
- .Ar file1 , file2 , file3 ) .
- Produces file1 , file2 , file3 ) .
Manual Domain Macros
- Em Name Parsed Callable Description
- Ad Ta Yes Ta Yes Ta Address. (This macro may be deprecated.)
- An Ta Yes Ta Yes Ta Author name.
- Ar Ta Yes Ta Yes Ta Command line argument.
- Cd Ta No Ta No Ta Configuration declaration (section four only).
- Cm Ta Yes Ta Yes Ta Command line argument modifier.
- Dv Ta Yes Ta Yes Ta Defined variable (source code).
- Er Ta Yes Ta Yes Ta Error number (source code).
- Ev Ta Yes Ta Yes Ta Environment variable.
- Fa Ta Yes Ta Yes Ta Function argument.
- Fd Ta Yes Ta Yes Ta Function declaration.
- Fn Ta Yes Ta Yes Ta Function call (also .Fo and .Fc).
- Ic Ta Yes Ta Yes Ta Interactive command.
- Li Ta Yes Ta Yes Ta Literal text.
- Nm Ta Yes Ta Yes Ta Command name.
- Op Ta Yes Ta Yes Ta Option (also .Oo and .Oc).
- Ot Ta Yes Ta Yes Ta Old style function type (Fortran only).
- Pa Ta Yes Ta Yes Ta Pathname or file name.
- St Ta Yes Ta Yes Ta Standards (-p1003.2, -p1003.1 or -ansiC)
- Va Ta Yes Ta Yes Ta Variable name.
- Vt Ta Yes Ta Yes Ta Variable type (Fortran only).
- Xr Ta Yes Ta Yes Ta Manual Page Cross Reference.
General Text Domain Macros
- Em Name Parsed Callable Description
- %A Ta Yes Ta No Ta Reference author.
- %B Ta Yes Ta Yes Ta Reference book title.
- %C Ta No Ta No Ta Reference place of publishing (city).
- %D Ta No Ta No Ta Reference date.
- %J Ta Yes Ta Yes Ta Reference journal title.
- %N Ta No Ta No Ta Reference issue number.
- %O Ta No Ta No Ta Reference optional information.
- %P Ta No Ta No Ta Reference page number(s).
- %R Ta No Ta No Ta Reference report Name.
- %T Ta Yes Ta Yes Ta Reference article title.
- %V Ta No Ta No Ta Reference volume.
- Ac Ta Yes Ta Yes Ta Angle close quote.
- Ao Ta Yes Ta Yes Ta Angle open quote.
- Ap Ta Yes Ta Yes Ta Apostrophe.
- Aq Ta Yes Ta Yes Ta Angle quote.
- At Ta No Ta No Ta AT&T UNIX
- Bc Ta Yes Ta Yes Ta Bracket close quote.
- Bf Ta No Ta No Ta Begin font mode.
- Bo Ta Yes Ta Yes Ta Bracket open quote.
- Bq Ta Yes Ta Yes Ta Bracket quote.
- Bx Ta Yes Ta Yes Ta Bx .
- Db Ta No Ta No Ta Debug (default is \*qoff\*q)
- Dc Ta Yes Ta Yes Ta Double close quote.
- Do Ta Yes Ta Yes Ta Double open quote.
- Dq Ta Yes Ta Yes Ta Double quote.
- Ec Ta Yes Ta Yes Ta Enclose string close quote.
- Ef Ta No Ta No Ta End font mode.
- Em Ta Yes Ta Yes Ta Emphasis (traditional English).
- Eo Ta Yes Ta Yes Ta Enclose string open quote.
- Fx Ta No Ta No Ta FREEBSD OPERATING SYSTEM
- No Ta Yes Ta Yes Ta Normal text (no-op).
- Ns Ta Yes Ta Yes Ta No space.
- Pc Ta Yes Ta Yes Ta Parenthesis close quote.
- Pf Ta Yes Ta No Ta Prefix string.
- Po Ta Yes Ta Yes Ta Parenthesis open quote.
- Pq Ta Yes Ta Yes Ta Parentheses quote.
- Qc Ta Yes Ta Yes Ta Straight Double close quote.
- Ql Ta Yes Ta Yes Ta Quoted literal.
- Qo Ta Yes Ta Yes Ta Straight Double open quote.
- Qq Ta Yes Ta Yes Ta Straight Double quote.
- Re Ta No Ta No Ta Reference end.
- Rs Ta No Ta No Ta Reference start.
- Rv Ta No Ta No Ta Return values (sections two and three only).
- Sc Ta Yes Ta Yes Ta Single close quote.
- So Ta Yes Ta Yes Ta Single open quote.
- Sq Ta Yes Ta Yes Ta Single quote.
- Sm Ta No Ta No Ta Space mode (default is \*qon\*q)
- Sx Ta Yes Ta Yes Ta Section Cross Reference.
- Sy Ta Yes Ta Yes Ta Symbolic (traditional English).
- Tn Ta Yes Ta Yes Ta Trade or type name (small Caps).
- Ux Ta Yes Ta Yes Ta Ux
- Xc Ta Yes Ta Yes Ta Extend argument list close.
- Xo Ta Yes Ta Yes Ta Extend argument list open.
Macro names ending in quote remaining items on the argument list. Macro names ending in begin a quote which may span more than one line of input and are close quoted with the matching macro name ending in Enclosure macros may be nested and are limited to eight arguments.
Note: the extended argument list macros and the function enclosure macros are irregular. The extended list macros are used when the number of macro arguments would exceed the () limitation of nine arguments.
The macros UR (starting a URI/URL hypertext reference), UE (ending one), and UN (identifying a target for a reference) are also available. See man() for more information on these macros.
CONFIGURATION
For site specific configuration of the macro package, see the file /usr/src/share/tmac/README .
FILES
- tmac.doc
- Manual and general text domain macros.
- tmac.doc-common
- Common structural macros and definitions.
- tmac.doc-nroff
- Site dependent () style file.
- tmac.doc-ditroff
- Site dependent () style file.
- tmac.doc-syms
- Special defines (such as the standards macro).