163024Sbostic.\" Copyright (c) 1991, 1993 263024Sbostic.\" The Regents of the University of California. All rights reserved. 350773Scael.\" 450773Scael.\" %sccs.include.redist.roff% 550773Scael.\" 6*67338Sah.\" @(#)mdoc.7 8.3 (Berkeley) 06/01/94 750773Scael.\" 850773Scael.Dd 950773Scael.Os 1050773Scael.Dt MDOC 7 1150773Scael.Sh NAME 1250773Scael.Nm mdoc 1352582Sbostic.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. 125*67338Sah.ne 1i 12650773Scael.It Fl offset Ar string 12750786ScaelOffset display. 12850786ScaelAcceptable 12950773Scael.Ar string 13050786Scaelvalues: 13150773Scael.Bl -tag -width indent-two -compact 13250773Scael.It Ar left 13350786ScaelAlign block on left (default). 13450773Scael.It Ar center 13550773ScaelApproximate center margin. 13650773Scael.It Ar indent 13750773ScaelSix constant width spaces (a tab). 13850773Scael.It Ar indent-two 13950786ScaelTwo tabs. 14050773Scael.It Ar right 14150786ScaelLeft aligns block 2 inches from 14250786Scaelright. 14350786Scael.It Ar xx Ns Cm n 14450786ScaelWhere 14550786Scael.Ar xx 14650786Scaelis a number from 14750786Scael.No \&4 Ns Cm n 14850786Scaelto 14950786Scael.No \&9\&9 Ns Cm n . 15050786Scael.It Ar Aa 15150786ScaelWhere 15250786Scael.Ar Aa 15350786Scaelis a callable macro name. 15450786Scael.It Ar string 15550786ScaelThe width of 15650786Scael.Ar string 15750786Scaelis used. 15850773Scael.El 15950773Scael.El 16050786Scael.It Li \&.Ed 16150773ScaelEnd-display (matches \&.Bd). 16250786Scael.It Li \&.Bl 16350773ScaelBegin-list. 16450786ScaelCreate lists or columns. Options: 16550773Scael.Bl -tag -width flag -compact 16650773Scael.It Ar List-types 16750773Scael.Bl -column xbullet -compact 16850773Scael.It Fl bullet Ta "Bullet Item List" 16950786Scael.It Fl item Ta "Unlabeled List" 17050773Scael.It Fl enum Ta "Enumerated List" 17150773Scael.It Fl tag Ta "Tag Labeled List" 17250773Scael.It Fl diag Ta "Diagnostic List" 17350773Scael.It Fl hang Ta "Hanging Labeled List" 17450773Scael.It Fl ohang Ta "Overhanging Labeled List" 17550773Scael.It Fl inset Ta "Inset or Run-on Labeled List" 17650773Scael.El 17750773Scael.It List-parameters 17850786Scael.Bl -tag -width "xcompact " -compact 17950786Scael.It Fl offset 18050786Scael(All lists.) See 18150786Scael.Ql \&.Bd 18250786Scaelbegin-display above. 18350786Scael.It Fl width 18450773Scael.Pf ( Fl tag 18550773Scaeland 18650773Scael.Fl hang 18750773Scaellists only.) 18850786ScaelSee 18950786Scael.Ql \&.Bd . 19050773Scael.It Fl compact 19150773Scael(All lists.) 19250786ScaelSuppresses blank lines. 19350786Scael.El 19450786Scael.El 19550786Scael.It Li \&.El 19650773ScaelEnd-list. 19750786Scael.It Li \&.It 19850773ScaelList item. 19950773Scael.El 20050773Scael.Sh MANUAL AND GENERAL TEXT DOMAIN MACROS 20150773ScaelThe manual and general text domain macros are special in that 20250773Scaelmost of them are parsed for callable macros 20350773Scaelfor example: 20450786Scael.Bl -tag -width ".Op Fl s Ar filex" -offset indent 20550786Scael.It Li "\&.Op Fl s Ar file" 20650786ScaelProduces 20750786Scael.Op Fl s Ar file 20850786Scael.El 20950773Scael.Pp 21050773ScaelIn this example, the option enclosure macro 21150773Scael.Ql \&.Op 21250773Scaelis parsed, and calls the callable content macro 21350773Scael.Ql \&Fl 21450773Scaelwhich operates on the argument 21550773Scael.Ql s 21650773Scaeland then calls the callable content macro 21750773Scael.Ql \&Ar 21850773Scaelwhich operates on the argument 21950773Scael.Ql file . 22050773ScaelSome macros may be callable, but are not parsed and vice versa. 22150773ScaelThese macros are indicated in the 22250773Scael.Em parsed 22350773Scaeland 22450786Scael.Em callable 22550786Scaelcolumns below. 22650773Scael.Pp 22750786ScaelUnless stated, manual domain macros share a common syntax: 22850773Scael.Pp 22950773Scael.Dl \&.Va argument [\ .\ ,\ ;\ :\ (\ )\ [\ ]\ argument \...\ ] 23050773Scael.Pp 23150773Scael.Sy Note : 23250773ScaelOpening and closing 23350773Scaelpunctuation characters are only recognized as such if they are presented 23450773Scaelone at a time. 23550773ScaelThe string 23650773Scael.Ql ")," 23750773Scaelis not recognized as punctuation and will be output with a leading white 23850773Scaelspace and in what ever font the calling macro uses. 23950773ScaelThe 24065229Smckusickargument list 24150773Scael.Ql "] ) ," 24250773Scaelis recognized as three sequential closing punctuation characters 24350773Scaeland a leading white space is not output between the characters 24450773Scaeland the previous argument (if any). 24550773ScaelThe special meaning of a punctuation character may be escaped 24650773Scaelwith the string 24750773Scael.Ql \e& . 24850773ScaelFor example the following string, 24950786Scael.Bl -tag -width "&.Ar file1\ , file2\ , file3\ )\ ." -offset indent 25050786Scael.It Li "\&.Ar file1\ , file2\ , file3\ )\ ." 25150773ScaelProduces 25250786Scael.Ar file1 , file2 , file3 ) . 25350786Scael.El 25450786Scael.ne 1i 25550773Scael.Ss Manual Domain Macros 25650786Scael.Bl -column "Name" "Parsed" Callable" -compact 25750773Scael.It Em Name Parsed Callable Description 25850786Scael.It Li \&Ad Ta Yes Ta Yes Ta Address. "(This macro may be deprecated.)" 25950786Scael.It Li \&Ar Ta Yes Ta Yes Ta "Command line argument." 26050786Scael.It Li \&Cd Ta \&No Ta \&No Ta "Configuration declaration (section four only)." 26150786Scael.It Li \&Cm Ta Yes Ta Yes Ta "Command line argument modifier." 26250786Scael.It Li \&Dv Ta Yes Ta Yes Ta "Defined variable (source code)." 26350786Scael.It Li \&Er Ta Yes Ta Yes Ta "Error number (source code)." 26450786Scael.It Li \&Ev Ta Yes Ta Yes Ta "Environment variable." 26550786Scael.It Li \&Fa Ta Yes Ta Yes Ta "Function argument." 26650786Scael.It Li \&Fd Ta Yes Ta Yes Ta "Function declaration." 26750786Scael.It Li \&Fn Ta Yes Ta Yes Ta "Function call (also .Fo and .Fc)." 26850786Scael.It Li \&Ic Ta Yes Ta Yes Ta "Interactive command." 26950786Scael.It Li \&Li Ta Yes Ta Yes Ta "Literal text." 27050786Scael.It Li \&Nm Ta Yes Ta Yes Ta "Command name." 27150786Scael.It Li \&Op Ta Yes Ta Yes Ta "Option (also .Oo and .Oc)." 27250786Scael.It Li \&Ot Ta Yes Ta Yes Ta "Old style function type (Fortran only)." 27350786Scael.It Li \&Pa Ta Yes Ta Yes Ta "Pathname or file name." 27450786Scael.It Li \&St Ta Yes Ta Yes Ta "Standards (-p1003.2, -p1003.1 or -ansiC)" 27550786Scael.It Li \&Va Ta Yes Ta Yes Ta "Variable name." 27650786Scael.It Li \&Vt Ta Yes Ta Yes Ta "Variable type (Fortran only)." 27750786Scael.It Li \&Xr Ta Yes Ta Yes Ta "Manual Page Cross Reference." 27850773Scael.El 27950773Scael.Ss General Text Domain Macros 28050786Scael.Bl -column "Name" "Parsed" Callable" -compact 28150773Scael.It Em "Name Parsed Callable Description" 28250786Scael.It Li \&%A Ta Yes Ta \&No Ta "Reference author." 28350786Scael.It Li \&%B Ta Yes Ta Yes Ta "Reference book title." 28450786Scael.It Li \&%\&C Ta \&No Ta \&No Ta "Reference place of publishing (city)." 28550786Scael.It Li \&%\&D Ta \&No Ta \&No Ta "Reference date." 28650786Scael.It Li \&%J Ta Yes Ta Yes Ta "Reference journal title." 28750786Scael.It Li \&%N Ta \&No Ta \&No Ta "Reference issue number." 28850786Scael.It Li \&%\&O Ta \&No Ta \&No Ta "Reference optional information." 28950786Scael.It Li \&%P Ta \&No Ta \&No Ta "Reference page number(s)." 29050786Scael.It Li \&%R Ta \&No Ta \&No Ta "Reference report Name." 29150786Scael.It Li \&%T Ta Yes Ta Yes Ta "Reference article title." 29250786Scael.It Li \&%V Ta \&No Ta \&No Ta "Reference volume." 29350786Scael.It Li \&Ac Ta Yes Ta Yes Ta "Angle close quote." 29450786Scael.It Li \&Ao Ta Yes Ta Yes Ta "Angle open quote." 29550786Scael.It Li \&Aq Ta Yes Ta Yes Ta "Angle quote." 29650786Scael.It Li \&At Ta \&No Ta \&No Ta Tn "AT&T UNIX" 29750786Scael.It Li \&Bc Ta Yes Ta Yes Ta "Bracket close quote." 29850786Scael.It Li \&Bf Ta \&No Ta \&No Ta "Begin font mode." 29950786Scael.It Li \&Bo Ta Yes Ta Yes Ta "Bracket open quote." 30050786Scael.It Li \&Bq Ta Yes Ta Yes Ta "Bracket quote." 30150786Scael.It Li \&Bx Ta Yes Ta Yes Ta Bx . 30250786Scael.It Li \&Db Ta \&No Ta \&No Ta "Debug (default is \\*qoff\\*q)" 30350786Scael.It Li \&Dc Ta Yes Ta Yes Ta "Double close quote." 30450786Scael.It Li \&Do Ta Yes Ta Yes Ta "Double open quote." 30550786Scael.It Li \&Dq Ta Yes Ta Yes Ta "Double quote." 30650786Scael.It Li \&Ec Ta Yes Ta Yes Ta "Enclose string close quote." 30750786Scael.It Li \&Ef Ta \&No Ta \&No Ta "End font mode." 30850786Scael.It Li \&Em Ta Yes Ta Yes Ta "Emphasis (traditional English)." 30950786Scael.It Li \&Eo Ta Yes Ta Yes Ta "Enclose string open quote." 31050786Scael.It Li \&No Ta Yes Ta Yes Ta "Normal text (no-op)." 31150786Scael.It Li \&Ns Ta Yes Ta Yes Ta "No space." 31250786Scael.It Li \&Pc Ta Yes Ta Yes Ta "Parenthesis close quote." 31350786Scael.It Li \&Pf Ta Yes Ta \&No Ta "Prefix string." 31450786Scael.It Li \&Po Ta Yes Ta Yes Ta "Parenthesis open quote." 31550786Scael.It Li \&Pq Ta Yes Ta Yes Ta "Parentheses quote." 31650786Scael.It Li \&Qc Ta Yes Ta Yes Ta "Strait Double close quote." 31750786Scael.It Li \&Ql Ta Yes Ta Yes Ta "Quoted literal." 31850786Scael.It Li \&Qo Ta Yes Ta Yes Ta "Strait Double open quote." 31950786Scael.It Li \&Qq Ta Yes Ta Yes Ta "Strait Double quote." 32050786Scael.It Li \&Re Ta \&No Ta \&No Ta "Reference start." 32150786Scael.It Li \&Rs Ta \&No Ta \&No Ta "Reference start." 32250786Scael.It Li \&Sc Ta Yes Ta Yes Ta "Single close quote." 32350786Scael.It Li \&So Ta Yes Ta Yes Ta "Single open quote." 32450786Scael.It Li \&Sq Ta Yes Ta Yes Ta "Single quote." 32550786Scael.It Li \&Sm Ta \&No Ta \&No Ta "Space mode (default is \\*qon\\*q)" 32650786Scael.It Li \&Sx Ta Yes Ta Yes Ta "Section Cross Reference." 32750786Scael.It Li \&Sy Ta Yes Ta Yes Ta "Symbolic (traditional English)." 32850786Scael.It Li \&Tn Ta Yes Ta Yes Ta "Trade or type name (small Caps)." 32950786Scael.It Li \&Ux Ta Yes Ta Yes Ta Ux 33050786Scael.It Li \&Xc Ta Yes Ta Yes Ta "Extend argument list close." 33150786Scael.It Li \&Xo Ta Yes Ta Yes Ta "Extend argument list close." 33250773Scael.El 33350773Scael.\" .It Sy \&Hf Ta \&No Ta \&No Ta "Include file with header" 33450773Scael.Pp 33550773ScaelMacro names ending in 33650773Scael.Ql q 33750773Scaelquote remaining items on the argument list. 33850773ScaelMacro names ending in 33950773Scael.Ql o 34050773Scaelbegin a quote which may span more than one line of input and 34150773Scaelare close quoted with the matching macro name ending in 34250773Scael.Ql c . 34350786ScaelEnclosure macros may be nested and are limited to 34450786Scaeleight arguments. 34550773Scael.Pp 34650773ScaelNote: the extended argument list macros 34750773Scael.Pf ( Ql \&.Xo , 34850773Scael.Ql \&.Xc ) 34950773Scaeland the function enclosure macros 35050773Scael.Pf ( Ql \&.Fo , 35150773Scael.Ql \&.Fc ) 35250773Scaelare irregular. 35350773ScaelThe extended list macros are used when the number of macro arguments 35450773Scaelwould exceed the 35550773Scael.Xr troff 35650773Scaellimitation of nine arguments. 35750773Scael.Sh CONFIGURATION 35850773ScaelFor site specific configuration of the macro package, 35950773Scaelsee the file 36050773Scael.Pa /usr/src/share/tmac/README . 36150773Scael.Sh FILES 36250773Scael.Bl -tag -width "tmac.doc-ditroff" -compact 36350773Scael.It Pa tmac.doc 36450773ScaelManual and general text domain macros. 36550773Scael.It Pa tmac.doc-common 36650786ScaelCommon structural macros and definitions. 36750773Scael.It Pa tmac.doc-nroff 36850786ScaelSite dependent 36950786Scael.Xr nroff 37050786Scaelstyle file. 37150773Scael.It Pa tmac.doc-ditroff 37250786ScaelSite dependent 37350786Scael.Xr troff 37450786Scaelstyle file. 37550773Scael.It Pa tmac.doc-syms 37650773ScaelSpecial defines (such as the standards macro). 37750773Scael.El 37850773Scael.Sh SEE ALSO 37950773Scael.Xr mdoc.samples 7 380