Annotation of mandoc/mdoc.7, Revision 1.72
1.72 ! kristaps 1: .\" $Id: mdoc.7,v 1.71 2009/10/31 06:50:25 kristaps Exp $
1.1 kristaps 2: .\"
1.23 kristaps 3: .\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
1.1 kristaps 4: .\"
5: .\" Permission to use, copy, modify, and distribute this software for any
1.22 kristaps 6: .\" purpose with or without fee is hereby granted, provided that the above
7: .\" copyright notice and this permission notice appear in all copies.
1.1 kristaps 8: .\"
1.22 kristaps 9: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13: .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14: .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15: .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1.50 kristaps 16: .\"
1.1 kristaps 17: .Dd $Mdocdate$
1.20 kristaps 18: .Dt MDOC 7
1.1 kristaps 19: .Os
1.56 kristaps 20: .
21: .
1.1 kristaps 22: .Sh NAME
1.57 kristaps 23: .Nm mdoc
24: .Nd mdoc language reference
1.56 kristaps 25: .
26: .
1.1 kristaps 27: .Sh DESCRIPTION
28: The
1.57 kristaps 29: .Nm mdoc
1.50 kristaps 30: language is used to format
1.57 kristaps 31: .Bx
32: .Ux
1.43 kristaps 33: manuals. In this reference document, we describe its syntax, structure,
34: and usage. Our reference implementation is
1.57 kristaps 35: .Xr mandoc 1 .
1.28 kristaps 36: The
1.57 kristaps 37: .Sx COMPATIBILITY
1.50 kristaps 38: section describes compatibility with
1.57 kristaps 39: .Xr groff 1 .
40: .
41: .Pp
1.13 kristaps 42: An
1.57 kristaps 43: .Nm
1.1 kristaps 44: document follows simple rules: lines beginning with the control
1.50 kristaps 45: character
1.57 kristaps 46: .Sq \.
1.1 kristaps 47: are parsed for macros. Other lines are interpreted within the scope of
1.13 kristaps 48: prior macros:
1.57 kristaps 49: .Bd -literal -offset indent
1.13 kristaps 50: \&.Sh Macro lines change control state.
51: Other lines are interpreted within the current state.
1.57 kristaps 52: .Ed
1.56 kristaps 53: .
54: .
1.46 kristaps 55: .Sh LANGUAGE SYNTAX
1.57 kristaps 56: .Nm
1.13 kristaps 57: documents may contain only graphable 7-bit ASCII characters, the space
1.43 kristaps 58: character, and, in certain circumstances, the tab character. All
59: manuals must have
1.57 kristaps 60: .Ux
1.50 kristaps 61: line terminators.
1.56 kristaps 62: .
63: .
1.57 kristaps 64: .Ss Comments
1.43 kristaps 65: Text following a
1.57 kristaps 66: .Sq \e" ,
1.43 kristaps 67: whether in a macro or free-form text line, is ignored to the end of
68: line. A macro line with only a control character and comment escape,
1.57 kristaps 69: .Sq \&.\e" ,
1.58 kristaps 70: is also ignored. Macro lines with only a control charater and optionally
71: whitespace are stripped from input.
1.56 kristaps 72: .
73: .
1.57 kristaps 74: .Ss Reserved Characters
1.2 kristaps 75: Within a macro line, the following characters are reserved:
1.61 kristaps 76: .Pp
1.57 kristaps 77: .Bl -tag -width Ds -offset indent -compact
78: .It \&.
79: .Pq period
80: .It \&,
81: .Pq comma
82: .It \&:
83: .Pq colon
84: .It \&;
85: .Pq semicolon
86: .It \&(
87: .Pq left-parenthesis
88: .It \&)
89: .Pq right-parenthesis
90: .It \&[
91: .Pq left-bracket
92: .It \&]
93: .Pq right-bracket
94: .It \&?
95: .Pq question
96: .It \&!
97: .Pq exclamation
98: .It \&|
99: .Pq vertical bar
100: .El
101: .
102: .Pp
1.5 kristaps 103: Use of reserved characters is described in
1.57 kristaps 104: .Sx MACRO SYNTAX .
1.43 kristaps 105: For general use in macro lines, these characters must either be escaped
106: with a non-breaking space
1.57 kristaps 107: .Pq Sq \e&
1.50 kristaps 108: or, if applicable, an appropriate escape sequence used.
1.56 kristaps 109: .
110: .
1.57 kristaps 111: .Ss Special Characters
1.43 kristaps 112: Special characters may occur in both macro and free-form lines.
113: Sequences begin with the escape character
1.57 kristaps 114: .Sq \e
1.50 kristaps 115: followed by either an open-parenthesis
1.57 kristaps 116: .Sq \&(
1.1 kristaps 117: for two-character sequences; an open-bracket
1.57 kristaps 118: .Sq \&[
1.1 kristaps 119: for n-character sequences (terminated at a close-bracket
1.57 kristaps 120: .Sq \&] ) ;
1.43 kristaps 121: or a single one-character sequence. See
1.57 kristaps 122: .Xr mandoc_char 7
1.50 kristaps 123: for a complete list. Examples include
1.57 kristaps 124: .Sq \e(em
125: .Pq em-dash
1.50 kristaps 126: and
1.57 kristaps 127: .Sq \ee
128: .Pq back-slash .
1.56 kristaps 129: .
130: .
1.57 kristaps 131: .Ss Text Decoration
1.54 kristaps 132: Terms may be text-decorated using the
1.57 kristaps 133: .Sq \ef
1.43 kristaps 134: escape followed by an indicator: B (bold), I, (italic), or P and R
1.54 kristaps 135: (Roman, or reset). This form is not recommended for
1.57 kristaps 136: .Nm ,
1.54 kristaps 137: which encourages semantic, not presentation, annotation.
1.56 kristaps 138: .
139: .
1.57 kristaps 140: .Ss Predefined Strings
1.54 kristaps 141: Historically,
1.57 kristaps 142: .Xr groff 1
1.54 kristaps 143: also defined a set of package-specific
1.57 kristaps 144: .Dq predefined strings ,
1.54 kristaps 145: which, like
1.57 kristaps 146: .Sx Special Characters ,
1.54 kristaps 147: demark special output characters and strings by way of input codes.
148: Predefined strings are escaped with the slash-asterisk,
1.57 kristaps 149: .Sq \e* :
1.54 kristaps 150: single-character
1.57 kristaps 151: .Sq \e*X ,
1.54 kristaps 152: two-character
1.57 kristaps 153: .Sq \e*(XX ,
1.54 kristaps 154: and N-character
1.57 kristaps 155: .Sq \e*[N] .
1.54 kristaps 156: See
1.57 kristaps 157: .Xr mandoc_char 7
1.54 kristaps 158: for a complete list. Examples include
1.57 kristaps 159: .Sq \e*(Am
160: .Pq ampersand
1.54 kristaps 161: and
1.57 kristaps 162: .Sq \e*(Ba
163: .Pq vertical bar .
1.56 kristaps 164: .
165: .
1.57 kristaps 166: .Ss Whitespace
1.46 kristaps 167: In non-literal free-form lines, consecutive blocks of whitespace are
168: pruned from input and added later in the output filter, if applicable:
1.57 kristaps 169: .Bd -literal -offset indent
1.46 kristaps 170: These spaces are pruned from input.
1.50 kristaps 171: \&.Bd \-literal
1.46 kristaps 172: These are not.
173: \&.Ed
1.57 kristaps 174: .Ed
175: .
176: .Pp
1.46 kristaps 177: In macro lines, whitespace delimits arguments and is discarded. If
1.47 kristaps 178: arguments are quoted, whitespace within the quotes is retained.
1.57 kristaps 179: .
180: .Pp
1.46 kristaps 181: Blank lines are only permitted within literal contexts, as are lines
182: containing only whitespace. Tab characters are only acceptable when
1.50 kristaps 183: delimiting
1.57 kristaps 184: .Sq \&Bl \-column
1.46 kristaps 185: or when in a literal context.
1.56 kristaps 186: .
187: .
1.57 kristaps 188: .Ss Quotation
1.46 kristaps 189: Macro arguments may be quoted with a double-quote to group
190: space-delimited terms or to retain blocks of whitespace. A quoted
191: argument begins with a double-quote preceded by whitespace. The next
1.48 kristaps 192: double-quote not pair-wise adjacent to another double-quote terminates
1.50 kristaps 193: the literal, regardless of surrounding whitespace.
1.57 kristaps 194: .
195: .Pp
1.50 kristaps 196: This produces tokens
1.57 kristaps 197: .Sq a" ,
198: .Sq b c ,
199: .Sq de ,
1.47 kristaps 200: and
1.57 kristaps 201: .Sq fg" .
1.47 kristaps 202: Note that any quoted term, be it argument or macro, is indiscriminately
1.50 kristaps 203: considered literal text. Thus, the following produces
1.57 kristaps 204: .Sq \&Em a :
205: .Bd -literal -offset indent
1.47 kristaps 206: \&.Em "Em a"
1.57 kristaps 207: .Ed
208: .
209: .Pp
1.46 kristaps 210: In free-form mode, quotes are regarded as opaque text.
1.56 kristaps 211: .
1.63 kristaps 212: .Ss Dates
1.66 kristaps 213: There are several macros in
214: .Nm
1.72 ! kristaps 215: that require a date argument. The canonical form for dates is the
! 216: American format:
1.66 kristaps 217: .Pp
218: .D1 Cm Month Day , Year
219: .Pp
220: The
221: .Cm Day
222: value is an optionally zero-padded numeral. The
223: .Cm Month
224: value is the full month name. The
225: .Cm Year
226: value is the full four-digit year.
227: .Pp
1.72 ! kristaps 228: Reduced form dates are broken-down canonical form dates:
1.66 kristaps 229: .Pp
1.72 ! kristaps 230: .D1 Cm Month , Year
! 231: .D1 Cm Year
1.66 kristaps 232: .Pp
233: Some examples of valid dates follow:
234: .Pp
235: .D1 "May, 2009" Pq reduced form
236: .D1 "2009" Pq reduced form
237: .D1 "May 20, 2009" Pq canonical form
1.63 kristaps 238: .
1.61 kristaps 239: .Ss Scaling Widths
240: Many macros support scaled widths for their arguments, such as
241: stipulating a two-inch list indentation with the following:
242: .Bd -literal -offset indent
243: \&.Bl -tag -width 2i
244: .Ed
245: .
246: .Pp
247: The syntax for scaled widths is
1.62 kristaps 248: .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
1.61 kristaps 249: where a decimal must be preceded or proceeded by at least one digit.
250: Negative numbers, while accepted, are truncated to zero. The following
251: scaling units are accepted:
252: .Pp
253: .Bl -tag -width Ds -offset indent -compact
254: .It c
255: centimetre
256: .It i
257: inch
258: .It P
259: pica (~1/6 inch)
260: .It p
261: point (~1/72 inch)
262: .It f
263: synonym for
264: .Sq u
265: .It v
266: default vertical span
267: .It m
268: width of rendered
269: .Sq m
270: .Pq em
271: character
272: .It n
273: width of rendered
274: .Sq n
275: .Pq en
276: character
277: .It u
278: default horizontal span
279: .It M
280: mini-em (~1/100 em)
281: .El
282: .Pp
283: Using anything other than
284: .Sq m ,
285: .Sq n ,
286: .Sq u ,
287: or
288: .Sq v
289: is necessarily non-portable across output media. See
290: .Sx COMPATIBILITY .
291: .
1.56 kristaps 292: .
1.43 kristaps 293: .Sh MANUAL STRUCTURE
1.66 kristaps 294: A well-formed
1.57 kristaps 295: .Nm
1.66 kristaps 296: document consists of a document prologue followed by one or more
297: sections.
298: .Pp
299: The prologue, which consists of (in order) the
1.64 kristaps 300: .Sx \&Dd ,
301: .Sx \&Dt ,
1.33 kristaps 302: and
1.66 kristaps 303: .Sx \&Os
304: macros, is required for every document.
305: .Pp
306: The first section (sections are denoted by
307: .Sx \&Sh )
308: must be the NAME section, consisting of at least one
1.64 kristaps 309: .Sx \&Nm
1.50 kristaps 310: followed by
1.66 kristaps 311: .Sx \&Nd .
312: .Pp
313: Following that, convention dictates specifying at least the SYNOPSIS and
314: DESCRIPTION sections, although this varies between manual sections.
315: .Pp
316: The following is a well-formed skeleton
317: .Nm
318: file:
1.57 kristaps 319: .Bd -literal -offset indent
1.43 kristaps 320: \&.Dd $\&Mdocdate$
321: \&.Dt mdoc 7
322: \&.Os
1.58 kristaps 323: \&.
1.43 kristaps 324: \&.Sh NAME
1.58 kristaps 325: \&.Nm foo
326: \&.Nd a description goes here
327: \&.\e\*q The next is for sections 2 & 3 only.
328: \&.\e\*q .Sh LIBRARY
329: \&.
330: \&.Sh SYNOPSIS
331: \&.Nm foo
332: \&.Op Fl options
333: \&.Ar
334: \&.
335: \&.Sh DESCRIPTION
336: The
337: \&.Nm
338: utility processes files ...
1.59 kristaps 339: \&.\e\*q .Sh IMPLEMENTATION NOTES
1.58 kristaps 340: \&.\e\*q The next is for sections 1 & 8 only.
341: \&.\e\*q .Sh EXIT STATUS
342: \&.\e\*q The next is for sections 2, 3, & 9 only.
343: \&.\e\*q .Sh RETURN VALUES
344: \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
345: \&.\e\*q .Sh ENVIRONMENT
346: \&.\e\*q .Sh FILES
347: \&.\e\*q .Sh EXAMPLES
348: \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
349: \&.\e\*q .Sh DIAGNOSTICS
350: \&.\e\*q The next is for sections 2, 3, & 9 only.
351: \&.\e\*q .Sh ERRORS
352: \&.\e\*q .Sh SEE ALSO
353: \&.\e\*q .Xr foobar 1
354: \&.\e\*q .Sh STANDARDS
355: \&.\e\*q .Sh HISTORY
356: \&.\e\*q .Sh AUTHORS
357: \&.\e\*q .Sh CAVEATS
358: \&.\e\*q .Sh BUGS
359: \&.\e\*q .Sh SECURITY CONSIDERATIONS
1.57 kristaps 360: .Ed
361: .Pp
1.66 kristaps 362: The sections in a
363: .Nm
364: document are conventionally ordered as they appear above. Sections
365: should be composed as follows:
366: .Bl -tag -width Ds -offset Ds
367: .It NAME
368: Must contain at least one
369: .Sx \&Nm
370: followed by
371: .Sx \&Nd .
372: The name needs re-stating since one
373: .Nm
374: documents can be used for more than one utility or function, such as
375: .Xr grep 1
376: also being referenced as
377: .Xr egrep 1
378: and
379: .Xr fgrep 1 .
380: .It LIBRARY
381: .It SYNOPSIS
382: .It DESCRIPTION
383: .It IMPLEMENTATION NOTES
384: .It EXIT STATUS
385: .It RETURN VALUES
386: .It ENVIRONMENT
387: .It FILES
388: .It EXAMPLES
389: .It DIAGNOSTICS
390: .It ERRORS
391: .It SEE ALSO
392: .It STANDARDS
393: .It HISTORY
394: .It AUTHORS
395: .It CAVEATS
396: .It BUGS
397: .It SECURITY CONSIDERATIONS
398: .El
1.56 kristaps 399: .
400: .
1.43 kristaps 401: .Sh MACRO SYNTAX
1.56 kristaps 402: Macros are one to three three characters in length and begin with a
403: control character ,
1.57 kristaps 404: .Sq \&. ,
1.56 kristaps 405: at the beginning of the line. An arbitrary amount of whitespace may
1.64 kristaps 406: sit between the control character and the macro name. Thus, the
407: following are equivalent:
408: .Bd -literal -offset indent
409: \&.Pp
410: \&.\ \ \ \&Pp
411: .Ed
1.57 kristaps 412: .
413: .Pp
1.46 kristaps 414: The syntax of a macro depends on its classification. In this section,
1.57 kristaps 415: .Sq \-arg
1.43 kristaps 416: refers to macro arguments, which may be followed by zero or more
1.57 kristaps 417: .Sq parm
1.43 kristaps 418: parameters;
1.57 kristaps 419: .Sq \&Yo
1.43 kristaps 420: opens the scope of a macro; and if specified,
1.57 kristaps 421: .Sq \&Yc
1.43 kristaps 422: closes it out.
1.57 kristaps 423: .
424: .Pp
1.43 kristaps 425: The
1.57 kristaps 426: .Em Callable
1.43 kristaps 427: column indicates that the macro may be called subsequent to the initial
1.55 kristaps 428: line-macro. If a macro is not callable, then its invocation after the
429: initial line macro is interpreted as opaque text, such that
1.60 kristaps 430: .Sq \&.Fl \&Sh
1.55 kristaps 431: produces
1.60 kristaps 432: .Sq Fl \&Sh .
1.57 kristaps 433: .
434: .Pp
1.55 kristaps 435: The
1.57 kristaps 436: .Em Parsable
1.43 kristaps 437: column indicates whether the macro may be followed by further
1.55 kristaps 438: (ostensibly callable) macros. If a macro is not parsable, subsequent
439: macro invocations on the line will be interpreted as opaque text.
1.57 kristaps 440: .
441: .Pp
1.55 kristaps 442: The
1.57 kristaps 443: .Em Scope
1.43 kristaps 444: column, if applicable, describes closure rules.
1.56 kristaps 445: .
446: .
1.57 kristaps 447: .Ss Block full-explicit
1.43 kristaps 448: Multi-line scope closed by an explicit closing macro. All macros
449: contains bodies; only
1.64 kristaps 450: .Sx \&Bf
1.43 kristaps 451: contains a head.
1.57 kristaps 452: .Bd -literal -offset indent
1.50 kristaps 453: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
454: \(lBbody...\(rB
1.43 kristaps 455: \&.Yc
1.57 kristaps 456: .Ed
457: .
458: .Pp
459: .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
460: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
1.64 kristaps 461: .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
462: .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
463: .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
464: .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
465: .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
466: .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
467: .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
468: .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
1.57 kristaps 469: .El
1.56 kristaps 470: .
471: .
1.57 kristaps 472: .Ss Block full-implicit
1.43 kristaps 473: Multi-line scope closed by end-of-file or implicitly by another macro.
1.50 kristaps 474: All macros have bodies; some
1.57 kristaps 475: .Po
1.64 kristaps 476: .Sx \&It Fl bullet ,
477: .Fl hyphen ,
478: .Fl dash ,
479: .Fl enum ,
480: .Fl item
1.57 kristaps 481: .Pc
1.64 kristaps 482: don't have heads; only one
483: .Po
484: .Sx \&It Fl column
485: .Pc
486: has multiple heads.
1.57 kristaps 487: .Bd -literal -offset indent
1.50 kristaps 488: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
489: \(lBbody...\(rB
1.57 kristaps 490: .Ed
1.56 kristaps 491: .
1.57 kristaps 492: .Pp
493: .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
494: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
1.64 kristaps 495: .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
496: .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
497: .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
498: .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
1.57 kristaps 499: .El
1.56 kristaps 500: .
1.57 kristaps 501: .
502: .Ss Block partial-explicit
1.43 kristaps 503: Like block full-explicit, but also with single-line scope. Each
1.50 kristaps 504: has at least a body and, in limited circumstances, a head
1.64 kristaps 505: .Po
506: .Sx \&Fo ,
507: .Sx \&Eo
508: .Pc
1.50 kristaps 509: and/or tail
1.64 kristaps 510: .Pq Sx \&Ec .
1.57 kristaps 511: .Bd -literal -offset indent
1.50 kristaps 512: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
513: \(lBbody...\(rB
514: \&.Yc \(lBtail...\(rB
1.2 kristaps 515:
1.43 kristaps 516: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
1.50 kristaps 517: \(lBbody...\(rB \&Yc \(lBtail...\(rB
1.57 kristaps 518: .Ed
519: .
520: .Pp
521: .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
522: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
1.64 kristaps 523: .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
1.63 kristaps 524: .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
1.64 kristaps 525: .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
526: .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
527: .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
528: .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
529: .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
530: .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
531: .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
532: .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
533: .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
534: .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
535: .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
536: .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
537: .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
538: .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
539: .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
540: .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
1.63 kristaps 541: .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
542: .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
1.64 kristaps 543: .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
544: .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
545: .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
546: .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
1.57 kristaps 547: .El
1.56 kristaps 548: .
549: .
1.57 kristaps 550: .Ss Block partial-implicit
1.50 kristaps 551: Like block full-implicit, but with single-line scope closed by
1.57 kristaps 552: .Sx Reserved Characters
1.43 kristaps 553: or end of line.
1.57 kristaps 554: .Bd -literal -offset indent
1.43 kristaps 555: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
1.57 kristaps 556: .Ed
1.56 kristaps 557: .
1.57 kristaps 558: .Pp
559: .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
560: .It Em Macro Ta Em Callable Ta Em Parsable
1.64 kristaps 561: .It Sx \&Aq Ta Yes Ta Yes
562: .It Sx \&Bq Ta Yes Ta Yes
563: .It Sx \&Brq Ta Yes Ta Yes
564: .It Sx \&D1 Ta \&No Ta \&Yes
565: .It Sx \&Dl Ta \&No Ta Yes
566: .It Sx \&Dq Ta Yes Ta Yes
567: .It Sx \&Op Ta Yes Ta Yes
568: .It Sx \&Pq Ta Yes Ta Yes
569: .It Sx \&Ql Ta Yes Ta Yes
570: .It Sx \&Qq Ta Yes Ta Yes
571: .It Sx \&Sq Ta Yes Ta Yes
1.57 kristaps 572: .El
1.56 kristaps 573: .
1.57 kristaps 574: .
575: .Ss In-line
1.50 kristaps 576: Closed by
1.57 kristaps 577: .Sx Reserved Characters ,
1.43 kristaps 578: end of line, fixed argument lengths, and/or subsequent macros. In-line
579: macros have only text children. If a number (or inequality) of
1.3 kristaps 580: arguments is
1.57 kristaps 581: .Pq n ,
1.3 kristaps 582: then the macro accepts an arbitrary number of arguments.
1.57 kristaps 583: .Bd -literal -offset indent
1.43 kristaps 584: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
585:
586: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
587:
588: \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
1.57 kristaps 589: .Ed
590: .
591: .Pp
592: .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
593: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
1.63 kristaps 594: .It Sx \&%A Ta \&No Ta \&No Ta >0
595: .It Sx \&%B Ta \&No Ta \&No Ta >0
596: .It Sx \&%C Ta \&No Ta \&No Ta >0
597: .It Sx \&%D Ta \&No Ta \&No Ta >0
598: .It Sx \&%I Ta \&No Ta \&No Ta >0
599: .It Sx \&%J Ta \&No Ta \&No Ta >0
600: .It Sx \&%N Ta \&No Ta \&No Ta >0
601: .It Sx \&%O Ta \&No Ta \&No Ta >0
602: .It Sx \&%P Ta \&No Ta \&No Ta >0
1.69 kristaps 603: .It Sx \&%Q Ta \&No Ta \&No Ta >0
1.63 kristaps 604: .It Sx \&%R Ta \&No Ta \&No Ta >0
605: .It Sx \&%T Ta \&No Ta \&No Ta >0
1.69 kristaps 606: .It Sx \&%U Ta \&No Ta \&No Ta >0
1.63 kristaps 607: .It Sx \&%V Ta \&No Ta \&No Ta >0
1.64 kristaps 608: .It Sx \&Ad Ta Yes Ta Yes Ta n
609: .It Sx \&An Ta Yes Ta Yes Ta n
610: .It Sx \&Ap Ta Yes Ta Yes Ta 0
611: .It Sx \&Ar Ta Yes Ta Yes Ta n
612: .It Sx \&At Ta Yes Ta Yes Ta 1
613: .It Sx \&Bsx Ta Yes Ta Yes Ta n
614: .It Sx \&Bt Ta \&No Ta \&No Ta 0
615: .It Sx \&Bx Ta Yes Ta Yes Ta n
616: .It Sx \&Cd Ta Yes Ta Yes Ta >0
617: .It Sx \&Cm Ta Yes Ta Yes Ta n
618: .It Sx \&Db Ta \&No Ta \&No Ta 1
619: .It Sx \&Dd Ta \&No Ta \&No Ta >0
620: .It Sx \&Dt Ta \&No Ta \&No Ta n
621: .It Sx \&Dv Ta Yes Ta Yes Ta n
622: .It Sx \&Dx Ta Yes Ta Yes Ta n
623: .It Sx \&Em Ta Yes Ta Yes Ta >0
624: .It Sx \&En Ta \&No Ta \&No Ta 0
625: .It Sx \&Er Ta Yes Ta Yes Ta >0
626: .It Sx \&Es Ta \&No Ta \&No Ta 0
627: .It Sx \&Ev Ta Yes Ta Yes Ta n
628: .It Sx \&Ex Ta \&No Ta \&No Ta n
629: .It Sx \&Fa Ta Yes Ta Yes Ta n
630: .It Sx \&Fd Ta \&No Ta \&No Ta >0
631: .It Sx \&Fl Ta Yes Ta Yes Ta n
632: .It Sx \&Fn Ta Yes Ta Yes Ta >0
633: .It Sx \&Fr Ta \&No Ta \&No Ta n
634: .It Sx \&Ft Ta Yes Ta Yes Ta n
635: .It Sx \&Fx Ta Yes Ta Yes Ta n
636: .It Sx \&Hf Ta \&No Ta \&No Ta n
637: .It Sx \&Ic Ta Yes Ta Yes Ta >0
638: .It Sx \&In Ta \&No Ta \&No Ta n
639: .It Sx \&Lb Ta \&No Ta \&No Ta 1
640: .It Sx \&Li Ta Yes Ta Yes Ta n
641: .It Sx \&Lk Ta Yes Ta Yes Ta n
642: .It Sx \&Lp Ta \&No Ta \&No Ta 0
643: .It Sx \&Ms Ta Yes Ta Yes Ta >0
644: .It Sx \&Mt Ta Yes Ta Yes Ta >0
645: .It Sx \&Nm Ta Yes Ta Yes Ta n
646: .It Sx \&No Ta Yes Ta Yes Ta 0
647: .It Sx \&Ns Ta Yes Ta Yes Ta 0
648: .It Sx \&Nx Ta Yes Ta Yes Ta n
649: .It Sx \&Os Ta \&No Ta \&No Ta n
650: .It Sx \&Ot Ta \&No Ta \&No Ta n
651: .It Sx \&Ox Ta Yes Ta Yes Ta n
652: .It Sx \&Pa Ta Yes Ta Yes Ta n
653: .It Sx \&Pf Ta \&No Ta Yes Ta 1
654: .It Sx \&Pp Ta \&No Ta \&No Ta 0
655: .It Sx \&Rv Ta \&No Ta \&No Ta n
656: .It Sx \&Sm Ta \&No Ta \&No Ta 1
657: .It Sx \&St Ta \&No Ta Yes Ta 1
658: .It Sx \&Sx Ta Yes Ta Yes Ta >0
659: .It Sx \&Sy Ta Yes Ta Yes Ta >0
660: .It Sx \&Tn Ta Yes Ta Yes Ta >0
661: .It Sx \&Ud Ta \&No Ta \&No Ta 0
662: .It Sx \&Ux Ta Yes Ta Yes Ta n
663: .It Sx \&Va Ta Yes Ta Yes Ta n
664: .It Sx \&Vt Ta Yes Ta Yes Ta >0
665: .It Sx \&Xr Ta Yes Ta Yes Ta >0, <3
666: .It Sx \&br Ta \&No Ta \&No Ta 0
667: .It Sx \&sp Ta \&No Ta \&No Ta 1
1.57 kristaps 668: .El
1.56 kristaps 669: .
670: .
1.63 kristaps 671: .Sh REFERENCE
672: This section is a canonical reference of all macros, arranged
673: alphabetically. For the scoping of individual macros, see
674: .Sx MACRO SYNTAX .
675: .
676: .Ss \&%A
677: Author name of an
678: .Sx \&Rs
679: block. Multiple authors should each be accorded their own
1.64 kristaps 680: .Sx \%%A
1.66 kristaps 681: line. Author names should be ordered with full or abbreviated
682: forename(s) first, then full surname.
1.64 kristaps 683: .
1.63 kristaps 684: .Ss \&%B
685: Book title of an
686: .Sx \&Rs
687: block. This macro may also be used in a non-bibliographic context when
688: referring to book titles.
1.64 kristaps 689: .
1.63 kristaps 690: .Ss \&%C
691: Publication city or location of an
692: .Sx \&Rs
693: block.
694: .Pp
1.65 kristaps 695: .Em Remarks :
1.63 kristaps 696: this macro is not implemented in
697: .Xr groff 1 .
1.64 kristaps 698: .
1.63 kristaps 699: .Ss \&%D
700: Publication date of an
701: .Sx \&Rs
1.72 ! kristaps 702: block. This should follow the reduced or canonical form syntax
! 703: described in
1.63 kristaps 704: .Sx Dates .
1.64 kristaps 705: .
1.63 kristaps 706: .Ss \&%I
707: Publisher or issuer name of an
708: .Sx \&Rs
709: block.
1.64 kristaps 710: .
1.63 kristaps 711: .Ss \&%J
712: Journal name of an
713: .Sx \&Rs
714: block.
1.64 kristaps 715: .
1.63 kristaps 716: .Ss \&%N
717: Issue number (usually for journals) of an
718: .Sx \&Rs
719: block.
1.64 kristaps 720: .
1.63 kristaps 721: .Ss \&%O
722: Optional information of an
723: .Sx \&Rs
724: block.
1.64 kristaps 725: .
1.63 kristaps 726: .Ss \&%P
727: Book or journal page number of an
728: .Sx \&Rs
729: block.
1.64 kristaps 730: .
1.63 kristaps 731: .Ss \&%Q
732: Institutional author (school, government, etc.) of an
733: .Sx \&Rs
734: block. Multiple institutional authors should each be accorded their own
1.64 kristaps 735: .Sx \&%Q
1.63 kristaps 736: line.
1.64 kristaps 737: .
1.63 kristaps 738: .Ss \&%R
739: Technical report name of an
740: .Sx \&Rs
741: block.
1.64 kristaps 742: .
1.63 kristaps 743: .Ss \&%T
744: Article title of an
745: .Sx \&Rs
746: block. This macro may also be used in a non-bibliographical context
747: when referring to article titles.
1.64 kristaps 748: .
1.69 kristaps 749: .Ss \&%U
1.70 kristaps 750: URI of reference document.
1.69 kristaps 751: .
1.63 kristaps 752: .Ss \&%V
753: Volume number of an
754: .Sx \&Rs
755: block.
1.64 kristaps 756: .
1.63 kristaps 757: .Ss \&Ac
758: Closes an
759: .Sx \&Ao
760: block. Does not have any tail arguments.
1.64 kristaps 761: .
1.63 kristaps 762: .Ss \&Ad
763: Address construct: usually in the context of an computational address in
764: memory, not a physical (post) address.
765: .Pp
1.64 kristaps 766: Examples:
1.63 kristaps 767: .Bd -literal -offset indent
768: \&.Ad [0,$]
769: \&.Ad 0x00000000
770: .Ed
1.64 kristaps 771: .
1.63 kristaps 772: .Ss \&An
1.64 kristaps 773: Author name. This macro may alternatively accepts the following
774: arguments, although these may not be specified along with a parameter:
775: .Bl -tag -width 12n -offset indent
776: .It Fl split
1.66 kristaps 777: Renders a line break before each author listing.
1.64 kristaps 778: .It Fl nosplit
779: The opposite of
780: .Fl split .
781: .El
782: .Pp
783: In the AUTHORS section, the default is not to split the first author
784: listing, but all subsequent author listings, whether or not they're
785: interspersed by other macros or text, are split. Thus, specifying
786: .Fl split
787: will cause the first listing also to be split. If not in the AUTHORS
788: section, the default is not to split.
789: .Pp
790: Examples:
791: .Bd -literal -offset indent
792: \&.An -nosplit
793: \&.An J. E. Hopcraft ,
794: \&.An J. D. Ullman .
795: .Ed
796: .Pp
797: .Em Remarks :
798: the effects of
799: .Fl split
800: or
801: .Fl nosplit
802: are re-set when entering the AUTHORS section, so if one specifies
803: .Sx \&An Fl nosplit
804: in the general document body, it must be re-specified in the AUTHORS
805: section.
806: .
1.63 kristaps 807: .Ss \&Ao
808: Begins a block enclosed by angled brackets. Does not have any head
809: arguments.
810: .Pp
1.64 kristaps 811: Examples:
1.63 kristaps 812: .Bd -literal -offset indent
813: \&.Fl -key= Ns Ao Ar val Ac
814: .Ed
815: .Pp
1.64 kristaps 816: See also
817: .Sx \&Aq .
818: .
1.63 kristaps 819: .Ss \&Ap
1.64 kristaps 820: Inserts an apostrophe without any surrounding white-space. This is
821: generally used as a grammatic device when referring to the verb form of
822: a function:
823: .Bd -literal -offset indent
824: \&.Fn execve Ap d
825: .Ed
826: .
1.63 kristaps 827: .Ss \&Aq
1.64 kristaps 828: Encloses its arguments in angled brackets.
829: .Pp
830: Examples:
831: .Bd -literal -offset indent
832: \&.Fl -key= Ns Aq Ar val
833: .Ed
834: .Pp
835: .Em Remarks :
836: this macro is often abused for rendering URIs, which should instead use
837: .Sx \&Lk
838: or
839: .Sx \&Mt ,
840: or to note pre-processor
841: .Dq Li #include
842: statements, which should use
843: .Sx \&In .
844: .Pp
845: See also
846: .Sx \&Ao .
847: .
1.63 kristaps 848: .Ss \&Ar
1.66 kristaps 849: Command arguments. If an argument is not provided, the string
1.64 kristaps 850: .Dq file ...
1.66 kristaps 851: is used as a default.
1.64 kristaps 852: .Pp
853: Examples:
854: .Bd -literal -offset indent
855: \&.Fl o Ns Ar file1
856: \&.Ar
857: \&.Ar arg1 , arg2 .
858: .Ed
859: .
1.63 kristaps 860: .Ss \&At
1.64 kristaps 861: Formats an AT&T version. Accepts at most one parameter:
862: .Bl -tag -width 12n -offset indent
863: .It Cm v[1-7] | 32v
864: A version of
865: .At .
866: .It Cm V[.[1-4]]?
867: A system version of
868: .At .
869: .El
870: .Pp
871: Note that these parameters do not begin with a hyphen.
872: .Pp
873: Examples:
874: .Bd -literal -offset indent
875: \&.At
876: \&.At V.1
877: .Ed
1.65 kristaps 878: .Pp
879: See also
1.66 kristaps 880: .Sx \&Bsx ,
1.65 kristaps 881: .Sx \&Bx ,
1.66 kristaps 882: .Sx \&Dx ,
1.65 kristaps 883: .Sx \&Fx ,
884: .Sx \&Nx ,
885: .Sx \&Ox ,
886: and
887: .Sx \&Ux .
1.64 kristaps 888: .
1.63 kristaps 889: .Ss \&Bc
1.64 kristaps 890: Closes a
891: .Sx \&Bo
892: block. Does not have any tail arguments.
893: .
1.63 kristaps 894: .Ss \&Bd
1.64 kristaps 895: Begins a display block. A display is collection of macros or text which
896: may be collectively offset or justified in a manner different from that
897: of the enclosing context. By default, the block is preceded by a
898: vertical space.
899: .Pp
900: Each display is associated with a type, which must be one of the
901: following arguments:
902: .Bl -tag -width 12n -offset indent
903: .It Fl ragged
904: Only left-justify the block.
905: .It Fl unfilled
906: Do not justify the block at all.
907: .It Fl filled
908: Left- and right-justify the block.
909: .It Fl literal
910: Alias for
911: .Fl unfilled .
912: .It Fl centered
913: Centre-justify each line.
914: .El
915: .Pp
916: The type must be provided first. Secondary arguments are as follows:
917: .Bl -tag -width 12n -offset indent
918: .It Fl offset Ar width
919: Offset by the value of
920: .Ar width ,
921: which is interpreted as one of the following, specified in order:
922: .Bl -item
923: .It
924: As one of the pre-defined strings
925: .Ar indent ,
926: the width of standard indentation;
927: .Ar indent-two ,
928: twice
929: .Ar indent ;
930: .Ar left ,
931: which has no effect ;
932: .Ar right ,
933: which justifies to the right margin; and
934: .Ar center ,
935: which aligns around an imagined centre axis.
936: .It
937: As a precalculated width for a named macro. The most popular is the
938: imaginary macro
1.67 kristaps 939: .Ar \&Ds ,
1.64 kristaps 940: which resolves to
941: .Ar 6n .
942: .It
943: As a scaling unit following the syntax described in
944: .Sx Scaling Widths .
945: .It
946: As the calculated string length of the opaque string.
947: .El
948: .Pp
949: If unset, it will revert to the value of
950: .Ar 8n
951: as described in
952: .Sx Scaling Widths .
953: .It Fl compact
954: Do not assert a vertical space before the block.
955: .It Fl file Ar file
956: Prepend the file
957: .Ar file
958: before any text or macros within the block.
959: .El
960: .Pp
961: Examples:
962: .Bd -literal -offset indent
963: \&.Bd \-unfilled \-offset two-indent \-compact
1.65 kristaps 964: Hello world.
1.64 kristaps 965: \&.Ed
966: .Ed
1.66 kristaps 967: .Pp
968: See also
969: .Sx \&D1
970: and
971: .Sx \&Dl .
1.64 kristaps 972: .
1.63 kristaps 973: .Ss \&Bf
974: .Ss \&Bk
975: .Ss \&Bl
1.65 kristaps 976: .
1.63 kristaps 977: .Ss \&Bo
1.65 kristaps 978: Begins a block enclosed by square brackets. Does not have any head
979: arguments.
980: .Pp
981: Examples:
982: .Bd -literal -offset indent
983: \&.Bo 1 ,
984: \&.Dv BUFSIZ Bc
985: .Ed
986: .Pp
987: See also
988: .Sx \&Bq .
989: .
1.63 kristaps 990: .Ss \&Bq
1.65 kristaps 991: Encloses its arguments in square brackets.
992: .Pp
993: Examples:
994: .Bd -literal -offset indent
995: \&.Bq 1 , Dv BUFSIZ
996: .Ed
997: .Pp
998: .Em Remarks :
999: this macro is sometimes abused to emulate optional arguments for
1000: commands; the correct macros to use for this purpose are
1001: .Sx \&Op ,
1002: .Sx \&Oo ,
1003: and
1004: .Sx \&Oc .
1005: .Pp
1006: See also
1007: .Sx \&Bo .
1008: .
1.63 kristaps 1009: .Ss \&Brc
1.65 kristaps 1010: Closes a
1011: .Sx \&Bro
1012: block. Does not have any tail arguments.
1013: .
1.63 kristaps 1014: .Ss \&Bro
1.65 kristaps 1015: Begins a block enclosed by curly braces. Does not have any head
1016: arguments.
1017: .Pp
1018: Examples:
1019: .Bd -literal -offset indent
1020: \&.Bro 1 , ... ,
1021: \&.Va n Brc
1022: .Ed
1023: .Pp
1024: See also
1025: .Sx \&Brq .
1026: .
1.63 kristaps 1027: .Ss \&Brq
1.65 kristaps 1028: Encloses its arguments in curly braces.
1029: .Pp
1030: Examples:
1031: .Bd -literal -offset indent
1032: \&.Brq 1 , ... , Va n
1033: .Ed
1034: .Pp
1035: See also
1036: .Sx \&Bro .
1037: .
1.63 kristaps 1038: .Ss \&Bsx
1.65 kristaps 1039: Format the BSD/OS version provided as an argument, or a default value if
1040: no argument is provided.
1041: .Pp
1042: Examples:
1043: .Bd -literal -offset indent
1044: \&.Bsx 1.0
1045: \&.Bsx
1046: .Ed
1047: .Pp
1048: See also
1049: .Sx \&At ,
1050: .Sx \&Bx ,
1.66 kristaps 1051: .Sx \&Dx ,
1.65 kristaps 1052: .Sx \&Fx ,
1053: .Sx \&Nx ,
1054: .Sx \&Ox ,
1055: and
1056: .Sx \&Ux .
1057: .
1.63 kristaps 1058: .Ss \&Bt
1.66 kristaps 1059: Prints
1060: .Dq is currently in beta test.
1061: .
1.63 kristaps 1062: .Ss \&Bx
1.65 kristaps 1063: Format the BSD version provided as an argument, or a default value if no
1064: argument is provided.
1065: .Pp
1066: Examples:
1067: .Bd -literal -offset indent
1068: \&.Bx 4.4
1069: \&.Bx
1070: .Ed
1071: .Pp
1072: See also
1073: .Sx \&At ,
1074: .Sx \&Bsx ,
1.66 kristaps 1075: .Sx \&Dx ,
1.65 kristaps 1076: .Sx \&Fx ,
1077: .Sx \&Nx ,
1078: .Sx \&Ox ,
1079: and
1080: .Sx \&Ux .
1081: .
1.63 kristaps 1082: .Ss \&Cd
1.66 kristaps 1083: Configuration declaration (suggested for use only in section four
1084: manuals). This denotes strings accepted by
1085: .Xr config 8 .
1086: .Pp
1087: Examples:
1088: .Bd -literal -offset indent
1089: \&.Cd device le0 at scode?
1090: .Ed
1091: .Pp
1092: .Em Remarks :
1093: this macro is commonly abused by using quoted literals to retain
1094: white-space and align consecutive
1095: .Sx \&Cd
1096: declarations. This practise is discouraged.
1097: .
1.63 kristaps 1098: .Ss \&Cm
1.66 kristaps 1099: Command modifiers. Useful when specifying configuration options or
1100: keys.
1101: .Pp
1102: Examples:
1103: .Bd -literal -offset indent
1104: \&.Cm ControlPath
1105: \&.Cm ControlMaster
1106: .Ed
1107: .Pp
1108: See also
1109: .Sx \&Fl .
1110: .
1.63 kristaps 1111: .Ss \&D1
1.66 kristaps 1112: One-line indented display. This is formatted by the default rules and
1113: is useful for simple indented statements. It is followed by a newline.
1114: .Pp
1115: Examples:
1116: .Bd -literal -offset indent
1117: \&.D1 Fl abcdefgh
1118: .Ed
1119: .Pp
1120: See also
1121: .Sx \&Bd
1122: and
1123: .Sx \&Dl .
1124: .
1.63 kristaps 1125: .Ss \&Db
1126: .Ss \&Dc
1.66 kristaps 1127: Closes a
1128: .Sx \&Do
1129: block. Does not have any tail arguments.
1130: .
1.63 kristaps 1131: .Ss \&Dd
1.66 kristaps 1132: Document date. This is the mandatory first macro of any
1133: .Nm
1134: manual. Its calling syntax is as follows:
1135: .Pp
1136: .D1 \. Ns Sx \&Dd Cm date
1137: .Pp
1138: The
1139: .Cm date
1140: field may be either
1141: .Ar $\&Mdocdate$ ,
1142: which signifies the current manual revision date dictated by
1.72 ! kristaps 1143: .Xr cvs 1 ,
1.66 kristaps 1144: or instead a valid canonical date as specified by
1145: .Sx Dates .
1.72 ! kristaps 1146: If a date does not conform, the current date is used instead.
1.66 kristaps 1147: .Pp
1148: Examples:
1149: .Bd -literal -offset indent
1150: \&.Dd $\&Mdocdate$
1151: \&.Dd $\&Mdocdate: July 21 2007$
1152: \&.Dd July 21, 2007
1153: .Ed
1154: .Pp
1155: See also
1156: .Sx \&Dt
1157: and
1158: .Sx \&Os .
1159: .
1.63 kristaps 1160: .Ss \&Dl
1.66 kristaps 1161: One-line intended display. This is formatted as literal text and is
1162: useful for commands and invocations. It is followed by a newline.
1163: .Pp
1164: Examples:
1165: .Bd -literal -offset indent
1166: \&.Dl % mandoc mdoc.7 | less
1167: .Ed
1168: .Pp
1169: See also
1170: .Sx \&Bd
1171: and
1172: .Sx \&D1 .
1173: .
1.63 kristaps 1174: .Ss \&Do
1.66 kristaps 1175: Begins a block enclosed by double quotes. Does not have any head
1176: arguments.
1177: .Pp
1178: Examples:
1179: .Bd -literal -offset indent
1180: \&.D1 Do April is the cruellest month Dc \e(em T.S. Eliot
1181: .Ed
1182: .Pp
1183: See also
1184: .Sx \&Dq .
1185: .
1.63 kristaps 1186: .Ss \&Dq
1.66 kristaps 1187: Encloses its arguments in double quotes.
1188: .Pp
1189: Examples:
1190: .Bd -literal -offset indent
1191: \&.Dq April is the cruellest month
1192: \e(em T.S. Eliot
1193: .Ed
1194: .Pp
1195: See also
1196: .Sx \&Do .
1197: .
1.63 kristaps 1198: .Ss \&Dt
1.66 kristaps 1199: Document title. This is the mandatory second macro of any
1200: .Nm
1201: file. Its calling syntax is as follows:
1202: .Pp
1203: .D1 \. Ns Sx \&Dt Cm title section Op Cm volume | arch
1204: .Pp
1205: Its arguments are as follows:
1206: .Bl -tag -width Ds -offset Ds
1207: .It Cm title
1208: The document's title (name). This should be capitalised and is
1209: required.
1210: .It Cm section
1211: The manual section. This may be one of
1212: .Ar 1
1213: .Pq utilities ,
1214: .Ar 2
1215: .Pq system calls ,
1216: .Ar 3
1217: .Pq libraries ,
1218: .Ar 3p
1219: .Pq Perl libraries ,
1220: .Ar 4
1221: .Pq devices ,
1222: .Ar 5
1223: .Pq file formats ,
1224: .Ar 6
1225: .Pq games ,
1226: .Ar 7
1227: .Pq miscellaneous ,
1228: .Ar 8
1229: .Pq system utilities ,
1230: .Ar 9
1231: .Pq kernel functions ,
1232: .Ar X11
1233: .Pq X Window System ,
1234: .Ar X11R6
1235: .Pq X Window System ,
1236: .Ar unass
1237: .Pq unassociated ,
1238: .Ar local
1239: .Pq local system ,
1240: .Ar draft
1241: .Pq draft manual ,
1242: or
1243: .Ar paper
1244: .Pq paper .
1245: It is also required and should correspond to the manual's filename
1246: suffix.
1247: .It Cm volume
1248: This overrides the volume inferred from
1249: .Ar section .
1250: This field is optional, and if specified, must be one of
1251: .Ar USD
1252: .Pq users' supplementary documents ,
1253: .Ar PS1
1254: .Pq programmers' supplementary documents ,
1255: .Ar AMD
1256: .Pq administrators' supplementary documents ,
1257: .Ar SMM
1258: .Pq system managers' manuals ,
1259: .Ar URM
1260: .Pq users' reference manuals ,
1261: .Ar PRM
1262: .Pq programmers' reference manuals ,
1263: .Ar KM
1264: .Pq kernel manuals ,
1265: .Ar IND
1266: .Pq master index ,
1267: .Ar MMI
1268: .Pq master index ,
1269: .Ar LOCAL
1270: .Pq local manuals ,
1271: .Ar LOC
1272: .Pq local manuals ,
1273: or
1274: .Ar CON
1275: .Pq contributed manuals .
1276: .It Cm arch
1277: This specifies a specific relevant architecture. If
1278: .Cm volume
1279: is not provided, it may be used in its place, else it may be used
1280: subsequent that. It, too, is optional. It must be one of
1281: .Ar alpha ,
1282: .Ar amd64 ,
1283: .Ar amiga ,
1284: .Ar arc ,
1285: .Ar arm ,
1286: .Ar armish ,
1287: .Ar aviion ,
1288: .Ar hp300 ,
1289: .Ar hppa ,
1290: .Ar hppa64 ,
1291: .Ar i386 ,
1292: .Ar landisk ,
1293: .Ar luna88k ,
1294: .Ar mac68k ,
1295: .Ar macppc ,
1296: .Ar mvme68k ,
1297: .Ar mvme88k ,
1298: .Ar mvmeppc ,
1299: .Ar pmax ,
1300: .Ar sgi ,
1301: .Ar socppc ,
1302: .Ar sparc ,
1303: .Ar sparc64 ,
1304: .Ar sun3 ,
1305: .Ar vax ,
1306: or
1307: .Ar zaurus .
1308: .El
1309: .Pp
1310: Examples:
1311: .Bd -literal -offset indent
1312: \&.Dt FOO 1
1313: \&.Dt FOO 4 KM
1314: \&.Dt FOO 9 i386
1315: \&.Dt FOO 9 KM i386
1316: .Ed
1317: .Pp
1318: See also
1319: .Sx \&Dd
1320: and
1321: .Sx \&Os .
1322: .
1.63 kristaps 1323: .Ss \&Dv
1.66 kristaps 1324: Defined variables such as preprocessor constants.
1325: .Pp
1326: Examples:
1327: .Bd -literal -offset indent
1328: \&.Dv BUFSIZ
1329: \&.Dv STDOUT_FILENO
1330: .Ed
1331: .Pp
1332: See also
1333: .Sx \&Er .
1334: .
1.63 kristaps 1335: .Ss \&Dx
1.71 kristaps 1336: Format the DragonFly BSD version provided as an argument, or a default
1.66 kristaps 1337: value if no argument is provided.
1338: .Pp
1339: Examples:
1340: .Bd -literal -offset indent
1341: \&.Dx 2.4.1
1342: \&.Dx
1343: .Ed
1344: .Pp
1345: See also
1346: .Sx \&At ,
1347: .Sx \&Bsx ,
1348: .Sx \&Bx ,
1349: .Sx \&Fx ,
1350: .Sx \&Nx ,
1351: .Sx \&Ox ,
1352: and
1353: .Sx \&Ux .
1354: .
1.63 kristaps 1355: .Ss \&Ec
1356: .Ss \&Ed
1357: .Ss \&Ef
1358: .Ss \&Ek
1359: .Ss \&El
1360: .Ss \&Em
1.66 kristaps 1361: Denotes text that should be emphasised. Note that this is a
1362: presentation term and should not be used for stylistically decorating
1363: technical terms.
1364: .Pp
1365: Examples:
1366: .Bd -literal -offset indent
1367: \&.Ed Warnings!
1368: \&.Ed Remarks :
1369: .Ed
1370: .
1.63 kristaps 1371: .Ss \&En
1372: .Ss \&Eo
1373: .Ss \&Er
1.66 kristaps 1374: Error constants (suggested for use only in section two manuals).
1375: .Pp
1376: Examples:
1377: .Bd -literal -offset indent
1378: \&.Er EPERM
1379: \&.Er ENOENT
1380: .Ed
1381: .Pp
1382: See also
1383: .Sx \&Dv .
1384: .
1.63 kristaps 1385: .Ss \&Es
1.66 kristaps 1386: .
1.63 kristaps 1387: .Ss \&Ev
1.66 kristaps 1388: Environmental variables such as those specified in
1389: .Xr environ 7 .
1390: .Pp
1391: Examples:
1392: .Bd -literal -offset indent
1393: \&.Ev DISPLAY
1394: \&.Ev PATH
1395: .Ed
1396: .
1.63 kristaps 1397: .Ss \&Ex
1.66 kristaps 1398: Inserts text regarding a utility's exit values. This macro must have
1399: first the
1400: .Fl std
1401: argument specified, then an optional
1402: .Ar utility .
1403: If
1404: .Ar utility
1405: is not provided, the document's name as stipulated in
1406: .Sx \&Nm
1407: is provided.
1.63 kristaps 1408: .Ss \&Fa
1409: .Ss \&Fc
1410: .Ss \&Fd
1411: .Ss \&Fl
1412: .Ss \&Fn
1413: .Ss \&Fo
1414: .Ss \&Fr
1415: .Ss \&Ft
1416: .Ss \&Fx
1.65 kristaps 1417: Format the FreeBSD version provided as an argument, or a default value
1418: if no argument is provided.
1419: .Pp
1420: Examples:
1421: .Bd -literal -offset indent
1422: \&.Fx 7.1
1423: \&.Fx
1424: .Ed
1425: .Pp
1426: See also
1427: .Sx \&At ,
1.66 kristaps 1428: .Sx \&Bsx ,
1.65 kristaps 1429: .Sx \&Bx ,
1.66 kristaps 1430: .Sx \&Dx ,
1.65 kristaps 1431: .Sx \&Nx ,
1432: .Sx \&Ox ,
1433: and
1434: .Sx \&Ux .
1435: .
1.63 kristaps 1436: .Ss \&Hf
1437: .Ss \&Ic
1438: .Ss \&In
1439: .Ss \&It
1440: .Ss \&Lb
1441: .Ss \&Li
1442: .Ss \&Lk
1.70 kristaps 1443: Format a hyperlink. The calling syntax is as follows:
1444: .Pp
1445: .D1 \. Ns Sx \&Lk Cm uri Op Cm name
1446: .Pp
1447: Examples:
1448: .Bd -literal -offset indent
1449: \&.Lk http://bsd.lv "The BSD.lv Project"
1450: \&.Lk http://bsd.lv
1451: .Ed
1452: .Pp
1453: See also
1454: .Sx \&Mt .
1455: .
1.63 kristaps 1456: .Ss \&Lp
1457: .Ss \&Ms
1458: .Ss \&Mt
1459: .Ss \&Nd
1460: .Ss \&Nm
1461: .Ss \&No
1462: .Ss \&Ns
1463: .Ss \&Nx
1.65 kristaps 1464: Format the NetBSD version provided as an argument, or a default value if
1465: no argument is provided.
1466: .Pp
1467: Examples:
1468: .Bd -literal -offset indent
1469: \&.Nx 5.01
1470: \&.Nx
1471: .Ed
1472: .Pp
1473: See also
1474: .Sx \&At ,
1.66 kristaps 1475: .Sx \&Bsx ,
1.65 kristaps 1476: .Sx \&Bx ,
1.66 kristaps 1477: .Sx \&Dx ,
1.65 kristaps 1478: .Sx \&Fx ,
1479: .Sx \&Ox ,
1480: and
1481: .Sx \&Ux .
1482: .
1.63 kristaps 1483: .Ss \&Oc
1484: .Ss \&Oo
1485: .Ss \&Op
1486: .Ss \&Os
1.66 kristaps 1487: Document operating system version. This is the mandatory third macro of
1488: any
1489: .Nm
1490: file. Its calling syntax is as follows:
1491: .Pp
1492: .D1 \. Ns Sx \&Os Op Cm system
1493: .Pp
1494: The optional
1495: .Cm system
1496: parameter specifies the relevant operating system or environment. Left
1497: unspecified, it defaults to the local operating system version. This is
1498: the suggested form.
1499: .Pp
1500: Examples:
1501: .Bd -literal -offset indent
1502: \&.Os
1503: \&.Os KTH/CSC/TCS
1504: \&.Os BSD 4.3
1505: .Ed
1506: .Pp
1507: See also
1508: .Sx \&Dd
1509: and
1510: .Sx \&Dt .
1511: .
1.63 kristaps 1512: .Ss \&Ot
1.66 kristaps 1513: Unknown usage.
1514: .Pp
1515: .Em Remarks :
1516: this macro has been deprecated.
1517: .
1.63 kristaps 1518: .Ss \&Ox
1.65 kristaps 1519: Format the OpenBSD version provided as an argument, or a default value
1520: if no argument is provided.
1521: .Pp
1522: Examples:
1523: .Bd -literal -offset indent
1524: \&.Ox 4.5
1525: \&.Ox
1526: .Ed
1527: .Pp
1528: See also
1529: .Sx \&At ,
1530: .Sx \&Bsx ,
1531: .Sx \&Bx ,
1.66 kristaps 1532: .Sx \&Dx ,
1.65 kristaps 1533: .Sx \&Fx ,
1534: .Sx \&Nx ,
1535: and
1536: .Sx \&Ux .
1537: .
1.63 kristaps 1538: .Ss \&Pa
1539: .Ss \&Pc
1540: .Ss \&Pf
1541: .Ss \&Po
1542: .Ss \&Pp
1543: .Ss \&Pq
1544: .Ss \&Qc
1545: .Ss \&Ql
1546: .Ss \&Qo
1547: .Ss \&Qq
1.64 kristaps 1548: .
1.63 kristaps 1549: .Ss \&Re
1550: Closes a
1551: .Sx \&Rs
1552: block. Does not have any tail arguments.
1.64 kristaps 1553: .
1.63 kristaps 1554: .Ss \&Rs
1555: Begins a bibliographic
1556: .Pq Dq reference
1.68 kristaps 1557: block. Does not have any head arguments. The block macro may only
1.63 kristaps 1558: contain
1559: .Sx \&%A ,
1560: .Sx \&%B ,
1561: .Sx \&%C ,
1562: .Sx \&%D ,
1563: .Sx \&%I ,
1564: .Sx \&%J ,
1565: .Sx \&%N ,
1566: .Sx \&%O ,
1567: .Sx \&%P ,
1568: .Sx \&%Q ,
1569: .Sx \&%R ,
1570: .Sx \&%T ,
1571: and
1572: .Sx \&%V
1573: child macros (at least one must be specified).
1574: .Pp
1.64 kristaps 1575: Examples:
1.63 kristaps 1576: .Bd -literal -offset indent
1577: \&.Rs
1578: \&.%A J. E. Hopcroft
1579: \&.%A J. D. Ullman
1580: \&.%B Introduction to Automata Theory, Languages, and Computation
1581: \&.%I Addison-Wesley
1582: \&.%C Reading, Massachusettes
1583: \&.%D 1979
1584: \&.Re
1585: .Ed
1586: .Pp
1587: If an
1588: .Sx \&Rs
1589: block is used within a SEE ALSO section, a vertical space is asserted
1590: before the rendered output, else the block continues on the current
1591: line.
1.64 kristaps 1592: .
1.63 kristaps 1593: .Ss \&Rv
1594: .Ss \&Sc
1595: .Ss \&Sh
1596: .Ss \&Sm
1597: .Ss \&So
1598: .Ss \&Sq
1599: .Ss \&Ss
1600: .Ss \&St
1601: .Ss \&Sx
1602: .Ss \&Sy
1603: .Ss \&Tn
1604: .Ss \&Ud
1605: .Ss \&Ux
1.65 kristaps 1606: Format the UNIX name. Accepts no argument.
1607: .Pp
1608: Examples:
1609: .Bd -literal -offset indent
1610: \&.Ux
1611: .Ed
1612: .Pp
1613: See also
1614: .Sx \&At ,
1.66 kristaps 1615: .Sx \&Bsx ,
1.65 kristaps 1616: .Sx \&Bx ,
1.66 kristaps 1617: .Sx \&Dx ,
1.65 kristaps 1618: .Sx \&Fx ,
1619: .Sx \&Nx ,
1620: and
1621: .Sx \&Ox .
1622: .
1.63 kristaps 1623: .Ss \&Va
1624: .Ss \&Vt
1625: .Ss \&Xc
1626: .Ss \&Xo
1627: .Ss \&Xr
1628: .Ss \&br
1629: .Ss \&sp
1630: .
1631: .
1.4 kristaps 1632: .Sh COMPATIBILITY
1.28 kristaps 1633: This section documents compatibility with other roff implementations, at
1.50 kristaps 1634: this time limited to
1.57 kristaps 1635: .Xr groff 1 .
1.50 kristaps 1636: The term
1.57 kristaps 1637: .Qq historic groff
1.50 kristaps 1638: refers to those versions before the
1.57 kristaps 1639: .Pa doc.tmac
1.50 kristaps 1640: file re-write
1.57 kristaps 1641: .Pq somewhere between 1.15 and 1.19 .
1642: .
1643: .Pp
1644: .Bl -dash -compact
1645: .It
1.61 kristaps 1646: Negative scaling units are now truncated to zero instead of creating
1647: interesting conditions, such as with
1648: .Sq \&sp -1i .
1649: Furthermore, the
1650: .Sq f
1651: scaling unit, while accepted, is rendered as the default unit.
1652: .It
1.48 kristaps 1653: In quoted literals, groff allowed pair-wise double-quotes to produce a
1654: standalone double-quote in formatted output. This idiosyncratic
1655: behaviour is no longer applicable.
1.57 kristaps 1656: .It
1.64 kristaps 1657: Display types
1658: .Sx \&Bd Fl center
1659: and
1660: .Fl right
1661: are aliases for
1662: .Fl left .
1.50 kristaps 1663: The
1.64 kristaps 1664: .Fl file Ar file
1665: argument is ignored. Since text is not right-justified,
1666: .Fl ragged
1667: and
1668: .Fl filled
1669: are aliases, as are
1670: .Fl literal
1671: and
1672: .Fl unfilled .
1.57 kristaps 1673: .It
1.35 kristaps 1674: Blocks of whitespace are stripped from both macro and free-form text
1675: lines (except when in literal mode), while groff would retain whitespace
1676: in free-form text lines.
1.57 kristaps 1677: .It
1.28 kristaps 1678: Historic groff has many un-callable macros. Most of these (excluding
1679: some block-level macros) are now callable, conforming to the
1680: non-historic groff version.
1.57 kristaps 1681: .It
1.50 kristaps 1682: The vertical bar
1.57 kristaps 1683: .Sq \(ba
1.28 kristaps 1684: made historic groff
1.57 kristaps 1685: .Qq go orbital
1.28 kristaps 1686: but is a proper delimiter in this implementation.
1.57 kristaps 1687: .It
1.64 kristaps 1688: .Sx \&It Fl nested
1.28 kristaps 1689: is assumed for all lists (it wasn't in historic groff): any list may be
1690: nested and
1.64 kristaps 1691: .Fl enum
1.4 kristaps 1692: lists will restart the sequence only for the sub-list.
1.57 kristaps 1693: .It
1.4 kristaps 1694: Some manuals use
1.64 kristaps 1695: .Sx \&Li
1.4 kristaps 1696: incorrectly by following it with a reserved character and expecting the
1697: delimiter to render. This is not supported.
1.57 kristaps 1698: .It
1.50 kristaps 1699: In groff, the
1.64 kristaps 1700: .Sx \&Fo
1.41 kristaps 1701: macro only produces the first parameter. This is no longer the case.
1.57 kristaps 1702: .El
1.56 kristaps 1703: .
1704: .
1.2 kristaps 1705: .Sh SEE ALSO
1.57 kristaps 1706: .Xr mandoc 1 ,
1707: .Xr mandoc_char 7
1.56 kristaps 1708: .
1709: .
1.2 kristaps 1710: .Sh AUTHORS
1711: The
1.57 kristaps 1712: .Nm
1.50 kristaps 1713: reference was written by
1.57 kristaps 1714: .An Kristaps Dzonsons Aq kristaps@kth.se .
1.64 kristaps 1715: .\"
1716: .\" XXX: this really isn't the place for these caveats.
1717: .\" .
1718: .\" .
1719: .\" .Sh CAVEATS
1720: .\" There are many ambiguous parts of mdoc.
1721: .\" .
1722: .\" .Pp
1723: .\" .Bl -dash -compact
1724: .\" .It
1725: .\" .Sq \&Fa
1726: .\" should be
1727: .\" .Sq \&Va
1728: .\" as function arguments are variables.
1729: .\" .It
1730: .\" .Sq \&Ft
1731: .\" should be
1732: .\" .Sq \&Vt
1733: .\" as function return types are still types. Furthermore, the
1734: .\" .Sq \&Ft
1735: .\" should be removed and
1736: .\" .Sq \&Fo ,
1737: .\" which ostensibly follows it, should follow the same convention as
1738: .\" .Sq \&Va .
1739: .\" .It
1740: .\" .Sq \&Va
1741: .\" should formalise that only one or two arguments are acceptable: a
1742: .\" variable name and optional, preceding type.
1743: .\" .It
1744: .\" .Sq \&Fd
1745: .\" is ambiguous. It's commonly used to indicate an include file in the
1746: .\" synopsis section.
1747: .\" .Sq \&In
1748: .\" should be used, instead.
1749: .\" .It
1750: .\" Only the
1751: .\" .Sq \-literal
1752: .\" argument to
1753: .\" .Sq \&Bd
1754: .\" makes sense. The remaining ones should be removed.
1755: .\" .It
1756: .\" The
1757: .\" .Sq \&Xo
1758: .\" and
1759: .\" .Sq \&Xc
1760: .\" macros should be deprecated.
1761: .\" .It
1762: .\" The
1763: .\" .Sq \&Dt
1764: .\" macro lacks clarity. It should be absolutely clear which title will
1765: .\" render when formatting the manual page.
1766: .\" .It
1767: .\" A
1768: .\" .Sq \&Lx
1769: .\" should be provided for Linux (\(`a la
1770: .\" .Sq \&Ox ,
1771: .\" .Sq \&Nx
1772: .\" etc.).
1773: .\" .It
1774: .\" There's no way to refer to references in
1775: .\" .Sq \&Rs/Re
1776: .\" blocks.
1777: .\" .It
1778: .\" The \-split and \-nosplit dictates via
1779: .\" .Sq \&An
1780: .\" are re-set when entering and leaving the AUTHORS section.
1781: .\" .El
1782: .\" .
CVSweb