150773Scael.\" Copyright (c) 1991 The Regents of the University of California. 250773Scael.\" All rights reserved. 350773Scael.\" 450773Scael.\" %sccs.include.redist.roff% 550773Scael.\" 6*50786Scael.\" @(#)mdoc.7 1.2 (Berkeley) 08/06/91 750773Scael.\" 850773Scael.Dd 950773Scael.Os 1050773Scael.Dt MDOC 7 1150773Scael.Sh NAME 1250773Scael.Nm mdoc 1350773Scael.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 23*50786Scaelpackage 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 33*50786ScaelThe macros are described in two groups, the first 34*50786Scaelincludes the structural and physical page layout macros. 35*50786ScaelThe second contains the manual and general text domain 36*50786Scaelmacros which differentiate the 3750773Scael.Nm -\mdoc 3850773Scaelpackage from other 3950773Scael.Xr troff 4050773Scaelformatting packages. 41*50786Scael.Sh PAGE STRUCTURE DOMAIN 4250773Scael.Ss Title Macros 43*50786ScaelTo create a valid manual page, these three macros, in this order, 44*50786Scaelare required: 45*50786Scael.Bl -tag -width "xxxx.Os OPERATINGxSYSTEM [version/release]" -compact 46*50786Scael.It Li "\&.Dd " Ar "Month day, year" 4750773ScaelDocument date. 48*50786Scael.It Li "\&.Dt " Ar "DOCUMENT_TITLE [section] [volume]" 4950773ScaelTitle, in upper case. 50*50786Scael.It Li "\&.Os " Ar "OPERATING_SYSTEM [version/release]" 5150773ScaelOperating system 5250773Scael.Pq Tn BSD . 5350773Scael.El 5450773Scael.Ss Page Layout Macros 55*50786ScaelSection headers, paragraph breaks, lists and displays. 5650773Scael.Bl -tag -width flag -compact 57*50786Scael.It Li \&.Sh 58*50786ScaelSection 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 100*50786Scael.It Li \&.Ss 10150773ScaelSubsection Headers. 102*50786Scael.It Li \&.Pp 10350773ScaelParagraph Break. 10450773ScaelVertical space (one line). 105*50786Scael.It Li \&.D1 10650773Scael(D-one) Display-one 10750773ScaelIndent and display one text line. 108*50786Scael.It Li \&.Dl 10950773Scael(D-ell) Display-one literal. 11050773ScaelIndent and display one line of literal text. 111*50786Scael.It Li \&.Bd 112*50786ScaelBegin-display block. 11350773ScaelDisplay options: 114*50786Scael.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 126*50786ScaelOffset display. 127*50786ScaelAcceptable 12850773Scael.Ar string 129*50786Scaelvalues: 13050773Scael.Bl -tag -width indent-two -compact 13150773Scael.It Ar left 132*50786ScaelAlign 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 138*50786ScaelTwo tabs. 13950773Scael.It Ar right 140*50786ScaelLeft aligns block 2 inches from 141*50786Scaelright. 142*50786Scael.It Ar xx Ns Cm n 143*50786ScaelWhere 144*50786Scael.Ar xx 145*50786Scaelis a number from 146*50786Scael.No \&4 Ns Cm n 147*50786Scaelto 148*50786Scael.No \&9\&9 Ns Cm n . 149*50786Scael.It Ar Aa 150*50786ScaelWhere 151*50786Scael.Ar Aa 152*50786Scaelis a callable macro name. 153*50786Scael.It Ar string 154*50786ScaelThe width of 155*50786Scael.Ar string 156*50786Scaelis used. 15750773Scael.El 15850773Scael.El 159*50786Scael.It Li \&.Ed 16050773ScaelEnd-display (matches \&.Bd). 161*50786Scael.It Li \&.Bl 16250773ScaelBegin-list. 163*50786ScaelCreate 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" 168*50786Scael.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 177*50786Scael.Bl -tag -width "xcompact " -compact 178*50786Scael.It Fl offset 179*50786Scael(All lists.) See 180*50786Scael.Ql \&.Bd 181*50786Scaelbegin-display above. 182*50786Scael.It Fl width 18350773Scael.Pf ( Fl tag 18450773Scaeland 18550773Scael.Fl hang 18650773Scaellists only.) 187*50786ScaelSee 188*50786Scael.Ql \&.Bd . 18950773Scael.It Fl compact 19050773Scael(All lists.) 191*50786ScaelSuppresses blank lines. 192*50786Scael.El 193*50786Scael.El 194*50786Scael.It Li \&.El 19550773ScaelEnd-list. 196*50786Scael.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: 203*50786Scael.Bl -tag -width ".Op Fl s Ar filex" -offset indent 204*50786Scael.It Li "\&.Op Fl s Ar file" 205*50786ScaelProduces 206*50786Scael.Op Fl s Ar file 207*50786Scael.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 223*50786Scael.Em callable 224*50786Scaelcolumns below. 22550773Scael.Pp 226*50786ScaelUnless 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, 248*50786Scael.Bl -tag -width "&.Ar file1\ , file2\ , file3\ )\ ." -offset indent 249*50786Scael.It Li "\&.Ar file1\ , file2\ , file3\ )\ ." 25050773ScaelProduces 251*50786Scael.Ar file1 , file2 , file3 ) . 252*50786Scael.El 253*50786Scael.ne 1i 25450773Scael.Ss Manual Domain Macros 255*50786Scael.Bl -column "Name" "Parsed" Callable" -compact 25650773Scael.It Em Name Parsed Callable Description 257*50786Scael.It Li \&Ad Ta Yes Ta Yes Ta Address. "(This macro may be deprecated.)" 258*50786Scael.It Li \&Ar Ta Yes Ta Yes Ta "Command line argument." 259*50786Scael.It Li \&Cd Ta \&No Ta \&No Ta "Configuration declaration (section four only)." 260*50786Scael.It Li \&Cm Ta Yes Ta Yes Ta "Command line argument modifier." 261*50786Scael.It Li \&Dv Ta Yes Ta Yes Ta "Defined variable (source code)." 262*50786Scael.It Li \&Er Ta Yes Ta Yes Ta "Error number (source code)." 263*50786Scael.It Li \&Ev Ta Yes Ta Yes Ta "Environment variable." 264*50786Scael.It Li \&Fa Ta Yes Ta Yes Ta "Function argument." 265*50786Scael.It Li \&Fd Ta Yes Ta Yes Ta "Function declaration." 266*50786Scael.It Li \&Fn Ta Yes Ta Yes Ta "Function call (also .Fo and .Fc)." 267*50786Scael.It Li \&Ic Ta Yes Ta Yes Ta "Interactive command." 268*50786Scael.It Li \&Li Ta Yes Ta Yes Ta "Literal text." 269*50786Scael.It Li \&Nm Ta Yes Ta Yes Ta "Command name." 270*50786Scael.It Li \&Op Ta Yes Ta Yes Ta "Option (also .Oo and .Oc)." 271*50786Scael.It Li \&Ot Ta Yes Ta Yes Ta "Old style function type (Fortran only)." 272*50786Scael.It Li \&Pa Ta Yes Ta Yes Ta "Pathname or file name." 273*50786Scael.It Li \&St Ta Yes Ta Yes Ta "Standards (-p1003.2, -p1003.1 or -ansiC)" 274*50786Scael.It Li \&Va Ta Yes Ta Yes Ta "Variable name." 275*50786Scael.It Li \&Vt Ta Yes Ta Yes Ta "Variable type (Fortran only)." 276*50786Scael.It Li \&Xr Ta Yes Ta Yes Ta "Manual Page Cross Reference." 27750773Scael.El 27850773Scael.Ss General Text Domain Macros 279*50786Scael.Bl -column "Name" "Parsed" Callable" -compact 28050773Scael.It Em "Name Parsed Callable Description" 281*50786Scael.It Li \&%A Ta Yes Ta \&No Ta "Reference author." 282*50786Scael.It Li \&%B Ta Yes Ta Yes Ta "Reference book title." 283*50786Scael.It Li \&%\&C Ta \&No Ta \&No Ta "Reference place of publishing (city)." 284*50786Scael.It Li \&%\&D Ta \&No Ta \&No Ta "Reference date." 285*50786Scael.It Li \&%J Ta Yes Ta Yes Ta "Reference journal title." 286*50786Scael.It Li \&%N Ta \&No Ta \&No Ta "Reference issue number." 287*50786Scael.It Li \&%\&O Ta \&No Ta \&No Ta "Reference optional information." 288*50786Scael.It Li \&%P Ta \&No Ta \&No Ta "Reference page number(s)." 289*50786Scael.It Li \&%R Ta \&No Ta \&No Ta "Reference report Name." 290*50786Scael.It Li \&%T Ta Yes Ta Yes Ta "Reference article title." 291*50786Scael.It Li \&%V Ta \&No Ta \&No Ta "Reference volume." 292*50786Scael.It Li \&Ac Ta Yes Ta Yes Ta "Angle close quote." 293*50786Scael.It Li \&Ao Ta Yes Ta Yes Ta "Angle open quote." 294*50786Scael.It Li \&Aq Ta Yes Ta Yes Ta "Angle quote." 295*50786Scael.It Li \&At Ta \&No Ta \&No Ta Tn "AT&T UNIX" 296*50786Scael.It Li \&Bc Ta Yes Ta Yes Ta "Bracket close quote." 297*50786Scael.It Li \&Bf Ta \&No Ta \&No Ta "Begin font mode." 298*50786Scael.It Li \&Bo Ta Yes Ta Yes Ta "Bracket open quote." 299*50786Scael.It Li \&Bq Ta Yes Ta Yes Ta "Bracket quote." 300*50786Scael.It Li \&Bx Ta Yes Ta Yes Ta Bx . 301*50786Scael.It Li \&Db Ta \&No Ta \&No Ta "Debug (default is \\*qoff\\*q)" 302*50786Scael.It Li \&Dc Ta Yes Ta Yes Ta "Double close quote." 303*50786Scael.It Li \&Do Ta Yes Ta Yes Ta "Double open quote." 304*50786Scael.It Li \&Dq Ta Yes Ta Yes Ta "Double quote." 305*50786Scael.It Li \&Ec Ta Yes Ta Yes Ta "Enclose string close quote." 306*50786Scael.It Li \&Ef Ta \&No Ta \&No Ta "End font mode." 307*50786Scael.It Li \&Em Ta Yes Ta Yes Ta "Emphasis (traditional English)." 308*50786Scael.It Li \&Eo Ta Yes Ta Yes Ta "Enclose string open quote." 309*50786Scael.It Li \&No Ta Yes Ta Yes Ta "Normal text (no-op)." 310*50786Scael.It Li \&Ns Ta Yes Ta Yes Ta "No space." 311*50786Scael.It Li \&Pc Ta Yes Ta Yes Ta "Parenthesis close quote." 312*50786Scael.It Li \&Pf Ta Yes Ta \&No Ta "Prefix string." 313*50786Scael.It Li \&Po Ta Yes Ta Yes Ta "Parenthesis open quote." 314*50786Scael.It Li \&Pq Ta Yes Ta Yes Ta "Parentheses quote." 315*50786Scael.It Li \&Qc Ta Yes Ta Yes Ta "Strait Double close quote." 316*50786Scael.It Li \&Ql Ta Yes Ta Yes Ta "Quoted literal." 317*50786Scael.It Li \&Qo Ta Yes Ta Yes Ta "Strait Double open quote." 318*50786Scael.It Li \&Qq Ta Yes Ta Yes Ta "Strait Double quote." 319*50786Scael.It Li \&Re Ta \&No Ta \&No Ta "Reference start." 320*50786Scael.It Li \&Rs Ta \&No Ta \&No Ta "Reference start." 321*50786Scael.It Li \&Sc Ta Yes Ta Yes Ta "Single close quote." 322*50786Scael.It Li \&So Ta Yes Ta Yes Ta "Single open quote." 323*50786Scael.It Li \&Sq Ta Yes Ta Yes Ta "Single quote." 324*50786Scael.It Li \&Sm Ta \&No Ta \&No Ta "Space mode (default is \\*qon\\*q)" 325*50786Scael.It Li \&Sx Ta Yes Ta Yes Ta "Section Cross Reference." 326*50786Scael.It Li \&Sy Ta Yes Ta Yes Ta "Symbolic (traditional English)." 327*50786Scael.It Li \&Tn Ta Yes Ta Yes Ta "Trade or type name (small Caps)." 328*50786Scael.It Li \&Ux Ta Yes Ta Yes Ta Ux 329*50786Scael.It Li \&Xc Ta Yes Ta Yes Ta "Extend argument list close." 330*50786Scael.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 . 342*50786ScaelEnclosure macros may be nested and are limited to 343*50786Scaeleight 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 365*50786ScaelCommon structural macros and definitions. 36650773Scael.It Pa tmac.doc-nroff 367*50786ScaelSite dependent 368*50786Scael.Xr nroff 369*50786Scaelstyle file. 37050773Scael.It Pa tmac.doc-ditroff 371*50786ScaelSite dependent 372*50786Scael.Xr troff 373*50786Scaelstyle 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