xref: /csrg-svn/share/man/man7/mdoc.7 (revision 52582)
150773Scael.\" Copyright (c) 1991 The Regents of the University of California.
250773Scael.\" All rights reserved.
350773Scael.\"
450773Scael.\" %sccs.include.redist.roff%
550773Scael.\"
6*52582Sbostic.\"	@(#)mdoc.7	5.1 (Berkeley) 02/19/92
750773Scael.\"
850773Scael.Dd
950773Scael.Os
1050773Scael.Dt MDOC 7
1150773Scael.Sh NAME
1250773Scael.Nm mdoc
13*52582Sbostic.Nd quick reference guide for the
1450773Scael.Nm \-mdoc
1550773Scaelmacro package
1650773Scael.Sh SYNOPSIS
1750773Scael.Nm groff
1850773Scael.Fl m Ns Ar doc
1950773Scael.Ar files ...
2050773Scael.Sh DESCRIPTION
2150773ScaelThe
2250773Scael.Nm \-mdoc
2350786Scaelpackage is a set of content-based and domain-based macros
2450773Scaelused to format the
2550773Scael.Bx
2650773Scaelman pages.
2750773ScaelThe macro names and their meanings are
2850773Scaellisted below for quick reference; for
2950773Scaela detailed explanation on using the package,
3050773Scaelsee the tutorial sampler
3150773Scael.Xr mdoc.samples 7 .
3250773Scael.Pp
3350786ScaelThe macros are described in two groups, the first
3450786Scaelincludes the structural and physical page layout macros.
3550786ScaelThe second contains the manual and general text domain
3650786Scaelmacros which differentiate the
3750773Scael.Nm -\mdoc
3850773Scaelpackage from other
3950773Scael.Xr troff
4050773Scaelformatting packages.
4150786Scael.Sh PAGE STRUCTURE DOMAIN
4250773Scael.Ss Title Macros
4350786ScaelTo create a valid manual page, these three macros, in this order,
4450786Scaelare required:
4550786Scael.Bl -tag -width "xxxx.Os OPERATINGxSYSTEM [version/release]" -compact
4650786Scael.It Li "\&.Dd  " Ar "Month day, year"
4750773ScaelDocument date.
4850786Scael.It Li "\&.Dt  " Ar "DOCUMENT_TITLE [section] [volume]"
4950773ScaelTitle, in upper case.
5050786Scael.It Li "\&.Os  " Ar "OPERATING_SYSTEM [version/release]"
5150773ScaelOperating system
5250773Scael.Pq Tn BSD .
5350773Scael.El
5450773Scael.Ss Page Layout Macros
5550786ScaelSection headers, paragraph breaks, lists and displays.
5650773Scael.Bl -tag -width flag -compact
5750786Scael.It Li \&.Sh
5850786ScaelSection Headers.
5950773ScaelValid headers, in the order of presentation:
6050773Scael.Bl -tag -width "RETURN VALUES" -compact
6150773Scael.It Ar NAME
6250773ScaelName section, should include the
6350773Scael.Ql \&.Nm
6450773Scaelor
6550773Scael.Ql \&.Fn
6650773Scaeland the
6750773Scael.Ql \&.Nd
6850773Scaelmacros.
6950773Scael.It Ar SYNOPSIS
7050773ScaelUsage.
7150773Scael.It Ar DESCRIPTION
7250773ScaelGeneral description, should include
7350773Scaeloptions and parameters.
7450773Scael.It Ar RETURN VALUES
7550773ScaelSections two and three function calls.
7650773Scael.It Ar ENVIRONMENT
7750773ScaelDescribe environment variables.
7850773Scael.It Ar FILES
7950773ScaelFiles associated with the subject.
8050773Scael.It Ar EXAMPLES
8150773ScaelExamples and suggestions.
8250773Scael.It Ar DIAGNOSTICS
8350773ScaelNormally used for section four device interface diagnostics.
8450773Scael.It Ar ERRORS
8550773ScaelSections two and three error and signal
8650773Scaelhandling.
8750773Scael.It Ar SEE ALSO
8850773ScaelCross references and citations.
8950773Scael.It Ar STANDARDS
9050773ScaelConformance to standards if applicable.
9150773Scael.It Ar HISTORY
9250773ScaelIf a standard is not applicable, the history
9350773Scaelof the subject should be given.
9450773Scael.It Ar BUGS
9550773ScaelGotchas and caveats.
9650773Scael.It Ar other
9750773ScaelCustomized headers may be added at
9850773Scaelthe authors discretion.
9950773Scael.El
10050786Scael.It Li \&.Ss
10150773ScaelSubsection Headers.
10250786Scael.It Li \&.Pp
10350773ScaelParagraph Break.
10450773ScaelVertical space (one line).
10550786Scael.It Li \&.D1
10650773Scael(D-one) Display-one
10750773ScaelIndent and display one text line.
10850786Scael.It Li \&.Dl
10950773Scael(D-ell) Display-one literal.
11050773ScaelIndent and display one line of literal text.
11150786Scael.It Li \&.Bd
11250786ScaelBegin-display block.
11350773ScaelDisplay options:
11450786Scael.Bl -tag -width "xoffset string " -compact
11550773Scael.It Fl ragged
11650773ScaelUnjustified (ragged edges).
11750773Scael.It Fl filled
11850773ScaelJustified.
11950773Scael.It Fl literal
12050773ScaelLiteral text or code.
12150773Scael.It Fl file Ar name
12250773ScaelRead in named
12350773Scael.Ar file
12450773Scaeland display.
12550773Scael.It Fl offset Ar string
12650786ScaelOffset display.
12750786ScaelAcceptable
12850773Scael.Ar string
12950786Scaelvalues:
13050773Scael.Bl -tag -width indent-two -compact
13150773Scael.It Ar left
13250786ScaelAlign block on left (default).
13350773Scael.It Ar center
13450773ScaelApproximate center margin.
13550773Scael.It Ar indent
13650773ScaelSix constant width spaces (a tab).
13750773Scael.It Ar indent-two
13850786ScaelTwo tabs.
13950773Scael.It Ar right
14050786ScaelLeft aligns block 2 inches from
14150786Scaelright.
14250786Scael.It Ar xx Ns Cm n
14350786ScaelWhere
14450786Scael.Ar xx
14550786Scaelis a number from
14650786Scael.No \&4 Ns Cm n
14750786Scaelto
14850786Scael.No \&9\&9 Ns Cm n .
14950786Scael.It Ar Aa
15050786ScaelWhere
15150786Scael.Ar Aa
15250786Scaelis a callable macro name.
15350786Scael.It Ar string
15450786ScaelThe width of
15550786Scael.Ar string
15650786Scaelis used.
15750773Scael.El
15850773Scael.El
15950786Scael.It Li \&.Ed
16050773ScaelEnd-display (matches \&.Bd).
16150786Scael.It Li \&.Bl
16250773ScaelBegin-list.
16350786ScaelCreate lists or columns. Options:
16450773Scael.Bl -tag -width flag -compact
16550773Scael.It Ar List-types
16650773Scael.Bl -column xbullet -compact
16750773Scael.It Fl bullet Ta "Bullet Item List"
16850786Scael.It Fl item Ta "Unlabeled List"
16950773Scael.It Fl enum Ta "Enumerated List"
17050773Scael.It Fl tag Ta "Tag Labeled List"
17150773Scael.It Fl diag Ta "Diagnostic List"
17250773Scael.It Fl hang Ta "Hanging Labeled List"
17350773Scael.It Fl ohang Ta "Overhanging Labeled List"
17450773Scael.It Fl inset Ta "Inset or Run-on Labeled List"
17550773Scael.El
17650773Scael.It List-parameters
17750786Scael.Bl -tag -width "xcompact " -compact
17850786Scael.It Fl offset
17950786Scael(All lists.) See
18050786Scael.Ql \&.Bd
18150786Scaelbegin-display above.
18250786Scael.It Fl width
18350773Scael.Pf ( Fl tag
18450773Scaeland
18550773Scael.Fl hang
18650773Scaellists only.)
18750786ScaelSee
18850786Scael.Ql \&.Bd .
18950773Scael.It Fl compact
19050773Scael(All lists.)
19150786ScaelSuppresses blank lines.
19250786Scael.El
19350786Scael.El
19450786Scael.It Li \&.El
19550773ScaelEnd-list.
19650786Scael.It Li \&.It
19750773ScaelList item.
19850773Scael.El
19950773Scael.Sh MANUAL AND GENERAL TEXT DOMAIN MACROS
20050773ScaelThe manual and general text domain macros are special in that
20150773Scaelmost of them are parsed for callable macros
20250773Scaelfor example:
20350786Scael.Bl -tag -width ".Op Fl s Ar filex" -offset indent
20450786Scael.It Li "\&.Op Fl s Ar file"
20550786ScaelProduces
20650786Scael.Op Fl s Ar file
20750786Scael.El
20850773Scael.Pp
20950773ScaelIn this example, the option enclosure macro
21050773Scael.Ql \&.Op
21150773Scaelis parsed, and calls the callable content macro
21250773Scael.Ql \&Fl
21350773Scaelwhich operates on the argument
21450773Scael.Ql s
21550773Scaeland then calls the callable content macro
21650773Scael.Ql \&Ar
21750773Scaelwhich operates on the argument
21850773Scael.Ql file .
21950773ScaelSome macros may be callable, but are not parsed and vice versa.
22050773ScaelThese macros are indicated in the
22150773Scael.Em parsed
22250773Scaeland
22350786Scael.Em callable
22450786Scaelcolumns below.
22550773Scael.Pp
22650786ScaelUnless stated, manual domain macros share a common syntax:
22750773Scael.Pp
22850773Scael.Dl \&.Va argument [\ .\ ,\ ;\ :\ (\ )\ [\ ]\ argument \...\ ]
22950773Scael.Pp
23050773Scael.Sy Note :
23150773ScaelOpening and closing
23250773Scaelpunctuation characters are only recognized as such if they are presented
23350773Scaelone at a time.
23450773ScaelThe string
23550773Scael.Ql "),"
23650773Scaelis not recognized as punctuation and will be output with a leading white
23750773Scaelspace and in what ever font the calling macro uses.
23850773ScaelThe
23950773Scaelthe argument list
24050773Scael.Ql "] ) ,"
24150773Scaelis recognized as three sequential closing punctuation characters
24250773Scaeland a leading white space is not output between the characters
24350773Scaeland the previous argument (if any).
24450773ScaelThe special meaning of a punctuation character may be escaped
24550773Scaelwith the string
24650773Scael.Ql \e& .
24750773ScaelFor example the following string,
24850786Scael.Bl -tag -width "&.Ar file1\ , file2\ , file3\ )\ ." -offset indent
24950786Scael.It Li "\&.Ar file1\ , file2\ , file3\ )\ ."
25050773ScaelProduces
25150786Scael.Ar file1 , file2 , file3 ) .
25250786Scael.El
25350786Scael.ne 1i
25450773Scael.Ss Manual Domain Macros
25550786Scael.Bl -column "Name" "Parsed" Callable" -compact
25650773Scael.It Em Name	Parsed	Callable	Description
25750786Scael.It Li \&Ad Ta Yes Ta Yes Ta Address. "(This macro may be deprecated.)"
25850786Scael.It Li \&Ar Ta Yes Ta Yes Ta "Command line argument."
25950786Scael.It Li \&Cd Ta \&No Ta \&No Ta "Configuration declaration (section four only)."
26050786Scael.It Li \&Cm Ta Yes Ta Yes Ta "Command line argument modifier."
26150786Scael.It Li \&Dv Ta Yes Ta Yes Ta "Defined variable (source code)."
26250786Scael.It Li \&Er Ta Yes Ta Yes Ta "Error number (source code)."
26350786Scael.It Li \&Ev Ta Yes Ta Yes Ta "Environment variable."
26450786Scael.It Li \&Fa Ta Yes Ta Yes Ta "Function argument."
26550786Scael.It Li \&Fd Ta Yes Ta Yes Ta "Function declaration."
26650786Scael.It Li \&Fn Ta Yes Ta Yes Ta "Function call (also .Fo and .Fc)."
26750786Scael.It Li \&Ic Ta Yes Ta Yes Ta "Interactive command."
26850786Scael.It Li \&Li Ta Yes Ta Yes Ta "Literal text."
26950786Scael.It Li \&Nm Ta Yes Ta Yes Ta "Command name."
27050786Scael.It Li \&Op Ta Yes Ta Yes Ta "Option (also .Oo and .Oc)."
27150786Scael.It Li \&Ot Ta Yes Ta Yes Ta "Old style function type (Fortran only)."
27250786Scael.It Li \&Pa Ta Yes Ta Yes Ta "Pathname or file name."
27350786Scael.It Li \&St Ta Yes Ta Yes Ta "Standards (-p1003.2, -p1003.1 or -ansiC)"
27450786Scael.It Li \&Va Ta Yes Ta Yes Ta "Variable name."
27550786Scael.It Li \&Vt Ta Yes Ta Yes Ta "Variable type (Fortran only)."
27650786Scael.It Li \&Xr Ta Yes Ta Yes Ta "Manual Page Cross Reference."
27750773Scael.El
27850773Scael.Ss General Text Domain Macros
27950786Scael.Bl -column "Name" "Parsed" Callable" -compact
28050773Scael.It Em "Name	Parsed	Callable	Description"
28150786Scael.It Li \&%A Ta Yes Ta \&No Ta "Reference author."
28250786Scael.It Li \&%B Ta Yes Ta Yes Ta "Reference book title."
28350786Scael.It Li \&%\&C Ta \&No Ta \&No Ta "Reference place of publishing (city)."
28450786Scael.It Li \&%\&D Ta \&No Ta \&No Ta "Reference date."
28550786Scael.It Li \&%J Ta Yes Ta Yes Ta "Reference journal title."
28650786Scael.It Li \&%N Ta \&No Ta \&No Ta "Reference issue number."
28750786Scael.It Li \&%\&O Ta \&No Ta \&No Ta "Reference optional information."
28850786Scael.It Li \&%P Ta \&No Ta \&No Ta "Reference page number(s)."
28950786Scael.It Li \&%R Ta \&No Ta \&No Ta "Reference report Name."
29050786Scael.It Li \&%T Ta Yes Ta Yes Ta "Reference article title."
29150786Scael.It Li \&%V Ta \&No Ta \&No Ta "Reference volume."
29250786Scael.It Li \&Ac Ta Yes Ta Yes Ta "Angle close quote."
29350786Scael.It Li \&Ao Ta Yes Ta Yes Ta "Angle open quote."
29450786Scael.It Li \&Aq Ta Yes Ta Yes Ta "Angle quote."
29550786Scael.It Li \&At Ta \&No Ta \&No Ta Tn "AT&T UNIX"
29650786Scael.It Li \&Bc Ta Yes Ta Yes Ta "Bracket close quote."
29750786Scael.It Li \&Bf Ta \&No Ta \&No Ta "Begin font mode."
29850786Scael.It Li \&Bo Ta Yes Ta Yes Ta "Bracket open quote."
29950786Scael.It Li \&Bq Ta Yes Ta Yes Ta "Bracket quote."
30050786Scael.It Li \&Bx Ta Yes Ta Yes Ta Bx .
30150786Scael.It Li \&Db Ta \&No Ta \&No Ta "Debug (default is \\*qoff\\*q)"
30250786Scael.It Li \&Dc Ta Yes Ta Yes Ta "Double close quote."
30350786Scael.It Li \&Do Ta Yes Ta Yes Ta "Double open quote."
30450786Scael.It Li \&Dq Ta Yes Ta Yes Ta "Double quote."
30550786Scael.It Li \&Ec Ta Yes Ta Yes Ta "Enclose string close quote."
30650786Scael.It Li \&Ef Ta \&No Ta \&No Ta "End font mode."
30750786Scael.It Li \&Em Ta Yes Ta Yes Ta "Emphasis (traditional English)."
30850786Scael.It Li \&Eo Ta Yes Ta Yes Ta "Enclose string open quote."
30950786Scael.It Li \&No Ta Yes Ta Yes Ta "Normal text (no-op)."
31050786Scael.It Li \&Ns Ta Yes Ta Yes Ta "No space."
31150786Scael.It Li \&Pc Ta Yes Ta Yes Ta "Parenthesis close quote."
31250786Scael.It Li \&Pf Ta Yes Ta \&No Ta "Prefix string."
31350786Scael.It Li \&Po Ta Yes Ta Yes Ta "Parenthesis open quote."
31450786Scael.It Li \&Pq Ta Yes Ta Yes Ta "Parentheses quote."
31550786Scael.It Li \&Qc Ta Yes Ta Yes Ta "Strait Double close quote."
31650786Scael.It Li \&Ql Ta Yes Ta Yes Ta "Quoted literal."
31750786Scael.It Li \&Qo Ta Yes Ta Yes Ta "Strait Double open quote."
31850786Scael.It Li \&Qq Ta Yes Ta Yes Ta "Strait Double quote."
31950786Scael.It Li \&Re Ta \&No Ta \&No Ta "Reference start."
32050786Scael.It Li \&Rs Ta \&No Ta \&No Ta "Reference start."
32150786Scael.It Li \&Sc Ta Yes Ta Yes Ta "Single close quote."
32250786Scael.It Li \&So Ta Yes Ta Yes Ta "Single open quote."
32350786Scael.It Li \&Sq Ta Yes Ta Yes Ta "Single quote."
32450786Scael.It Li \&Sm Ta \&No Ta \&No Ta "Space mode (default is \\*qon\\*q)"
32550786Scael.It Li \&Sx Ta Yes Ta Yes Ta "Section Cross Reference."
32650786Scael.It Li \&Sy Ta Yes Ta Yes Ta "Symbolic (traditional English)."
32750786Scael.It Li \&Tn Ta Yes Ta Yes Ta "Trade or type name (small Caps)."
32850786Scael.It Li \&Ux Ta Yes Ta Yes Ta Ux
32950786Scael.It Li \&Xc Ta Yes Ta Yes Ta "Extend argument list close."
33050786Scael.It Li \&Xo Ta Yes Ta Yes Ta "Extend argument list close."
33150773Scael.El
33250773Scael.\" .It Sy \&Hf Ta \&No Ta \&No Ta "Include file with header"
33350773Scael.Pp
33450773ScaelMacro names ending in
33550773Scael.Ql q
33650773Scaelquote remaining items on the argument list.
33750773ScaelMacro names ending in
33850773Scael.Ql o
33950773Scaelbegin a quote which may span more than one line of input and
34050773Scaelare close quoted with the matching macro name ending in
34150773Scael.Ql c .
34250786ScaelEnclosure macros may be nested and are limited to
34350786Scaeleight arguments.
34450773Scael.Pp
34550773ScaelNote: the extended argument list macros
34650773Scael.Pf ( Ql \&.Xo ,
34750773Scael.Ql \&.Xc )
34850773Scaeland the function enclosure macros
34950773Scael.Pf ( Ql \&.Fo ,
35050773Scael.Ql \&.Fc )
35150773Scaelare irregular.
35250773ScaelThe extended list macros are used when the number of macro arguments
35350773Scaelwould exceed the
35450773Scael.Xr troff
35550773Scaellimitation of nine arguments.
35650773Scael.Sh CONFIGURATION
35750773ScaelFor site specific configuration of the macro package,
35850773Scaelsee the file
35950773Scael.Pa /usr/src/share/tmac/README .
36050773Scael.Sh FILES
36150773Scael.Bl -tag -width "tmac.doc-ditroff" -compact
36250773Scael.It Pa tmac.doc
36350773ScaelManual and general text domain macros.
36450773Scael.It Pa tmac.doc-common
36550786ScaelCommon structural macros and definitions.
36650773Scael.It Pa tmac.doc-nroff
36750786ScaelSite dependent
36850786Scael.Xr nroff
36950786Scaelstyle file.
37050773Scael.It Pa tmac.doc-ditroff
37150786ScaelSite dependent
37250786Scael.Xr troff
37350786Scaelstyle file.
37450773Scael.It Pa tmac.doc-syms
37550773ScaelSpecial defines (such as the standards macro).
37650773Scael.El
37750773Scael.Sh SEE ALSO
37850773Scael.Xr mdoc.samples 7
37950773Scael.Sh HISTORY
38050773ScaelThe
38150773Scael.Nm \-mdoc
38250773Scaelmacro package is
38350773Scael.Ud .
384