Annotation of mandoc/mdoc.7, Revision 1.119
1.119 ! kristaps 1: .\" $Id: mdoc.7,v 1.118 2010/06/04 21:49:39 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.118 kristaps 17: .Dd $Mdocdate: June 4 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.118 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.118 kristaps 125: the current font scope only: if a macro opens a font scope alongside
1.77 kristaps 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,
1.107 kristaps 304: or question mark followed by zero or more non-sentence closing
305: delimiters (
306: .Ns Sq \&) ,
307: .Sq \&] ,
308: .Sq \&' ,
309: .Sq \&" ) .
1.102 kristaps 310: .Pp
311: The proper spacing is also intelligently preserved if a sentence ends at
1.107 kristaps 312: the boundary of a macro line, e.g.,
313: .Pp
314: .D1 \&Xr mandoc 1 \.
315: .D1 \&Fl T \&Ns \&Cm ascii \.
1.43 kristaps 316: .Sh MANUAL STRUCTURE
1.66 kristaps 317: A well-formed
1.57 kristaps 318: .Nm
1.66 kristaps 319: document consists of a document prologue followed by one or more
320: sections.
321: .Pp
322: The prologue, which consists of (in order) the
1.64 kristaps 323: .Sx \&Dd ,
324: .Sx \&Dt ,
1.33 kristaps 325: and
1.66 kristaps 326: .Sx \&Os
327: macros, is required for every document.
328: .Pp
1.82 kristaps 329: The first section (sections are denoted by
1.66 kristaps 330: .Sx \&Sh )
331: must be the NAME section, consisting of at least one
1.64 kristaps 332: .Sx \&Nm
1.50 kristaps 333: followed by
1.66 kristaps 334: .Sx \&Nd .
335: .Pp
336: Following that, convention dictates specifying at least the SYNOPSIS and
337: DESCRIPTION sections, although this varies between manual sections.
338: .Pp
339: The following is a well-formed skeleton
340: .Nm
341: file:
1.57 kristaps 342: .Bd -literal -offset indent
1.43 kristaps 343: \&.Dd $\&Mdocdate$
344: \&.Dt mdoc 7
345: \&.Os
346: \&.Sh NAME
1.58 kristaps 347: \&.Nm foo
348: \&.Nd a description goes here
1.108 kristaps 349: \&.\e\*q The next is for sections 2, 3, & 9 only.
1.58 kristaps 350: \&.\e\*q .Sh LIBRARY
351: \&.Sh SYNOPSIS
352: \&.Nm foo
353: \&.Op Fl options
354: \&.Ar
355: \&.Sh DESCRIPTION
356: The
357: \&.Nm
358: utility processes files ...
1.59 kristaps 359: \&.\e\*q .Sh IMPLEMENTATION NOTES
1.58 kristaps 360: \&.\e\*q The next is for sections 2, 3, & 9 only.
361: \&.\e\*q .Sh RETURN VALUES
362: \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
363: \&.\e\*q .Sh ENVIRONMENT
364: \&.\e\*q .Sh FILES
1.99 kristaps 365: \&.\e\*q The next is for sections 1 & 8 only.
366: \&.\e\*q .Sh EXIT STATUS
1.58 kristaps 367: \&.\e\*q .Sh EXAMPLES
368: \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
369: \&.\e\*q .Sh DIAGNOSTICS
370: \&.\e\*q The next is for sections 2, 3, & 9 only.
371: \&.\e\*q .Sh ERRORS
372: \&.\e\*q .Sh SEE ALSO
373: \&.\e\*q .Xr foobar 1
374: \&.\e\*q .Sh STANDARDS
375: \&.\e\*q .Sh HISTORY
376: \&.\e\*q .Sh AUTHORS
377: \&.\e\*q .Sh CAVEATS
378: \&.\e\*q .Sh BUGS
379: \&.\e\*q .Sh SECURITY CONSIDERATIONS
1.57 kristaps 380: .Ed
381: .Pp
1.66 kristaps 382: The sections in a
383: .Nm
1.100 kristaps 384: document are conventionally ordered as they appear above.
385: Sections should be composed as follows:
1.73 kristaps 386: .Bl -ohang -offset Ds
387: .It Em NAME
1.100 kristaps 388: The name(s) and a short description of the documented material.
389: The syntax for this as follows:
1.73 kristaps 390: .Bd -literal -offset indent
391: \&.Nm name0
392: \&.Nm name1
393: \&.Nm name2
394: \&.Nd a short description
395: .Ed
396: .Pp
397: The
1.66 kristaps 398: .Sx \&Nm
1.73 kristaps 399: macro(s) must precede the
400: .Sx \&Nd
401: macro.
1.80 kristaps 402: .Pp
1.82 kristaps 403: See
1.80 kristaps 404: .Sx \&Nm
405: and
406: .Sx \&Nd .
1.73 kristaps 407: .It Em LIBRARY
408: The name of the library containing the documented material, which is
1.108 kristaps 409: assumed to be a function in a section 2, 3, or 9 manual.
1.100 kristaps 410: The syntax for this is as follows:
1.73 kristaps 411: .Bd -literal -offset indent
412: \&.Lb libarm
413: .Ed
414: .Pp
415: See
1.80 kristaps 416: .Sx \&Lb .
1.73 kristaps 417: .It Em SYNOPSIS
418: Documents the utility invocation syntax, function call syntax, or device
1.82 kristaps 419: configuration.
1.73 kristaps 420: .Pp
421: For the first, utilities (sections 1, 6, and 8), this is
422: generally structured as follows:
423: .Bd -literal -offset indent
424: \&.Nm foo
425: \&.Op Fl v
426: \&.Op Fl o Ar file
427: \&.Op Ar
428: \&.Nm bar
429: \&.Op Fl v
430: \&.Op Fl o Ar file
431: \&.Op Ar
432: .Ed
433: .Pp
434: For the second, function calls (sections 2, 3, 9):
435: .Bd -literal -offset indent
436: \&.Vt extern const char *global;
437: \&.In header.h
438: \&.Ft "char *"
439: \&.Fn foo "const char *src"
440: \&.Ft "char *"
441: \&.Fn bar "const char *src"
442: .Ed
443: .Pp
444: And for the third, configurations (section 4):
445: .Bd -literal -offset indent
446: \&.Cd \*qit* at isa? port 0x2e\*q
447: \&.Cd \*qit* at isa? port 0x4e\*q
448: .Ed
449: .Pp
1.82 kristaps 450: Manuals not in these sections generally don't need a
1.73 kristaps 451: .Em SYNOPSIS .
1.80 kristaps 452: .Pp
1.82 kristaps 453: See
1.80 kristaps 454: .Sx \&Op ,
455: .Sx \&Cd ,
456: .Sx \&Fn ,
457: .Sx \&Ft ,
458: and
459: .Sx \&Vt .
1.73 kristaps 460: .It Em DESCRIPTION
1.82 kristaps 461: This expands upon the brief, one-line description in
1.73 kristaps 462: .Em NAME .
463: It usually contains a break-down of the options (if documenting a
464: command), such as:
465: .Bd -literal -offset indent
466: The arguments are as follows:
467: \&.Bl \-tag \-width Ds
468: \&.It Fl v
469: Print verbose information.
470: \&.El
471: .Ed
1.80 kristaps 472: .Pp
1.73 kristaps 473: Manuals not documenting a command won't include the above fragment.
474: .It Em IMPLEMENTATION NOTES
1.100 kristaps 475: Implementation-specific notes should be kept here.
476: This is useful when implementing standard functions that may have side
477: effects or notable algorithmic implications.
1.73 kristaps 478: .It Em RETURN VALUES
479: This section is the dual of
480: .Em EXIT STATUS ,
1.100 kristaps 481: which is used for commands.
482: It documents the return values of functions in sections 2, 3, and 9.
1.73 kristaps 483: .Pp
484: See
485: .Sx \&Rv .
486: .It Em ENVIRONMENT
487: Documents any usages of environment variables, e.g.,
488: .Xr environ 7 .
489: .Pp
490: See
491: .Sx \&Ev .
492: .It Em FILES
1.100 kristaps 493: Documents files used.
494: It's helpful to document both the file and a short description of how
495: the file is used (created, modified, etc.).
1.73 kristaps 496: .Pp
497: See
498: .Sx \&Pa .
1.99 kristaps 499: .It Em EXIT STATUS
1.100 kristaps 500: Command exit status for section 1, 6, and 8 manuals.
501: This section is the dual of
1.99 kristaps 502: .Em RETURN VALUES ,
1.100 kristaps 503: which is used for functions.
504: Historically, this information was described in
1.99 kristaps 505: .Em DIAGNOSTICS ,
506: a practise that is now discouraged.
507: .Pp
508: See
509: .Sx \&Ex .
1.73 kristaps 510: .It Em EXAMPLES
1.100 kristaps 511: Example usages.
512: This often contains snippets of well-formed, well-tested invocations.
513: Make doubly sure that your examples work properly!
1.73 kristaps 514: .It Em DIAGNOSTICS
1.100 kristaps 515: Documents error conditions.
516: This is most useful in section 4 manuals.
1.73 kristaps 517: Historically, this section was used in place of
518: .Em EXIT STATUS
519: for manuals in sections 1, 6, and 8; however, this practise is
520: discouraged.
521: .Pp
522: See
1.80 kristaps 523: .Sx \&Bl
524: .Fl diag .
1.73 kristaps 525: .It Em ERRORS
526: Documents error handling in sections 2, 3, and 9.
527: .Pp
528: See
529: .Sx \&Er .
530: .It Em SEE ALSO
1.100 kristaps 531: References other manuals with related topics.
532: This section should exist for most manuals.
533: Cross-references should conventionally be ordered first by section, then
534: alphabetically.
1.73 kristaps 535: .Pp
536: See
537: .Sx \&Xr .
538: .It Em STANDARDS
1.100 kristaps 539: References any standards implemented or used.
540: If not adhering to any standards, the
1.73 kristaps 541: .Em HISTORY
542: section should be used instead.
543: .Pp
544: See
545: .Sx \&St .
546: .It Em HISTORY
547: The history of any manual without a
548: .Em STANDARDS
549: section should be described in this section.
550: .It Em AUTHORS
551: Credits to authors, if applicable, should appear in this section.
552: Authors should generally be noted by both name and an e-mail address.
553: .Pp
554: See
555: .Sx \&An .
556: .It Em CAVEATS
557: Explanations of common misuses and misunderstandings should be explained
558: in this section.
559: .It Em BUGS
560: Extant bugs should be described in this section.
561: .It Em SECURITY CONSIDERATIONS
562: Documents any security precautions that operators should consider.
1.66 kristaps 563: .El
1.43 kristaps 564: .Sh MACRO SYNTAX
1.56 kristaps 565: Macros are one to three three characters in length and begin with a
566: control character ,
1.57 kristaps 567: .Sq \&. ,
1.100 kristaps 568: at the beginning of the line.
569: An arbitrary amount of whitespace may sit between the control character
570: and the macro name.
571: Thus, the following are equivalent:
1.64 kristaps 572: .Bd -literal -offset indent
573: \&.Pp
574: \&.\ \ \ \&Pp
575: .Ed
1.57 kristaps 576: .Pp
1.100 kristaps 577: The syntax of a macro depends on its classification.
578: In this section,
1.57 kristaps 579: .Sq \-arg
1.43 kristaps 580: refers to macro arguments, which may be followed by zero or more
1.57 kristaps 581: .Sq parm
1.43 kristaps 582: parameters;
1.57 kristaps 583: .Sq \&Yo
1.43 kristaps 584: opens the scope of a macro; and if specified,
1.57 kristaps 585: .Sq \&Yc
1.43 kristaps 586: closes it out.
1.57 kristaps 587: .Pp
1.43 kristaps 588: The
1.57 kristaps 589: .Em Callable
1.43 kristaps 590: column indicates that the macro may be called subsequent to the initial
1.100 kristaps 591: line-macro.
592: If a macro is not callable, then its invocation after the initial line
593: macro is interpreted as opaque text, such that
1.60 kristaps 594: .Sq \&.Fl \&Sh
1.55 kristaps 595: produces
1.60 kristaps 596: .Sq Fl \&Sh .
1.57 kristaps 597: .Pp
1.55 kristaps 598: The
1.57 kristaps 599: .Em Parsable
1.43 kristaps 600: column indicates whether the macro may be followed by further
1.100 kristaps 601: (ostensibly callable) macros.
602: If a macro is not parsable, subsequent macro invocations on the line
603: will be interpreted as opaque text.
1.57 kristaps 604: .Pp
1.55 kristaps 605: The
1.57 kristaps 606: .Em Scope
1.43 kristaps 607: column, if applicable, describes closure rules.
1.57 kristaps 608: .Ss Block full-explicit
1.100 kristaps 609: Multi-line scope closed by an explicit closing macro.
610: All macros contains bodies; only
1.64 kristaps 611: .Sx \&Bf
1.43 kristaps 612: contains a head.
1.57 kristaps 613: .Bd -literal -offset indent
1.50 kristaps 614: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
615: \(lBbody...\(rB
1.43 kristaps 616: \&.Yc
1.57 kristaps 617: .Ed
618: .Pp
619: .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
620: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
1.64 kristaps 621: .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
622: .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
623: .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
624: .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
625: .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
626: .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
627: .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
628: .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
1.57 kristaps 629: .El
630: .Ss Block full-implicit
1.43 kristaps 631: Multi-line scope closed by end-of-file or implicitly by another macro.
1.50 kristaps 632: All macros have bodies; some
1.57 kristaps 633: .Po
1.64 kristaps 634: .Sx \&It Fl bullet ,
635: .Fl hyphen ,
636: .Fl dash ,
637: .Fl enum ,
638: .Fl item
1.57 kristaps 639: .Pc
1.64 kristaps 640: don't have heads; only one
641: .Po
642: .Sx \&It Fl column
1.82 kristaps 643: .Pc
1.64 kristaps 644: has multiple heads.
1.57 kristaps 645: .Bd -literal -offset indent
1.50 kristaps 646: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
647: \(lBbody...\(rB
1.57 kristaps 648: .Ed
649: .Pp
650: .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
651: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
1.64 kristaps 652: .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
653: .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
654: .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
655: .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
1.57 kristaps 656: .El
657: .Ss Block partial-explicit
1.100 kristaps 658: Like block full-explicit, but also with single-line scope.
659: Each has at least a body and, in limited circumstances, a head
1.64 kristaps 660: .Po
661: .Sx \&Fo ,
662: .Sx \&Eo
663: .Pc
1.50 kristaps 664: and/or tail
1.64 kristaps 665: .Pq Sx \&Ec .
1.57 kristaps 666: .Bd -literal -offset indent
1.50 kristaps 667: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
668: \(lBbody...\(rB
669: \&.Yc \(lBtail...\(rB
1.2 kristaps 670:
1.43 kristaps 671: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
1.50 kristaps 672: \(lBbody...\(rB \&Yc \(lBtail...\(rB
1.57 kristaps 673: .Ed
674: .Pp
675: .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
676: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
1.64 kristaps 677: .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
1.63 kristaps 678: .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
1.64 kristaps 679: .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
680: .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
681: .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
682: .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
683: .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
684: .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
685: .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
686: .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
687: .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
688: .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
689: .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
690: .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
691: .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
692: .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
693: .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
694: .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
1.63 kristaps 695: .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
696: .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
1.64 kristaps 697: .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
698: .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
699: .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
700: .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
1.57 kristaps 701: .El
702: .Ss Block partial-implicit
1.50 kristaps 703: Like block full-implicit, but with single-line scope closed by
1.57 kristaps 704: .Sx Reserved Characters
1.43 kristaps 705: or end of line.
1.57 kristaps 706: .Bd -literal -offset indent
1.43 kristaps 707: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
1.57 kristaps 708: .Ed
709: .Pp
710: .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
711: .It Em Macro Ta Em Callable Ta Em Parsable
1.64 kristaps 712: .It Sx \&Aq Ta Yes Ta Yes
713: .It Sx \&Bq Ta Yes Ta Yes
714: .It Sx \&Brq Ta Yes Ta Yes
715: .It Sx \&D1 Ta \&No Ta \&Yes
716: .It Sx \&Dl Ta \&No Ta Yes
717: .It Sx \&Dq Ta Yes Ta Yes
718: .It Sx \&Op Ta Yes Ta Yes
719: .It Sx \&Pq Ta Yes Ta Yes
720: .It Sx \&Ql Ta Yes Ta Yes
721: .It Sx \&Qq Ta Yes Ta Yes
722: .It Sx \&Sq Ta Yes Ta Yes
1.83 kristaps 723: .It Sx \&Vt Ta Yes Ta Yes
1.57 kristaps 724: .El
1.83 kristaps 725: .Pp
726: Note that the
727: .Sx \&Vt
728: macro is a
729: .Sx Block partial-implicit
730: only when invoked as the first macro
1.109 kristaps 731: in a
732: .Em SYNOPSIS
733: section line, else it is
1.83 kristaps 734: .Sx In-line .
1.57 kristaps 735: .Ss In-line
1.50 kristaps 736: Closed by
1.57 kristaps 737: .Sx Reserved Characters ,
1.100 kristaps 738: end of line, fixed argument lengths, and/or subsequent macros.
739: In-line macros have only text children.
740: If a number (or inequality) of arguments is
1.57 kristaps 741: .Pq n ,
1.3 kristaps 742: then the macro accepts an arbitrary number of arguments.
1.57 kristaps 743: .Bd -literal -offset indent
1.43 kristaps 744: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
745:
746: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
747:
748: \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
1.57 kristaps 749: .Ed
750: .Pp
751: .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
752: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
1.63 kristaps 753: .It Sx \&%A Ta \&No Ta \&No Ta >0
754: .It Sx \&%B Ta \&No Ta \&No Ta >0
755: .It Sx \&%C Ta \&No Ta \&No Ta >0
756: .It Sx \&%D Ta \&No Ta \&No Ta >0
757: .It Sx \&%I Ta \&No Ta \&No Ta >0
758: .It Sx \&%J Ta \&No Ta \&No Ta >0
759: .It Sx \&%N Ta \&No Ta \&No Ta >0
760: .It Sx \&%O Ta \&No Ta \&No Ta >0
761: .It Sx \&%P Ta \&No Ta \&No Ta >0
1.69 kristaps 762: .It Sx \&%Q Ta \&No Ta \&No Ta >0
1.63 kristaps 763: .It Sx \&%R Ta \&No Ta \&No Ta >0
764: .It Sx \&%T Ta \&No Ta \&No Ta >0
1.69 kristaps 765: .It Sx \&%U Ta \&No Ta \&No Ta >0
1.63 kristaps 766: .It Sx \&%V Ta \&No Ta \&No Ta >0
1.64 kristaps 767: .It Sx \&Ad Ta Yes Ta Yes Ta n
768: .It Sx \&An Ta Yes Ta Yes Ta n
769: .It Sx \&Ap Ta Yes Ta Yes Ta 0
770: .It Sx \&Ar Ta Yes Ta Yes Ta n
771: .It Sx \&At Ta Yes Ta Yes Ta 1
772: .It Sx \&Bsx Ta Yes Ta Yes Ta n
773: .It Sx \&Bt Ta \&No Ta \&No Ta 0
774: .It Sx \&Bx Ta Yes Ta Yes Ta n
775: .It Sx \&Cd Ta Yes Ta Yes Ta >0
776: .It Sx \&Cm Ta Yes Ta Yes Ta n
777: .It Sx \&Db Ta \&No Ta \&No Ta 1
778: .It Sx \&Dd Ta \&No Ta \&No Ta >0
779: .It Sx \&Dt Ta \&No Ta \&No Ta n
780: .It Sx \&Dv Ta Yes Ta Yes Ta n
781: .It Sx \&Dx Ta Yes Ta Yes Ta n
782: .It Sx \&Em Ta Yes Ta Yes Ta >0
783: .It Sx \&En Ta \&No Ta \&No Ta 0
784: .It Sx \&Er Ta Yes Ta Yes Ta >0
785: .It Sx \&Es Ta \&No Ta \&No Ta 0
786: .It Sx \&Ev Ta Yes Ta Yes Ta n
787: .It Sx \&Ex Ta \&No Ta \&No Ta n
788: .It Sx \&Fa Ta Yes Ta Yes Ta n
789: .It Sx \&Fd Ta \&No Ta \&No Ta >0
790: .It Sx \&Fl Ta Yes Ta Yes Ta n
791: .It Sx \&Fn Ta Yes Ta Yes Ta >0
792: .It Sx \&Fr Ta \&No Ta \&No Ta n
793: .It Sx \&Ft Ta Yes Ta Yes Ta n
794: .It Sx \&Fx Ta Yes Ta Yes Ta n
795: .It Sx \&Hf Ta \&No Ta \&No Ta n
796: .It Sx \&Ic Ta Yes Ta Yes Ta >0
797: .It Sx \&In Ta \&No Ta \&No Ta n
798: .It Sx \&Lb Ta \&No Ta \&No Ta 1
799: .It Sx \&Li Ta Yes Ta Yes Ta n
800: .It Sx \&Lk Ta Yes Ta Yes Ta n
801: .It Sx \&Lp Ta \&No Ta \&No Ta 0
802: .It Sx \&Ms Ta Yes Ta Yes Ta >0
803: .It Sx \&Mt Ta Yes Ta Yes Ta >0
804: .It Sx \&Nm Ta Yes Ta Yes Ta n
805: .It Sx \&No Ta Yes Ta Yes Ta 0
806: .It Sx \&Ns Ta Yes Ta Yes Ta 0
807: .It Sx \&Nx Ta Yes Ta Yes Ta n
808: .It Sx \&Os Ta \&No Ta \&No Ta n
809: .It Sx \&Ot Ta \&No Ta \&No Ta n
810: .It Sx \&Ox Ta Yes Ta Yes Ta n
811: .It Sx \&Pa Ta Yes Ta Yes Ta n
1.88 kristaps 812: .It Sx \&Pf Ta Yes Ta Yes Ta 1
1.64 kristaps 813: .It Sx \&Pp Ta \&No Ta \&No Ta 0
814: .It Sx \&Rv Ta \&No Ta \&No Ta n
815: .It Sx \&Sm Ta \&No Ta \&No Ta 1
816: .It Sx \&St Ta \&No Ta Yes Ta 1
817: .It Sx \&Sx Ta Yes Ta Yes Ta >0
818: .It Sx \&Sy Ta Yes Ta Yes Ta >0
819: .It Sx \&Tn Ta Yes Ta Yes Ta >0
820: .It Sx \&Ud Ta \&No Ta \&No Ta 0
821: .It Sx \&Ux Ta Yes Ta Yes Ta n
822: .It Sx \&Va Ta Yes Ta Yes Ta n
823: .It Sx \&Vt Ta Yes Ta Yes Ta >0
1.84 kristaps 824: .It Sx \&Xr Ta Yes Ta Yes Ta >0
1.64 kristaps 825: .It Sx \&br Ta \&No Ta \&No Ta 0
826: .It Sx \&sp Ta \&No Ta \&No Ta 1
1.82 kristaps 827: .El
1.63 kristaps 828: .Sh REFERENCE
829: This section is a canonical reference of all macros, arranged
1.100 kristaps 830: alphabetically.
831: For the scoping of individual macros, see
1.63 kristaps 832: .Sx MACRO SYNTAX .
833: .Ss \&%A
834: Author name of an
835: .Sx \&Rs
836: block. Multiple authors should each be accorded their own
1.64 kristaps 837: .Sx \%%A
1.66 kristaps 838: line. Author names should be ordered with full or abbreviated
839: forename(s) first, then full surname.
1.63 kristaps 840: .Ss \&%B
841: Book title of an
842: .Sx \&Rs
843: block. This macro may also be used in a non-bibliographic context when
844: referring to book titles.
845: .Ss \&%C
846: Publication city or location of an
847: .Sx \&Rs
848: block.
849: .Pp
1.65 kristaps 850: .Em Remarks :
1.63 kristaps 851: this macro is not implemented in
852: .Xr groff 1 .
853: .Ss \&%D
854: Publication date of an
855: .Sx \&Rs
1.72 kristaps 856: block. This should follow the reduced or canonical form syntax
857: described in
1.63 kristaps 858: .Sx Dates .
859: .Ss \&%I
860: Publisher or issuer name of an
861: .Sx \&Rs
862: block.
863: .Ss \&%J
864: Journal name of an
865: .Sx \&Rs
866: block.
867: .Ss \&%N
868: Issue number (usually for journals) of an
869: .Sx \&Rs
870: block.
871: .Ss \&%O
872: Optional information of an
873: .Sx \&Rs
874: block.
875: .Ss \&%P
876: Book or journal page number of an
877: .Sx \&Rs
878: block.
879: .Ss \&%Q
880: Institutional author (school, government, etc.) of an
881: .Sx \&Rs
882: block. Multiple institutional authors should each be accorded their own
1.64 kristaps 883: .Sx \&%Q
1.63 kristaps 884: line.
885: .Ss \&%R
886: Technical report name of an
887: .Sx \&Rs
888: block.
889: .Ss \&%T
890: Article title of an
891: .Sx \&Rs
892: block. This macro may also be used in a non-bibliographical context
893: when referring to article titles.
1.69 kristaps 894: .Ss \&%U
1.70 kristaps 895: URI of reference document.
1.63 kristaps 896: .Ss \&%V
897: Volume number of an
898: .Sx \&Rs
899: block.
900: .Ss \&Ac
901: Closes an
902: .Sx \&Ao
903: block. Does not have any tail arguments.
904: .Ss \&Ad
905: Address construct: usually in the context of an computational address in
906: memory, not a physical (post) address.
907: .Pp
1.64 kristaps 908: Examples:
1.91 kristaps 909: .D1 \&.Ad [0,$]
910: .D1 \&.Ad 0x00000000
1.63 kristaps 911: .Ss \&An
1.100 kristaps 912: Author name.
913: This macro may alternatively accepts the following arguments, although
914: these may not be specified along with a parameter:
1.64 kristaps 915: .Bl -tag -width 12n -offset indent
916: .It Fl split
1.66 kristaps 917: Renders a line break before each author listing.
1.64 kristaps 918: .It Fl nosplit
919: The opposite of
920: .Fl split .
921: .El
922: .Pp
923: In the AUTHORS section, the default is not to split the first author
924: listing, but all subsequent author listings, whether or not they're
1.100 kristaps 925: interspersed by other macros or text, are split.
926: Thus, specifying
1.64 kristaps 927: .Fl split
1.100 kristaps 928: will cause the first listing also to be split.
929: If not in the AUTHORS section, the default is not to split.
1.64 kristaps 930: .Pp
931: Examples:
1.91 kristaps 932: .D1 \&.An -nosplit
933: .D1 \&.An J. D. Ullman .
1.64 kristaps 934: .Pp
935: .Em Remarks :
936: the effects of
937: .Fl split
938: or
939: .Fl nosplit
940: are re-set when entering the AUTHORS section, so if one specifies
941: .Sx \&An Fl nosplit
942: in the general document body, it must be re-specified in the AUTHORS
943: section.
1.63 kristaps 944: .Ss \&Ao
1.100 kristaps 945: Begins a block enclosed by angled brackets.
946: Does not have any head arguments.
1.63 kristaps 947: .Pp
1.64 kristaps 948: Examples:
1.91 kristaps 949: .D1 \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
1.63 kristaps 950: .Pp
1.64 kristaps 951: See also
952: .Sx \&Aq .
1.63 kristaps 953: .Ss \&Ap
1.100 kristaps 954: Inserts an apostrophe without any surrounding white-space.
955: This is generally used as a grammatic device when referring to the verb
956: form of a function:
1.64 kristaps 957: .Bd -literal -offset indent
958: \&.Fn execve Ap d
959: .Ed
1.63 kristaps 960: .Ss \&Aq
1.82 kristaps 961: Encloses its arguments in angled brackets.
1.64 kristaps 962: .Pp
963: Examples:
1.91 kristaps 964: .D1 \&.Fl -key= \&Ns \&Aq \&Ar val
1.64 kristaps 965: .Pp
966: .Em Remarks :
967: this macro is often abused for rendering URIs, which should instead use
968: .Sx \&Lk
969: or
970: .Sx \&Mt ,
971: or to note pre-processor
972: .Dq Li #include
973: statements, which should use
974: .Sx \&In .
975: .Pp
976: See also
977: .Sx \&Ao .
1.63 kristaps 978: .Ss \&Ar
1.100 kristaps 979: Command arguments.
980: If an argument is not provided, the string
1.64 kristaps 981: .Dq file ...
1.66 kristaps 982: is used as a default.
1.64 kristaps 983: .Pp
984: Examples:
1.91 kristaps 985: .D1 \&.Fl o \&Ns \&Ar file1
986: .D1 \&.Ar
987: .D1 \&.Ar arg1 , arg2 .
1.63 kristaps 988: .Ss \&At
1.100 kristaps 989: Formats an AT&T version.
990: Accepts at most one parameter:
1.64 kristaps 991: .Bl -tag -width 12n -offset indent
992: .It Cm v[1-7] | 32v
993: A version of
994: .At .
995: .It Cm V[.[1-4]]?
996: A system version of
997: .At .
998: .El
999: .Pp
1000: Note that these parameters do not begin with a hyphen.
1001: .Pp
1002: Examples:
1.91 kristaps 1003: .D1 \&.At
1004: .D1 \&.At V.1
1.65 kristaps 1005: .Pp
1006: See also
1.66 kristaps 1007: .Sx \&Bsx ,
1.65 kristaps 1008: .Sx \&Bx ,
1.66 kristaps 1009: .Sx \&Dx ,
1.65 kristaps 1010: .Sx \&Fx ,
1011: .Sx \&Nx ,
1012: .Sx \&Ox ,
1013: and
1014: .Sx \&Ux .
1.63 kristaps 1015: .Ss \&Bc
1.64 kristaps 1016: Closes a
1017: .Sx \&Bo
1018: block. Does not have any tail arguments.
1.63 kristaps 1019: .Ss \&Bd
1.100 kristaps 1020: Begins a display block.
1021: A display is collection of macros or text which may be collectively
1022: offset or justified in a manner different from that
1023: of the enclosing context.
1024: By default, the block is preceded by a vertical space.
1.64 kristaps 1025: .Pp
1026: Each display is associated with a type, which must be one of the
1027: following arguments:
1028: .Bl -tag -width 12n -offset indent
1029: .It Fl ragged
1030: Only left-justify the block.
1031: .It Fl unfilled
1032: Do not justify the block at all.
1033: .It Fl filled
1034: Left- and right-justify the block.
1035: .It Fl literal
1036: Alias for
1037: .Fl unfilled .
1038: .It Fl centered
1039: Centre-justify each line.
1040: .El
1041: .Pp
1.100 kristaps 1042: The type must be provided first.
1043: Secondary arguments are as follows:
1.64 kristaps 1044: .Bl -tag -width 12n -offset indent
1045: .It Fl offset Ar width
1046: Offset by the value of
1047: .Ar width ,
1048: which is interpreted as one of the following, specified in order:
1049: .Bl -item
1050: .It
1051: As one of the pre-defined strings
1052: .Ar indent ,
1053: the width of standard indentation;
1054: .Ar indent-two ,
1055: twice
1056: .Ar indent ;
1057: .Ar left ,
1058: which has no effect ;
1059: .Ar right ,
1060: which justifies to the right margin; and
1061: .Ar center ,
1062: which aligns around an imagined centre axis.
1063: .It
1.100 kristaps 1064: As a precalculated width for a named macro.
1065: The most popular is the imaginary macro
1.67 kristaps 1066: .Ar \&Ds ,
1.64 kristaps 1067: which resolves to
1068: .Ar 6n .
1069: .It
1070: As a scaling unit following the syntax described in
1071: .Sx Scaling Widths .
1072: .It
1073: As the calculated string length of the opaque string.
1074: .El
1075: .Pp
1076: If unset, it will revert to the value of
1077: .Ar 8n
1078: as described in
1079: .Sx Scaling Widths .
1080: .It Fl compact
1081: Do not assert a vertical space before the block.
1082: .It Fl file Ar file
1083: Prepend the file
1084: .Ar file
1085: before any text or macros within the block.
1086: .El
1087: .Pp
1088: Examples:
1089: .Bd -literal -offset indent
1090: \&.Bd \-unfilled \-offset two-indent \-compact
1.65 kristaps 1091: Hello world.
1.64 kristaps 1092: \&.Ed
1093: .Ed
1.66 kristaps 1094: .Pp
1095: See also
1096: .Sx \&D1
1097: and
1098: .Sx \&Dl .
1.63 kristaps 1099: .Ss \&Bf
1100: .Ss \&Bk
1101: .Ss \&Bl
1.103 kristaps 1102: Begins a list composed of one or more list entries.
1.104 kristaps 1103: A list is associated with a type, which is a required argument.
1104: Other arguments are
1105: .Fl width ,
1106: defined per-type as accepting a literal or
1107: .Sx Scaling Widths
1108: value;
1109: .Fl offset ,
1110: also accepting a literal or
1111: .Sx Scaling Widths
1112: value setting the list's global offset; and
1113: .Fl compact ,
1114: suppressing the default vertical space printed before each list entry.
1.103 kristaps 1115: A list entry is specified by the
1116: .Sx \&It
1117: macro, which consists of a head and optional body (depending on the list
1118: type).
1119: A list must specify one of the following list types:
1120: .Bl -tag -width 12n -offset indent
1121: .It Fl bullet
1122: A list offset by a bullet.
1123: The head of list entries must be empty.
1124: List entry bodies are positioned after the bullet.
1.104 kristaps 1125: The
1126: .Fl width
1127: argument varies the width of list bodies' left-margins.
1.103 kristaps 1128: .It Fl column
1129: A columnated list.
1.104 kristaps 1130: The
1131: .Fl width
1132: argument has no effect.
1.103 kristaps 1133: The number of columns is specified as parameters to the
1134: .Sx \&Bl
1135: macro.
1136: These dictate the width of columns either as
1137: .Sx Scaling Widths
1138: or literal text.
1.114 kristaps 1139: If the initial macro of a
1140: .Fl column
1141: list is not an
1142: .Sx \&It ,
1143: an
1144: .Sx \&It
1145: context spanning each line is implied until an
1146: .Sx \&It
1147: line macro is encountered, at which point list bodies are interpreted as
1148: described in the
1149: .Sx \&It
1150: documentation.
1.103 kristaps 1151: .It Fl dash
1152: A list offset by a dash (hyphen).
1153: The head of list entries must be empty.
1154: List entry bodies are positioned past the dash.
1.104 kristaps 1155: The
1156: .Fl width
1157: argument varies the width of list bodies' left-margins.
1.103 kristaps 1158: .It Fl diag
1159: Like
1160: .Fl inset ,
1161: but with additional formatting to the head.
1.104 kristaps 1162: The
1163: .Fl width
1164: argument varies the width of list bodies' left-margins.
1.103 kristaps 1165: .It Fl enum
1166: An enumerated list offset by the enumeration from 1.
1167: The head of list entries must be empty.
1168: List entry bodies are positioned after the enumeration.
1.104 kristaps 1169: The
1170: .Fl width
1171: argument varies the width of list bodies' left-margins.
1.103 kristaps 1172: .It Fl hang
1173: Like
1174: .Fl tag ,
1175: but instead of list bodies positioned after the head, they trail the
1176: head text.
1.104 kristaps 1177: The
1178: .Fl width
1179: argument varies the width of list bodies' left-margins.
1.103 kristaps 1180: .It Fl hyphen
1181: Synonym for
1182: .Fl dash .
1183: .It Fl inset
1184: List bodies follow the list head.
1.104 kristaps 1185: The
1186: .Fl width
1187: argument is ignored.
1.103 kristaps 1188: .It Fl item
1189: This produces blocks of text.
1190: The head of list entries must be empty.
1.104 kristaps 1191: The
1192: .Fl width
1193: argument is ignored.
1.103 kristaps 1194: .It Fl ohang
1195: List bodies are positioned on the line following the head.
1.104 kristaps 1196: The
1197: .Fl width
1198: argument is ignored.
1.103 kristaps 1199: .It Fl tag
1200: A list offset by list entry heads. List entry bodies are positioned
1201: after the head as specified by the
1202: .Fl width
1203: argument.
1204: .El
1.114 kristaps 1205: .Pp
1206: See also
1207: .Sx \&It .
1.63 kristaps 1208: .Ss \&Bo
1.100 kristaps 1209: Begins a block enclosed by square brackets.
1210: Does not have any head arguments.
1.65 kristaps 1211: .Pp
1212: Examples:
1213: .Bd -literal -offset indent
1214: \&.Bo 1 ,
1.91 kristaps 1215: \&.Dv BUFSIZ \&Bc
1.65 kristaps 1216: .Ed
1217: .Pp
1218: See also
1219: .Sx \&Bq .
1.63 kristaps 1220: .Ss \&Bq
1.82 kristaps 1221: Encloses its arguments in square brackets.
1.65 kristaps 1222: .Pp
1223: Examples:
1.91 kristaps 1224: .D1 \&.Bq 1 , \&Dv BUFSIZ
1.65 kristaps 1225: .Pp
1226: .Em Remarks :
1227: this macro is sometimes abused to emulate optional arguments for
1228: commands; the correct macros to use for this purpose are
1229: .Sx \&Op ,
1230: .Sx \&Oo ,
1231: and
1232: .Sx \&Oc .
1233: .Pp
1234: See also
1235: .Sx \&Bo .
1.63 kristaps 1236: .Ss \&Brc
1.65 kristaps 1237: Closes a
1238: .Sx \&Bro
1239: block. Does not have any tail arguments.
1.63 kristaps 1240: .Ss \&Bro
1.100 kristaps 1241: Begins a block enclosed by curly braces.
1242: Does not have any head arguments.
1.65 kristaps 1243: .Pp
1244: Examples:
1245: .Bd -literal -offset indent
1246: \&.Bro 1 , ... ,
1.91 kristaps 1247: \&.Va n \&Brc
1.65 kristaps 1248: .Ed
1249: .Pp
1250: See also
1251: .Sx \&Brq .
1.63 kristaps 1252: .Ss \&Brq
1.65 kristaps 1253: Encloses its arguments in curly braces.
1254: .Pp
1255: Examples:
1.91 kristaps 1256: .D1 \&.Brq 1 , ... , \&Va n
1.65 kristaps 1257: .Pp
1258: See also
1259: .Sx \&Bro .
1.63 kristaps 1260: .Ss \&Bsx
1.65 kristaps 1261: Format the BSD/OS version provided as an argument, or a default value if
1262: no argument is provided.
1263: .Pp
1264: Examples:
1.91 kristaps 1265: .D1 \&.Bsx 1.0
1266: .D1 \&.Bsx
1.65 kristaps 1267: .Pp
1268: See also
1269: .Sx \&At ,
1270: .Sx \&Bx ,
1.66 kristaps 1271: .Sx \&Dx ,
1.65 kristaps 1272: .Sx \&Fx ,
1273: .Sx \&Nx ,
1274: .Sx \&Ox ,
1275: and
1276: .Sx \&Ux .
1.63 kristaps 1277: .Ss \&Bt
1.66 kristaps 1278: Prints
1279: .Dq is currently in beta test.
1.63 kristaps 1280: .Ss \&Bx
1.65 kristaps 1281: Format the BSD version provided as an argument, or a default value if no
1282: argument is provided.
1283: .Pp
1284: Examples:
1.91 kristaps 1285: .D1 \&.Bx 4.4
1286: .D1 \&.Bx
1.65 kristaps 1287: .Pp
1288: See also
1289: .Sx \&At ,
1290: .Sx \&Bsx ,
1.66 kristaps 1291: .Sx \&Dx ,
1.65 kristaps 1292: .Sx \&Fx ,
1293: .Sx \&Nx ,
1294: .Sx \&Ox ,
1295: and
1296: .Sx \&Ux .
1.63 kristaps 1297: .Ss \&Cd
1.100 kristaps 1298: Configuration declaration.
1299: This denotes strings accepted by
1.66 kristaps 1300: .Xr config 8 .
1301: .Pp
1302: Examples:
1.91 kristaps 1303: .D1 \&.Cd device le0 at scode?
1.66 kristaps 1304: .Pp
1305: .Em Remarks :
1306: this macro is commonly abused by using quoted literals to retain
1307: white-space and align consecutive
1308: .Sx \&Cd
1.100 kristaps 1309: declarations.
1310: This practise is discouraged.
1.63 kristaps 1311: .Ss \&Cm
1.100 kristaps 1312: Command modifiers.
1313: Useful when specifying configuration options or keys.
1.66 kristaps 1314: .Pp
1315: Examples:
1.91 kristaps 1316: .D1 \&.Cm ControlPath
1317: .D1 \&.Cm ControlMaster
1.66 kristaps 1318: .Pp
1319: See also
1320: .Sx \&Fl .
1.63 kristaps 1321: .Ss \&D1
1.100 kristaps 1322: One-line indented display.
1323: This is formatted by the default rules and is useful for simple indented
1324: statements.
1325: It is followed by a newline.
1.66 kristaps 1326: .Pp
1327: Examples:
1.91 kristaps 1328: .D1 \&.D1 \&Fl abcdefgh
1.66 kristaps 1329: .Pp
1330: See also
1331: .Sx \&Bd
1332: and
1333: .Sx \&Dl .
1.63 kristaps 1334: .Ss \&Db
1.117 kristaps 1335: Start a debugging context.
1336: This macro is parsed, but generally ignored.
1337: Its calling syntax is as follows:
1338: .Pp
1339: .D1 \. Ns Sx \&Db Cm on | off
1.63 kristaps 1340: .Ss \&Dc
1.66 kristaps 1341: Closes a
1342: .Sx \&Do
1343: block. Does not have any tail arguments.
1.63 kristaps 1344: .Ss \&Dd
1.100 kristaps 1345: Document date.
1346: This is the mandatory first macro of any
1.66 kristaps 1347: .Nm
1.100 kristaps 1348: manual.
1349: Its calling syntax is as follows:
1.66 kristaps 1350: .Pp
1351: .D1 \. Ns Sx \&Dd Cm date
1352: .Pp
1.82 kristaps 1353: The
1.66 kristaps 1354: .Cm date
1355: field may be either
1356: .Ar $\&Mdocdate$ ,
1357: which signifies the current manual revision date dictated by
1.72 kristaps 1358: .Xr cvs 1 ,
1.66 kristaps 1359: or instead a valid canonical date as specified by
1360: .Sx Dates .
1.72 kristaps 1361: If a date does not conform, the current date is used instead.
1.66 kristaps 1362: .Pp
1363: Examples:
1.91 kristaps 1364: .D1 \&.Dd $\&Mdocdate$
1365: .D1 \&.Dd $\&Mdocdate: July 21 2007$
1366: .D1 \&.Dd July 21, 2007
1.66 kristaps 1367: .Pp
1368: See also
1369: .Sx \&Dt
1370: and
1371: .Sx \&Os .
1.63 kristaps 1372: .Ss \&Dl
1.100 kristaps 1373: One-line intended display.
1374: This is formatted as literal text and is useful for commands and
1375: invocations.
1376: It is followed by a newline.
1.66 kristaps 1377: .Pp
1378: Examples:
1.91 kristaps 1379: .D1 \&.Dl % mandoc mdoc.7 | less
1.66 kristaps 1380: .Pp
1381: See also
1382: .Sx \&Bd
1383: and
1384: .Sx \&D1 .
1.63 kristaps 1385: .Ss \&Do
1.66 kristaps 1386: Begins a block enclosed by double quotes. Does not have any head
1387: arguments.
1388: .Pp
1389: Examples:
1.91 kristaps 1390: .D1 \&.D1 \&Do April is the cruellest month \&Dc \e(em T.S. Eliot
1.66 kristaps 1391: .Pp
1392: See also
1393: .Sx \&Dq .
1.63 kristaps 1394: .Ss \&Dq
1.82 kristaps 1395: Encloses its arguments in double quotes.
1.66 kristaps 1396: .Pp
1397: Examples:
1.91 kristaps 1398: .Bd -literal -offset indent -compact
1.66 kristaps 1399: \&.Dq April is the cruellest month
1400: \e(em T.S. Eliot
1401: .Ed
1402: .Pp
1403: See also
1404: .Sx \&Do .
1.63 kristaps 1405: .Ss \&Dt
1.100 kristaps 1406: Document title.
1407: This is the mandatory second macro of any
1.66 kristaps 1408: .Nm
1.100 kristaps 1409: file.
1410: Its calling syntax is as follows:
1.66 kristaps 1411: .Pp
1.111 kristaps 1412: .D1 \. Ns Sx \&Dt Op Cm title Op Cm section Op Cm volume | arch
1.66 kristaps 1413: .Pp
1414: Its arguments are as follows:
1415: .Bl -tag -width Ds -offset Ds
1416: .It Cm title
1.111 kristaps 1417: The document's title (name), defaulting to
1418: .Qq UNKNOWN
1419: if unspecified.
1420: It should be capitalised.
1.66 kristaps 1421: .It Cm section
1.100 kristaps 1422: The manual section.
1423: This may be one of
1.66 kristaps 1424: .Ar 1
1425: .Pq utilities ,
1426: .Ar 2
1427: .Pq system calls ,
1428: .Ar 3
1429: .Pq libraries ,
1430: .Ar 3p
1431: .Pq Perl libraries ,
1432: .Ar 4
1433: .Pq devices ,
1434: .Ar 5
1435: .Pq file formats ,
1436: .Ar 6
1437: .Pq games ,
1438: .Ar 7
1439: .Pq miscellaneous ,
1440: .Ar 8
1441: .Pq system utilities ,
1442: .Ar 9
1443: .Pq kernel functions ,
1444: .Ar X11
1445: .Pq X Window System ,
1446: .Ar X11R6
1447: .Pq X Window System ,
1448: .Ar unass
1449: .Pq unassociated ,
1450: .Ar local
1451: .Pq local system ,
1452: .Ar draft
1453: .Pq draft manual ,
1454: or
1455: .Ar paper
1456: .Pq paper .
1.111 kristaps 1457: It should correspond to the manual's filename suffix and defaults to
1458: .Qq 1
1459: if unspecified.
1.66 kristaps 1460: .It Cm volume
1461: This overrides the volume inferred from
1462: .Ar section .
1463: This field is optional, and if specified, must be one of
1464: .Ar USD
1465: .Pq users' supplementary documents ,
1466: .Ar PS1
1467: .Pq programmers' supplementary documents ,
1468: .Ar AMD
1469: .Pq administrators' supplementary documents ,
1470: .Ar SMM
1471: .Pq system managers' manuals ,
1472: .Ar URM
1473: .Pq users' reference manuals ,
1474: .Ar PRM
1475: .Pq programmers' reference manuals ,
1476: .Ar KM
1477: .Pq kernel manuals ,
1478: .Ar IND
1479: .Pq master index ,
1480: .Ar MMI
1481: .Pq master index ,
1482: .Ar LOCAL
1483: .Pq local manuals ,
1484: .Ar LOC
1485: .Pq local manuals ,
1486: or
1487: .Ar CON
1488: .Pq contributed manuals .
1489: .It Cm arch
1.100 kristaps 1490: This specifies a specific relevant architecture.
1491: If
1.66 kristaps 1492: .Cm volume
1493: is not provided, it may be used in its place, else it may be used
1.100 kristaps 1494: subsequent that.
1495: It, too, is optional.
1496: It must be one of
1.66 kristaps 1497: .Ar alpha ,
1498: .Ar amd64 ,
1499: .Ar amiga ,
1500: .Ar arc ,
1501: .Ar arm ,
1502: .Ar armish ,
1503: .Ar aviion ,
1504: .Ar hp300 ,
1505: .Ar hppa ,
1506: .Ar hppa64 ,
1507: .Ar i386 ,
1508: .Ar landisk ,
1.86 kristaps 1509: .Ar loongson ,
1.66 kristaps 1510: .Ar luna88k ,
1511: .Ar mac68k ,
1512: .Ar macppc ,
1513: .Ar mvme68k ,
1514: .Ar mvme88k ,
1515: .Ar mvmeppc ,
1516: .Ar pmax ,
1517: .Ar sgi ,
1518: .Ar socppc ,
1519: .Ar sparc ,
1520: .Ar sparc64 ,
1521: .Ar sun3 ,
1522: .Ar vax ,
1523: or
1524: .Ar zaurus .
1525: .El
1526: .Pp
1527: Examples:
1.91 kristaps 1528: .D1 \&.Dt FOO 1
1529: .D1 \&.Dt FOO 4 KM
1530: .D1 \&.Dt FOO 9 i386
1.66 kristaps 1531: .Pp
1532: See also
1533: .Sx \&Dd
1534: and
1535: .Sx \&Os .
1.63 kristaps 1536: .Ss \&Dv
1.66 kristaps 1537: Defined variables such as preprocessor constants.
1538: .Pp
1539: Examples:
1.91 kristaps 1540: .D1 \&.Dv BUFSIZ
1541: .D1 \&.Dv STDOUT_FILENO
1.66 kristaps 1542: .Pp
1543: See also
1544: .Sx \&Er .
1.63 kristaps 1545: .Ss \&Dx
1.71 kristaps 1546: Format the DragonFly BSD version provided as an argument, or a default
1.66 kristaps 1547: value if no argument is provided.
1548: .Pp
1549: Examples:
1.91 kristaps 1550: .D1 \&.Dx 2.4.1
1551: .D1 \&.Dx
1.66 kristaps 1552: .Pp
1553: See also
1554: .Sx \&At ,
1555: .Sx \&Bsx ,
1556: .Sx \&Bx ,
1557: .Sx \&Fx ,
1558: .Sx \&Nx ,
1559: .Sx \&Ox ,
1560: and
1561: .Sx \&Ux .
1.63 kristaps 1562: .Ss \&Ec
1563: .Ss \&Ed
1564: .Ss \&Ef
1565: .Ss \&Ek
1566: .Ss \&El
1.117 kristaps 1567: Ends a list context started by
1568: .Sx \&Bl .
1569: .Pp
1570: See also
1571: .Sx \&Bl
1572: and
1573: .Sx \&It .
1.63 kristaps 1574: .Ss \&Em
1.100 kristaps 1575: Denotes text that should be emphasised.
1576: Note that this is a presentation term and should not be used for
1577: stylistically decorating technical terms.
1.66 kristaps 1578: .Pp
1579: Examples:
1.91 kristaps 1580: .D1 \&.Em Warnings!
1581: .D1 \&.Em Remarks :
1.63 kristaps 1582: .Ss \&En
1583: .Ss \&Eo
1584: .Ss \&Er
1.90 kristaps 1585: Display error constants.
1.66 kristaps 1586: .Pp
1587: Examples:
1.91 kristaps 1588: .D1 \&.Er EPERM
1589: .D1 \&.Er ENOENT
1.66 kristaps 1590: .Pp
1591: See also
1592: .Sx \&Dv .
1.63 kristaps 1593: .Ss \&Es
1594: .Ss \&Ev
1.66 kristaps 1595: Environmental variables such as those specified in
1596: .Xr environ 7 .
1597: .Pp
1598: Examples:
1.91 kristaps 1599: .D1 \&.Ev DISPLAY
1600: .D1 \&.Ev PATH
1.63 kristaps 1601: .Ss \&Ex
1.100 kristaps 1602: Inserts text regarding a utility's exit values.
1603: This macro must have first the
1.66 kristaps 1604: .Fl std
1605: argument specified, then an optional
1606: .Ar utility .
1607: If
1608: .Ar utility
1609: is not provided, the document's name as stipulated in
1610: .Sx \&Nm
1611: is provided.
1.63 kristaps 1612: .Ss \&Fa
1.117 kristaps 1613: Function argument.
1614: This may be invoked for names with or without the corresponding type.
1615: It is also used to specify the field name of a structure.
1616: Most often, the
1617: .Sx \&Fa
1618: macro is used in the
1619: .Em SYNOPSIS
1620: section when documenting multi-line function prototypes.
1621: If invoked with multiple arguments, the arguments are separated by a
1622: comma.
1623: Furthermore, if the following macro is another
1624: .Sx \&Fa ,
1625: the last argument will also have a trailing comma.
1626: .Pp
1627: Examples:
1628: .D1 \&.Fa \(dqconst char *p\(dq
1629: .D1 \&.Fa \(dqint a\(dq \(dqint b\(dq \(dqint c\(dq
1630: .D1 \&.Fa foo
1.63 kristaps 1631: .Ss \&Fc
1632: .Ss \&Fd
1.117 kristaps 1633: Historically used to document include files.
1634: This usage has been deprecated in favour of
1635: .Sx \&In .
1636: Do not use this macro.
1637: .Pp
1638: See also
1639: .Sx \&In .
1.63 kristaps 1640: .Ss \&Fl
1.100 kristaps 1641: Command-line flag.
1642: Used when listing arguments to command-line utilities.
1643: Prints a fixed-width hyphen
1.79 kristaps 1644: .Sq \-
1.100 kristaps 1645: directly followed by each argument.
1646: If no arguments are provided, a hyphen is printed followed by a space.
1647: If the argument is a macro, a hyphen is prefixed to the subsequent macro
1648: output.
1.79 kristaps 1649: .Pp
1650: Examples:
1.91 kristaps 1651: .D1 \&.Fl a b c
1652: .D1 \&.Fl \&Pf a b
1653: .D1 \&.Fl
1654: .D1 \&.Op \&Fl o \&Ns \&Ar file
1.79 kristaps 1655: .Pp
1656: See also
1657: .Sx \&Cm .
1.63 kristaps 1658: .Ss \&Fn
1.119 ! kristaps 1659: A function name.
! 1660: Its calling syntax is as follows:
! 1661: .Bd -ragged -offset indent
! 1662: .Pf \. Ns Sx \&Fn
! 1663: .Op Cm functype
! 1664: .Cm funcname
! 1665: .Op Oo Cm argtype Oc Cm argname
! 1666: .Ed
! 1667: If invoked in the
! 1668: .Em SYNOPSIS
! 1669: section, vertical space is asserted before and after the macro.
! 1670: In all cases, the function arguments are surrounded in parenthesis and
! 1671: are delimited by commas.
! 1672: If no arguments are specified, blank parenthesis are output.
! 1673: .Pp
! 1674: Examples:
! 1675: .D1 \&.Fn "int funcname" "int arg0" "int arg1"
! 1676: .D1 \&.Fn funcname
! 1677: .D1 \&.Fn funcname "int arg0"
! 1678: .D1 \&.Fn funcname arg0
! 1679: .Pp
! 1680: See also
! 1681: .Sx \&Fa ,
! 1682: .Sx \&Fo ,
! 1683: .Sx \&Fc ,
! 1684: and
! 1685: .Sx \&Ft .
1.63 kristaps 1686: .Ss \&Fo
1687: .Ss \&Fr
1688: .Ss \&Ft
1689: .Ss \&Fx
1.65 kristaps 1690: Format the FreeBSD version provided as an argument, or a default value
1691: if no argument is provided.
1692: .Pp
1693: Examples:
1.91 kristaps 1694: .D1 \&.Fx 7.1
1695: .D1 \&.Fx
1.65 kristaps 1696: .Pp
1697: See also
1698: .Sx \&At ,
1.66 kristaps 1699: .Sx \&Bsx ,
1.65 kristaps 1700: .Sx \&Bx ,
1.66 kristaps 1701: .Sx \&Dx ,
1.65 kristaps 1702: .Sx \&Nx ,
1703: .Sx \&Ox ,
1704: and
1705: .Sx \&Ux .
1.63 kristaps 1706: .Ss \&Hf
1707: .Ss \&Ic
1708: .Ss \&In
1.118 kristaps 1709: An
1710: .Qq include
1711: file.
1712: In the
1713: .Em SYNOPSIS
1714: section (only if invoked as the line macro), the first argument is
1715: preceded by
1716: .Qq #include ,
1717: the arguments is enclosed in angled braces, and a newline is asserted.
1718: In all other invocations, only angled braces will enclose the argument.
1719: .Pp
1720: Examples
1721: .D1 \&.In sys/types
1.63 kristaps 1722: .Ss \&It
1.114 kristaps 1723: A list item. The syntax of this macro depends on the list type.
1724: .Pp
1725: Lists
1726: of type
1727: .Fl hang ,
1728: .Fl ohang ,
1729: .Fl inset ,
1730: and
1731: .Fl diag
1732: have the following calling syntax:
1733: .Pp
1734: .D1 \. Ns Sx \&It Cm args
1735: .Pp
1736: Lists of type
1737: .Fl bullet ,
1738: .Fl dash ,
1739: .Fl enum ,
1740: .Fl hyphen
1741: and
1742: .Fl item
1743: have the following calling syntax:
1744: .Pp
1745: .D1 \. Ns Sx \&It
1746: .Pp
1747: with subsequent lines interpreted within the scope of the
1748: .Sx \&It
1749: until either a closing
1750: .Sx \&El
1751: or another
1752: .Sx \&It .
1753: .Pp
1754: The
1755: .Fl tag
1756: list has syntax
1757: .Pp
1758: .D1 \. Ns Sx \&It Op Cm args
1759: .Pp
1760: with subsequent lines interpreted as with
1761: .Fl bullet
1762: and family.
1763: The line arguments correspond to the list's left-hand side; body
1764: arguments correspond to the list's contents.
1765: .Pp
1766: The
1767: .Fl column
1768: list is the most complicated.
1769: Its syntax is
1770: .Pp
1771: .D1 \. Ns Sx \&It Op Cm args
1772: .Pp
1773: where
1774: .Cm args
1775: are phrases, a mix of macros and text corresponding to a line column,
1776: delimited by tabs or the special
1777: .Sq \&Ta
1778: pseudo-macro.
1779: Lines subsequent the
1780: .Sx \&It
1781: are interpreted within the scope of the last phrase.
1782: Calling the pseudo-macro
1783: .Sq \&Ta
1784: will open a new phrase scope (this must occur on a macro line to be
1785: interpreted as a macro). Note that the tab phrase delimiter may only be
1786: used within the
1787: .Sx \&It
1788: line itself.
1789: Subsequent this, only the
1790: .Sq \&Ta
1791: pseudo-macro may be used to delimit phrases.
1792: Furthermore, note that quoted sections propogate over tab-delimited
1793: phrases on an
1794: .Sx \&It ,
1795: for example,
1796: .Pp
1797: .D1 .It \(dqcol1 ; <TAB> col2 ;\(dq ;
1798: .Pp
1799: will preserve the semicolon whitespace except for the last.
1800: .Pp
1801: See also
1802: .Sx \&Bl .
1.63 kristaps 1803: .Ss \&Lb
1.109 kristaps 1804: Specify a library.
1805: The calling syntax is as follows:
1806: .Pp
1807: .D1 \. Ns Sx \&Lb Cm library
1808: .Pp
1809: The
1810: .Cm library
1811: parameter may be a system library, such as
1812: .Cm libz
1813: or
1814: .Cm libpam ,
1815: in which case a small library description is printed next to the linker
1816: invocation; or a custom library, in which case the library name is
1817: printed in quotes.
1818: This is most commonly used in the
1819: .Em SYNOPSIS
1820: section as described in
1821: .Sx MANUAL STRUCTURE .
1822: .Pp
1823: Examples:
1824: .D1 \&.Lb libz
1825: .D1 \&.Lb mdoc
1.63 kristaps 1826: .Ss \&Li
1827: .Ss \&Lk
1.100 kristaps 1828: Format a hyperlink.
1829: The calling syntax is as follows:
1.70 kristaps 1830: .Pp
1831: .D1 \. Ns Sx \&Lk Cm uri Op Cm name
1832: .Pp
1833: Examples:
1.91 kristaps 1834: .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
1835: .D1 \&.Lk http://bsd.lv
1.70 kristaps 1836: .Pp
1837: See also
1838: .Sx \&Mt .
1.63 kristaps 1839: .Ss \&Lp
1840: .Ss \&Ms
1841: .Ss \&Mt
1.116 kristaps 1842: Format a
1843: .Qq mailto:
1844: hyperlink.
1845: The calling syntax is as follows:
1846: .Pp
1847: .D1 \. Ns Sx \&Mt Cm address
1848: .Pp
1849: Examples:
1850: .D1 \&.Mt discuss@manpages.bsd.lv
1.63 kristaps 1851: .Ss \&Nd
1852: .Ss \&Nm
1853: .Ss \&No
1854: .Ss \&Ns
1855: .Ss \&Nx
1.65 kristaps 1856: Format the NetBSD version provided as an argument, or a default value if
1857: no argument is provided.
1858: .Pp
1859: Examples:
1.91 kristaps 1860: .D1 \&.Nx 5.01
1861: .D1 \&.Nx
1.65 kristaps 1862: .Pp
1863: See also
1864: .Sx \&At ,
1.66 kristaps 1865: .Sx \&Bsx ,
1.65 kristaps 1866: .Sx \&Bx ,
1.66 kristaps 1867: .Sx \&Dx ,
1.65 kristaps 1868: .Sx \&Fx ,
1869: .Sx \&Ox ,
1870: and
1871: .Sx \&Ux .
1.63 kristaps 1872: .Ss \&Oc
1873: .Ss \&Oo
1874: .Ss \&Op
1875: .Ss \&Os
1.100 kristaps 1876: Document operating system version.
1877: This is the mandatory third macro of
1.66 kristaps 1878: any
1879: .Nm
1880: file. Its calling syntax is as follows:
1881: .Pp
1882: .D1 \. Ns Sx \&Os Op Cm system
1883: .Pp
1884: The optional
1885: .Cm system
1.100 kristaps 1886: parameter specifies the relevant operating system or environment.
1887: Left unspecified, it defaults to the local operating system version.
1888: This is the suggested form.
1.66 kristaps 1889: .Pp
1890: Examples:
1.91 kristaps 1891: .D1 \&.Os
1892: .D1 \&.Os KTH/CSC/TCS
1893: .D1 \&.Os BSD 4.3
1.66 kristaps 1894: .Pp
1895: See also
1896: .Sx \&Dd
1897: and
1898: .Sx \&Dt .
1.63 kristaps 1899: .Ss \&Ot
1.66 kristaps 1900: Unknown usage.
1901: .Pp
1902: .Em Remarks :
1903: this macro has been deprecated.
1.63 kristaps 1904: .Ss \&Ox
1.65 kristaps 1905: Format the OpenBSD version provided as an argument, or a default value
1906: if no argument is provided.
1907: .Pp
1908: Examples:
1.91 kristaps 1909: .D1 \&.Ox 4.5
1910: .D1 \&.Ox
1.65 kristaps 1911: .Pp
1912: See also
1913: .Sx \&At ,
1914: .Sx \&Bsx ,
1915: .Sx \&Bx ,
1.66 kristaps 1916: .Sx \&Dx ,
1.65 kristaps 1917: .Sx \&Fx ,
1918: .Sx \&Nx ,
1919: and
1920: .Sx \&Ux .
1.63 kristaps 1921: .Ss \&Pa
1922: .Ss \&Pc
1923: .Ss \&Pf
1924: .Ss \&Po
1925: .Ss \&Pp
1926: .Ss \&Pq
1927: .Ss \&Qc
1928: .Ss \&Ql
1929: .Ss \&Qo
1930: .Ss \&Qq
1931: .Ss \&Re
1932: Closes a
1933: .Sx \&Rs
1.100 kristaps 1934: block.
1935: Does not have any tail arguments.
1.63 kristaps 1936: .Ss \&Rs
1937: Begins a bibliographic
1938: .Pq Dq reference
1.100 kristaps 1939: block.
1940: Does not have any head arguments.
1941: The block macro may only contain
1.63 kristaps 1942: .Sx \&%A ,
1943: .Sx \&%B ,
1944: .Sx \&%C ,
1945: .Sx \&%D ,
1946: .Sx \&%I ,
1947: .Sx \&%J ,
1948: .Sx \&%N ,
1949: .Sx \&%O ,
1950: .Sx \&%P ,
1951: .Sx \&%Q ,
1952: .Sx \&%R ,
1953: .Sx \&%T ,
1954: and
1955: .Sx \&%V
1956: child macros (at least one must be specified).
1957: .Pp
1.64 kristaps 1958: Examples:
1.91 kristaps 1959: .Bd -literal -offset indent -compact
1.63 kristaps 1960: \&.Rs
1961: \&.%A J. E. Hopcroft
1962: \&.%A J. D. Ullman
1963: \&.%B Introduction to Automata Theory, Languages, and Computation
1964: \&.%I Addison-Wesley
1965: \&.%C Reading, Massachusettes
1966: \&.%D 1979
1967: \&.Re
1968: .Ed
1969: .Pp
1970: If an
1971: .Sx \&Rs
1972: block is used within a SEE ALSO section, a vertical space is asserted
1973: before the rendered output, else the block continues on the current
1974: line.
1975: .Ss \&Rv
1976: .Ss \&Sc
1977: .Ss \&Sh
1978: .Ss \&Sm
1979: .Ss \&So
1980: .Ss \&Sq
1981: .Ss \&Ss
1982: .Ss \&St
1983: .Ss \&Sx
1984: .Ss \&Sy
1985: .Ss \&Tn
1986: .Ss \&Ud
1.110 kristaps 1987: Prints out
1988: .Dq currently under development.
1.63 kristaps 1989: .Ss \&Ux
1.100 kristaps 1990: Format the UNIX name.
1991: Accepts no argument.
1.65 kristaps 1992: .Pp
1993: Examples:
1.91 kristaps 1994: .D1 \&.Ux
1.65 kristaps 1995: .Pp
1996: See also
1997: .Sx \&At ,
1.66 kristaps 1998: .Sx \&Bsx ,
1.65 kristaps 1999: .Sx \&Bx ,
1.66 kristaps 2000: .Sx \&Dx ,
1.65 kristaps 2001: .Sx \&Fx ,
2002: .Sx \&Nx ,
2003: and
2004: .Sx \&Ox .
1.63 kristaps 2005: .Ss \&Va
2006: .Ss \&Vt
1.100 kristaps 2007: A variable type.
2008: This is also used for indicating global variables in the SYNOPSIS
2009: section, in which case a variable name is also specified.
2010: Note that it accepts
1.83 kristaps 2011: .Sx Block partial-implicit
2012: syntax when invoked as the first macro in the SYNOPSIS section, else it
2013: accepts ordinary
2014: .Sx In-line
2015: syntax.
2016: .Pp
2017: Note that this should not be confused with
2018: .Sx \&Ft ,
2019: which is used for function return types.
2020: .Pp
2021: Examples:
1.91 kristaps 2022: .D1 \&.Vt unsigned char
2023: .D1 \&.Vt extern const char * const sys_signame[] ;
1.83 kristaps 2024: .Pp
2025: See also
2026: .Sx \&Ft
2027: and
2028: .Sx \&Va .
1.84 kristaps 2029: .Ss \&Xc
1.87 kristaps 2030: Close a scope opened by
2031: .Sx \&Xo .
1.84 kristaps 2032: .Ss \&Xo
1.100 kristaps 2033: Open an extension scope.
2034: This macro originally existed to extend the 9-argument limit of troff;
2035: since this limit has been lifted, the macro has been deprecated.
1.84 kristaps 2036: .Ss \&Xr
2037: Link to another manual
2038: .Pq Qq cross-reference .
2039: Its calling syntax is
2040: .Pp
2041: .D1 \. Ns Sx \&Xr Cm name section
2042: .Pp
2043: The
2044: .Cm name
2045: and
2046: .Cm section
1.100 kristaps 2047: are the name and section of the linked manual.
2048: If
1.84 kristaps 2049: .Cm section
2050: is followed by non-punctuation, an
2051: .Sx \&Ns
1.100 kristaps 2052: is inserted into the token stream.
2053: This behaviour is for compatibility with
1.84 kristaps 2054: .Xr groff 1 .
2055: .Pp
2056: Examples:
1.91 kristaps 2057: .D1 \&.Xr mandoc 1
2058: .D1 \&.Xr mandoc 1 ;
2059: .D1 \&.Xr mandoc 1 \&Ns s behaviour
1.84 kristaps 2060: .Ss \&br
2061: .Ss \&sp
1.4 kristaps 2062: .Sh COMPATIBILITY
1.93 kristaps 2063: This section documents compatibility between mandoc and other other
2064: troff implementations, at this time limited to GNU troff
2065: .Pq Qq groff .
1.50 kristaps 2066: The term
1.57 kristaps 2067: .Qq historic groff
1.93 kristaps 2068: refers to groff versions before the
1.57 kristaps 2069: .Pa doc.tmac
1.50 kristaps 2070: file re-write
1.57 kristaps 2071: .Pq somewhere between 1.15 and 1.19 .
2072: .Pp
1.93 kristaps 2073: Heirloom troff, the other significant troff implementation accepting
2074: \-mdoc, is similar to historic groff.
2075: .Pp
1.57 kristaps 2076: .Bl -dash -compact
1.119 ! kristaps 2077: .It
! 2078: Historic groff does not break before an
! 2079: .Sx \&Fn
! 2080: when not invoked as the line macro in the
! 2081: .Em SYNOPSIS
! 2082: section.
1.118 kristaps 2083: .It
2084: Historic groff formats the
2085: .Sx \&In
2086: badly: trailing arguments are trashed and
2087: .Em SYNOPSIS
2088: is not specially treated.
1.115 kristaps 2089: .It
2090: groff does not accept the
2091: .Sq \&Ta
2092: pseudo-macro as a line macro.
2093: mandoc does.
1.57 kristaps 2094: .It
1.81 kristaps 2095: The comment syntax
2096: .Sq \e."
2097: is no longer accepted.
2098: .It
1.93 kristaps 2099: In groff, the
1.80 kristaps 2100: .Sx \&Pa
2101: macro does not format its arguments when used in the FILES section under
1.100 kristaps 2102: certain list types.
2103: mandoc does.
1.80 kristaps 2104: .It
1.93 kristaps 2105: Historic groff does not print a dash for empty
1.79 kristaps 2106: .Sx \&Fl
1.100 kristaps 2107: arguments.
2108: mandoc and newer groff implementations do.
1.79 kristaps 2109: .It
1.93 kristaps 2110: groff behaves irregularly when specifying
1.77 kristaps 2111: .Sq \ef
1.93 kristaps 2112: .Sx Text Decoration
1.100 kristaps 2113: within line-macro scopes.
2114: mandoc follows a consistent system.
1.77 kristaps 2115: .It
1.93 kristaps 2116: In mandoc, negative scaling units are truncated to zero; groff would
1.100 kristaps 2117: move to prior lines.
2118: Furthermore, the
1.61 kristaps 2119: .Sq f
2120: scaling unit, while accepted, is rendered as the default unit.
2121: .It
1.48 kristaps 2122: In quoted literals, groff allowed pair-wise double-quotes to produce a
1.100 kristaps 2123: standalone double-quote in formatted output.
2124: This idiosyncratic behaviour is not applicable in mandoc.
1.57 kristaps 2125: .It
1.64 kristaps 2126: Display types
1.78 kristaps 2127: .Sx \&Bd
1.77 kristaps 2128: .Fl center
1.64 kristaps 2129: and
2130: .Fl right
2131: are aliases for
1.93 kristaps 2132: .Fl left
2133: in manodc. Furthermore, the
1.64 kristaps 2134: .Fl file Ar file
1.100 kristaps 2135: argument is ignored.
2136: Lastly, since text is not right-justified in mandoc (or even groff),
1.64 kristaps 2137: .Fl ragged
2138: and
2139: .Fl filled
2140: are aliases, as are
2141: .Fl literal
2142: and
2143: .Fl unfilled .
1.57 kristaps 2144: .It
1.100 kristaps 2145: Historic groff has many un-callable macros.
2146: Most of these (excluding some block-level macros) are now callable.
1.57 kristaps 2147: .It
1.50 kristaps 2148: The vertical bar
1.57 kristaps 2149: .Sq \(ba
1.28 kristaps 2150: made historic groff
1.57 kristaps 2151: .Qq go orbital
1.93 kristaps 2152: but has been a proper delimiter since then.
1.57 kristaps 2153: .It
1.93 kristaps 2154: .Sx \&It Fl nested
1.28 kristaps 2155: is assumed for all lists (it wasn't in historic groff): any list may be
2156: nested and
1.64 kristaps 2157: .Fl enum
1.4 kristaps 2158: lists will restart the sequence only for the sub-list.
1.57 kristaps 2159: .It
1.4 kristaps 2160: Some manuals use
1.64 kristaps 2161: .Sx \&Li
1.4 kristaps 2162: incorrectly by following it with a reserved character and expecting the
1.100 kristaps 2163: delimiter to render.
2164: This is not supported in mandoc.
1.57 kristaps 2165: .It
1.50 kristaps 2166: In groff, the
1.64 kristaps 2167: .Sx \&Fo
1.100 kristaps 2168: macro only produces the first parameter.
2169: This is not the case in mandoc.
1.93 kristaps 2170: .It
2171: In groff, the
2172: .Sx \&Cd ,
2173: .Sx \&Er ,
1.106 kristaps 2174: .Sx \&Ex ,
1.93 kristaps 2175: and
1.106 kristaps 2176: .Sx \&Rv
1.100 kristaps 2177: macros were stipulated only to occur in certain manual sections.
2178: mandoc does not have these restrictions.
1.105 kristaps 2179: .It
2180: Newer groff and mandoc print
2181: .Qq AT&T UNIX
2182: prior to unknown arguments of
2183: .Sx \&At ;
2184: older groff did nothing.
1.57 kristaps 2185: .El
1.2 kristaps 2186: .Sh SEE ALSO
1.57 kristaps 2187: .Xr mandoc 1 ,
2188: .Xr mandoc_char 7
1.2 kristaps 2189: .Sh AUTHORS
2190: The
1.57 kristaps 2191: .Nm
1.50 kristaps 2192: reference was written by
1.94 kristaps 2193: .An Kristaps Dzonsons Aq kristaps@bsd.lv .
1.64 kristaps 2194: .\"
2195: .\" XXX: this really isn't the place for these caveats.
2196: .\" .
2197: .\" .
2198: .\" .Sh CAVEATS
2199: .\" There are many ambiguous parts of mdoc.
2200: .\" .
2201: .\" .Pp
2202: .\" .Bl -dash -compact
2203: .\" .It
2204: .\" .Sq \&Fa
2205: .\" should be
2206: .\" .Sq \&Va
2207: .\" as function arguments are variables.
2208: .\" .It
2209: .\" .Sq \&Ft
2210: .\" should be
2211: .\" .Sq \&Vt
2212: .\" as function return types are still types. Furthermore, the
2213: .\" .Sq \&Ft
2214: .\" should be removed and
2215: .\" .Sq \&Fo ,
2216: .\" which ostensibly follows it, should follow the same convention as
2217: .\" .Sq \&Va .
2218: .\" .It
2219: .\" .Sq \&Va
2220: .\" should formalise that only one or two arguments are acceptable: a
2221: .\" variable name and optional, preceding type.
2222: .\" .It
2223: .\" .Sq \&Fd
2224: .\" is ambiguous. It's commonly used to indicate an include file in the
2225: .\" synopsis section.
2226: .\" .Sq \&In
2227: .\" should be used, instead.
2228: .\" .It
2229: .\" Only the
2230: .\" .Sq \-literal
2231: .\" argument to
2232: .\" .Sq \&Bd
2233: .\" makes sense. The remaining ones should be removed.
2234: .\" .It
2235: .\" The
2236: .\" .Sq \&Xo
2237: .\" and
2238: .\" .Sq \&Xc
2239: .\" macros should be deprecated.
2240: .\" .It
2241: .\" The
2242: .\" .Sq \&Dt
2243: .\" macro lacks clarity. It should be absolutely clear which title will
2244: .\" render when formatting the manual page.
2245: .\" .It
2246: .\" A
2247: .\" .Sq \&Lx
2248: .\" should be provided for Linux (\(`a la
2249: .\" .Sq \&Ox ,
2250: .\" .Sq \&Nx
2251: .\" etc.).
2252: .\" .It
2253: .\" There's no way to refer to references in
2254: .\" .Sq \&Rs/Re
2255: .\" blocks.
2256: .\" .It
2257: .\" The \-split and \-nosplit dictates via
2258: .\" .Sq \&An
2259: .\" are re-set when entering and leaving the AUTHORS section.
2260: .\" .El
2261: .\" .
CVSweb