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