Annotation of mandoc/mdoc.7, Revision 1.140
1.140 ! kristaps 1: .\" $Id: mdoc.7,v 1.139 2010/07/19 15:43:10 kristaps Exp $
1.1 kristaps 2: .\"
1.130 schwarze 3: .\" Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
4: .\" Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
1.1 kristaps 5: .\"
6: .\" Permission to use, copy, modify, and distribute this software for any
1.22 kristaps 7: .\" purpose with or without fee is hereby granted, provided that the above
8: .\" copyright notice and this permission notice appear in all copies.
1.1 kristaps 9: .\"
1.22 kristaps 10: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14: .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15: .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16: .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1.50 kristaps 17: .\"
1.137 kristaps 18: .Dd $Mdocdate: July 19 2010 $
1.20 kristaps 19: .Dt MDOC 7
1.1 kristaps 20: .Os
21: .Sh NAME
1.57 kristaps 22: .Nm mdoc
23: .Nd mdoc language reference
1.1 kristaps 24: .Sh DESCRIPTION
25: The
1.57 kristaps 26: .Nm mdoc
1.50 kristaps 27: language is used to format
1.57 kristaps 28: .Bx
29: .Ux
1.138 kristaps 30: manuals.
31: In this reference document, we describe its syntax, structure, and
32: usage.
33: Our reference implementation is mandoc; the
1.57 kristaps 34: .Sx COMPATIBILITY
1.93 kristaps 35: section describes compatibility with other troff \-mdoc implementations.
1.57 kristaps 36: .Pp
1.13 kristaps 37: An
1.57 kristaps 38: .Nm
1.118 kristaps 39: document follows simple rules: lines beginning with the control
1.50 kristaps 40: character
1.57 kristaps 41: .Sq \.
1.138 kristaps 42: are parsed for macros.
43: Other lines are interpreted within the scope of
1.13 kristaps 44: prior macros:
1.57 kristaps 45: .Bd -literal -offset indent
1.13 kristaps 46: \&.Sh Macro lines change control state.
47: Other lines are interpreted within the current state.
1.57 kristaps 48: .Ed
1.46 kristaps 49: .Sh LANGUAGE SYNTAX
1.57 kristaps 50: .Nm
1.13 kristaps 51: documents may contain only graphable 7-bit ASCII characters, the space
1.138 kristaps 52: character, and, in certain circumstances, the tab character.
53: All manuals must have
1.57 kristaps 54: .Ux
1.50 kristaps 55: line terminators.
1.57 kristaps 56: .Ss Comments
1.43 kristaps 57: Text following a
1.135 kristaps 58: .Sq \e\*q ,
1.43 kristaps 59: whether in a macro or free-form text line, is ignored to the end of
1.138 kristaps 60: line.
61: A macro line with only a control character and comment escape,
1.135 kristaps 62: .Sq \&.\e\*q ,
1.138 kristaps 63: is also ignored.
64: Macro lines with only a control character and optionally whitespace are
65: stripped from input.
1.57 kristaps 66: .Ss Reserved Characters
1.2 kristaps 67: Within a macro line, the following characters are reserved:
1.61 kristaps 68: .Pp
1.57 kristaps 69: .Bl -tag -width Ds -offset indent -compact
70: .It \&.
71: .Pq period
72: .It \&,
73: .Pq comma
74: .It \&:
75: .Pq colon
76: .It \&;
77: .Pq semicolon
78: .It \&(
79: .Pq left-parenthesis
80: .It \&)
81: .Pq right-parenthesis
82: .It \&[
83: .Pq left-bracket
84: .It \&]
85: .Pq right-bracket
86: .It \&?
87: .Pq question
88: .It \&!
89: .Pq exclamation
90: .It \&|
91: .Pq vertical bar
92: .El
93: .Pp
1.5 kristaps 94: Use of reserved characters is described in
1.57 kristaps 95: .Sx MACRO SYNTAX .
1.43 kristaps 96: For general use in macro lines, these characters must either be escaped
97: with a non-breaking space
1.57 kristaps 98: .Pq Sq \e&
1.50 kristaps 99: or, if applicable, an appropriate escape sequence used.
1.57 kristaps 100: .Ss Special Characters
1.43 kristaps 101: Special characters may occur in both macro and free-form lines.
102: Sequences begin with the escape character
1.57 kristaps 103: .Sq \e
1.50 kristaps 104: followed by either an open-parenthesis
1.57 kristaps 105: .Sq \&(
1.1 kristaps 106: for two-character sequences; an open-bracket
1.57 kristaps 107: .Sq \&[
1.1 kristaps 108: for n-character sequences (terminated at a close-bracket
1.57 kristaps 109: .Sq \&] ) ;
1.100 kristaps 110: or a single one-character sequence.
111: See
1.57 kristaps 112: .Xr mandoc_char 7
1.100 kristaps 113: for a complete list.
114: Examples include
1.57 kristaps 115: .Sq \e(em
116: .Pq em-dash
1.50 kristaps 117: and
1.57 kristaps 118: .Sq \ee
119: .Pq back-slash .
120: .Ss Text Decoration
1.54 kristaps 121: Terms may be text-decorated using the
1.57 kristaps 122: .Sq \ef
1.74 kristaps 123: escape followed by an indicator: B (bold), I, (italic), R (Roman), or P
1.82 kristaps 124: (revert to previous mode):
1.75 kristaps 125: .Pp
1.76 kristaps 126: .D1 \efBbold\efR \efIitalic\efP
127: .Pp
128: A numerical representation 3, 2, or 1 (bold, italic, and Roman,
1.100 kristaps 129: respectively) may be used instead.
130: A text decoration is valid within
1.118 kristaps 131: the current font scope only: if a macro opens a font scope alongside
1.77 kristaps 132: its own scope, such as
1.78 kristaps 133: .Sx \&Bf
1.77 kristaps 134: .Cm \&Sy ,
135: in-scope invocations of
136: .Sq \ef
1.100 kristaps 137: are only valid within the font scope of the macro.
138: If
1.77 kristaps 139: .Sq \ef
140: is specified outside of any font scope, such as in unenclosed, free-form
141: text, it will affect the remainder of the document.
1.76 kristaps 142: .Pp
1.136 kristaps 143: Note this form is
1.76 kristaps 144: .Em not
1.82 kristaps 145: recommended for
1.57 kristaps 146: .Nm ,
1.74 kristaps 147: which encourages semantic annotation.
1.57 kristaps 148: .Ss Predefined Strings
1.82 kristaps 149: Historically,
1.57 kristaps 150: .Xr groff 1
1.82 kristaps 151: also defined a set of package-specific
1.57 kristaps 152: .Dq predefined strings ,
1.82 kristaps 153: which, like
1.57 kristaps 154: .Sx Special Characters ,
1.124 kristaps 155: mark special output characters and strings by way of input codes.
1.54 kristaps 156: Predefined strings are escaped with the slash-asterisk,
1.57 kristaps 157: .Sq \e* :
1.54 kristaps 158: single-character
1.57 kristaps 159: .Sq \e*X ,
1.54 kristaps 160: two-character
1.57 kristaps 161: .Sq \e*(XX ,
1.54 kristaps 162: and N-character
1.57 kristaps 163: .Sq \e*[N] .
1.54 kristaps 164: See
1.57 kristaps 165: .Xr mandoc_char 7
1.100 kristaps 166: for a complete list.
167: Examples include
1.57 kristaps 168: .Sq \e*(Am
169: .Pq ampersand
1.54 kristaps 170: and
1.57 kristaps 171: .Sq \e*(Ba
172: .Pq vertical bar .
173: .Ss Whitespace
1.98 kristaps 174: Whitespace consists of the space character.
1.96 kristaps 175: In free-form lines, whitespace is preserved within a line; un-escaped
176: trailing spaces are stripped from input (unless in a literal context).
1.97 kristaps 177: Blank free-form lines, which may include whitespace, are only permitted
1.96 kristaps 178: within literal contexts.
1.57 kristaps 179: .Pp
1.100 kristaps 180: In macro lines, whitespace delimits arguments and is discarded.
181: If arguments are quoted, whitespace within the quotes is retained.
1.57 kristaps 182: .Ss Quotation
1.46 kristaps 183: Macro arguments may be quoted with a double-quote to group
1.100 kristaps 184: space-delimited terms or to retain blocks of whitespace.
185: A quoted argument begins with a double-quote preceded by whitespace.
186: The next double-quote not pair-wise adjacent to another double-quote
187: terminates the literal, regardless of surrounding whitespace.
1.57 kristaps 188: .Pp
1.50 kristaps 189: This produces tokens
1.57 kristaps 190: .Sq a" ,
191: .Sq b c ,
192: .Sq de ,
1.47 kristaps 193: and
1.57 kristaps 194: .Sq fg" .
1.47 kristaps 195: Note that any quoted term, be it argument or macro, is indiscriminately
1.100 kristaps 196: considered literal text.
197: Thus, the following produces
1.57 kristaps 198: .Sq \&Em a :
199: .Bd -literal -offset indent
1.47 kristaps 200: \&.Em "Em a"
1.57 kristaps 201: .Ed
202: .Pp
1.46 kristaps 203: In free-form mode, quotes are regarded as opaque text.
1.63 kristaps 204: .Ss Dates
1.66 kristaps 205: There are several macros in
206: .Nm
1.100 kristaps 207: that require a date argument.
208: The canonical form for dates is the American format:
1.66 kristaps 209: .Pp
210: .D1 Cm Month Day , Year
211: .Pp
212: The
213: .Cm Day
1.100 kristaps 214: value is an optionally zero-padded numeral.
215: The
1.66 kristaps 216: .Cm Month
1.100 kristaps 217: value is the full month name.
218: The
1.66 kristaps 219: .Cm Year
220: value is the full four-digit year.
221: .Pp
1.72 kristaps 222: Reduced form dates are broken-down canonical form dates:
1.66 kristaps 223: .Pp
1.72 kristaps 224: .D1 Cm Month , Year
225: .D1 Cm Year
1.66 kristaps 226: .Pp
227: Some examples of valid dates follow:
228: .Pp
229: .D1 "May, 2009" Pq reduced form
230: .D1 "2009" Pq reduced form
231: .D1 "May 20, 2009" Pq canonical form
1.61 kristaps 232: .Ss Scaling Widths
233: Many macros support scaled widths for their arguments, such as
234: stipulating a two-inch list indentation with the following:
235: .Bd -literal -offset indent
236: \&.Bl -tag -width 2i
237: .Ed
238: .Pp
239: The syntax for scaled widths is
1.62 kristaps 240: .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
1.61 kristaps 241: where a decimal must be preceded or proceeded by at least one digit.
1.100 kristaps 242: Negative numbers, while accepted, are truncated to zero.
243: The following scaling units are accepted:
1.61 kristaps 244: .Pp
245: .Bl -tag -width Ds -offset indent -compact
246: .It c
247: centimetre
248: .It i
249: inch
250: .It P
251: pica (~1/6 inch)
252: .It p
253: point (~1/72 inch)
254: .It f
255: synonym for
256: .Sq u
257: .It v
258: default vertical span
259: .It m
260: width of rendered
261: .Sq m
262: .Pq em
263: character
264: .It n
265: width of rendered
266: .Sq n
267: .Pq en
268: character
269: .It u
270: default horizontal span
271: .It M
272: mini-em (~1/100 em)
273: .El
274: .Pp
275: Using anything other than
276: .Sq m ,
277: .Sq n ,
278: .Sq u ,
279: or
280: .Sq v
1.100 kristaps 281: is necessarily non-portable across output media.
282: See
1.61 kristaps 283: .Sx COMPATIBILITY .
1.101 kristaps 284: .Ss Sentence Spacing
285: When composing a manual, make sure that your sentences end at the end of
286: a line.
287: By doing so, front-ends will be able to apply the proper amount of
288: spacing after the end of sentence (unescaped) period, exclamation mark,
1.107 kristaps 289: or question mark followed by zero or more non-sentence closing
290: delimiters (
291: .Ns Sq \&) ,
292: .Sq \&] ,
293: .Sq \&' ,
294: .Sq \&" ) .
1.102 kristaps 295: .Pp
296: The proper spacing is also intelligently preserved if a sentence ends at
1.107 kristaps 297: the boundary of a macro line, e.g.,
298: .Pp
299: .D1 \&Xr mandoc 1 \.
300: .D1 \&Fl T \&Ns \&Cm ascii \.
1.43 kristaps 301: .Sh MANUAL STRUCTURE
1.66 kristaps 302: A well-formed
1.57 kristaps 303: .Nm
1.66 kristaps 304: document consists of a document prologue followed by one or more
305: sections.
306: .Pp
307: The prologue, which consists of (in order) the
1.64 kristaps 308: .Sx \&Dd ,
309: .Sx \&Dt ,
1.33 kristaps 310: and
1.66 kristaps 311: .Sx \&Os
312: macros, is required for every document.
313: .Pp
1.82 kristaps 314: The first section (sections are denoted by
1.66 kristaps 315: .Sx \&Sh )
316: must be the NAME section, consisting of at least one
1.64 kristaps 317: .Sx \&Nm
1.50 kristaps 318: followed by
1.66 kristaps 319: .Sx \&Nd .
320: .Pp
1.122 kristaps 321: Following that, convention dictates specifying at least the
322: .Em SYNOPSIS
323: and
324: .Em DESCRIPTION
325: sections, although this varies between manual sections.
1.66 kristaps 326: .Pp
327: The following is a well-formed skeleton
328: .Nm
329: file:
1.57 kristaps 330: .Bd -literal -offset indent
1.43 kristaps 331: \&.Dd $\&Mdocdate$
332: \&.Dt mdoc 7
333: \&.Os
334: \&.Sh NAME
1.58 kristaps 335: \&.Nm foo
336: \&.Nd a description goes here
1.108 kristaps 337: \&.\e\*q The next is for sections 2, 3, & 9 only.
1.58 kristaps 338: \&.\e\*q .Sh LIBRARY
339: \&.Sh SYNOPSIS
340: \&.Nm foo
341: \&.Op Fl options
342: \&.Ar
343: \&.Sh DESCRIPTION
344: The
345: \&.Nm
346: utility processes files ...
1.59 kristaps 347: \&.\e\*q .Sh IMPLEMENTATION NOTES
1.58 kristaps 348: \&.\e\*q The next is for sections 2, 3, & 9 only.
349: \&.\e\*q .Sh RETURN VALUES
350: \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
351: \&.\e\*q .Sh ENVIRONMENT
352: \&.\e\*q .Sh FILES
1.99 kristaps 353: \&.\e\*q The next is for sections 1 & 8 only.
354: \&.\e\*q .Sh EXIT STATUS
1.58 kristaps 355: \&.\e\*q .Sh EXAMPLES
356: \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
357: \&.\e\*q .Sh DIAGNOSTICS
358: \&.\e\*q The next is for sections 2, 3, & 9 only.
359: \&.\e\*q .Sh ERRORS
360: \&.\e\*q .Sh SEE ALSO
361: \&.\e\*q .Xr foobar 1
362: \&.\e\*q .Sh STANDARDS
363: \&.\e\*q .Sh HISTORY
364: \&.\e\*q .Sh AUTHORS
365: \&.\e\*q .Sh CAVEATS
366: \&.\e\*q .Sh BUGS
367: \&.\e\*q .Sh SECURITY CONSIDERATIONS
1.57 kristaps 368: .Ed
369: .Pp
1.66 kristaps 370: The sections in a
371: .Nm
1.100 kristaps 372: document are conventionally ordered as they appear above.
373: Sections should be composed as follows:
1.73 kristaps 374: .Bl -ohang -offset Ds
375: .It Em NAME
1.100 kristaps 376: The name(s) and a short description of the documented material.
377: The syntax for this as follows:
1.73 kristaps 378: .Bd -literal -offset indent
379: \&.Nm name0
380: \&.Nm name1
381: \&.Nm name2
382: \&.Nd a short description
383: .Ed
384: .Pp
385: The
1.66 kristaps 386: .Sx \&Nm
1.73 kristaps 387: macro(s) must precede the
388: .Sx \&Nd
389: macro.
1.80 kristaps 390: .Pp
1.82 kristaps 391: See
1.80 kristaps 392: .Sx \&Nm
393: and
394: .Sx \&Nd .
1.73 kristaps 395: .It Em LIBRARY
396: The name of the library containing the documented material, which is
1.108 kristaps 397: assumed to be a function in a section 2, 3, or 9 manual.
1.100 kristaps 398: The syntax for this is as follows:
1.73 kristaps 399: .Bd -literal -offset indent
400: \&.Lb libarm
401: .Ed
402: .Pp
403: See
1.80 kristaps 404: .Sx \&Lb .
1.73 kristaps 405: .It Em SYNOPSIS
406: Documents the utility invocation syntax, function call syntax, or device
1.82 kristaps 407: configuration.
1.73 kristaps 408: .Pp
409: For the first, utilities (sections 1, 6, and 8), this is
410: generally structured as follows:
411: .Bd -literal -offset indent
412: \&.Nm foo
413: \&.Op Fl v
414: \&.Op Fl o Ar file
415: \&.Op Ar
416: \&.Nm bar
417: \&.Op Fl v
418: \&.Op Fl o Ar file
419: \&.Op Ar
420: .Ed
421: .Pp
422: For the second, function calls (sections 2, 3, 9):
423: .Bd -literal -offset indent
424: \&.Vt extern const char *global;
425: \&.In header.h
426: \&.Ft "char *"
427: \&.Fn foo "const char *src"
428: \&.Ft "char *"
429: \&.Fn bar "const char *src"
430: .Ed
431: .Pp
432: And for the third, configurations (section 4):
433: .Bd -literal -offset indent
434: \&.Cd \*qit* at isa? port 0x2e\*q
435: \&.Cd \*qit* at isa? port 0x4e\*q
436: .Ed
437: .Pp
1.82 kristaps 438: Manuals not in these sections generally don't need a
1.73 kristaps 439: .Em SYNOPSIS .
1.80 kristaps 440: .Pp
1.122 kristaps 441: Some macros are displayed differently in the
442: .Em SYNOPSIS
443: section, particularly
444: .Sx \&Nm ,
1.80 kristaps 445: .Sx \&Cd ,
1.122 kristaps 446: .Sx \&Fd ,
447: .Sx \&Fn ,
448: .Sx \&Fo ,
449: .Sx \&In ,
450: .Sx \&Vt ,
451: and
452: .Sx \&Ft .
1.138 kristaps 453: All of these macros are output on their own line.
454: If two such dissimilar macros are pair-wise invoked (except for
1.122 kristaps 455: .Sx \&Ft
456: before
457: .Sx \&Fo
458: or
1.123 kristaps 459: .Sx \&Fn ) ,
1.122 kristaps 460: they are separated by a vertical space, unless in the case of
461: .Sx \&Fo ,
1.80 kristaps 462: .Sx \&Fn ,
1.122 kristaps 463: and
1.80 kristaps 464: .Sx \&Ft ,
1.122 kristaps 465: which are always separated by vertical space.
1.128 schwarze 466: .Pp
467: When text and macros following an
468: .Sx \&Nm
469: macro starting an input line span multiple output lines,
470: all output lines but the first will be indented to align
471: with the text immediately following the
472: .Sx \&Nm
473: macro, up to the next
474: .Sx \&Nm ,
475: .Sx \&Sx ,
476: or
477: .Sx \&Ss
478: macro or the end of an enclosing block, whichever comes first.
1.73 kristaps 479: .It Em DESCRIPTION
1.82 kristaps 480: This expands upon the brief, one-line description in
1.73 kristaps 481: .Em NAME .
482: It usually contains a break-down of the options (if documenting a
483: command), such as:
484: .Bd -literal -offset indent
485: The arguments are as follows:
486: \&.Bl \-tag \-width Ds
487: \&.It Fl v
488: Print verbose information.
489: \&.El
490: .Ed
1.80 kristaps 491: .Pp
1.73 kristaps 492: Manuals not documenting a command won't include the above fragment.
493: .It Em IMPLEMENTATION NOTES
1.100 kristaps 494: Implementation-specific notes should be kept here.
495: This is useful when implementing standard functions that may have side
496: effects or notable algorithmic implications.
1.73 kristaps 497: .It Em RETURN VALUES
498: This section is the dual of
499: .Em EXIT STATUS ,
1.100 kristaps 500: which is used for commands.
501: It documents the return values of functions in sections 2, 3, and 9.
1.73 kristaps 502: .Pp
503: See
504: .Sx \&Rv .
505: .It Em ENVIRONMENT
506: Documents any usages of environment variables, e.g.,
507: .Xr environ 7 .
508: .Pp
509: See
510: .Sx \&Ev .
511: .It Em FILES
1.100 kristaps 512: Documents files used.
513: It's helpful to document both the file and a short description of how
514: the file is used (created, modified, etc.).
1.73 kristaps 515: .Pp
516: See
517: .Sx \&Pa .
1.99 kristaps 518: .It Em EXIT STATUS
1.100 kristaps 519: Command exit status for section 1, 6, and 8 manuals.
520: This section is the dual of
1.99 kristaps 521: .Em RETURN VALUES ,
1.100 kristaps 522: which is used for functions.
523: Historically, this information was described in
1.99 kristaps 524: .Em DIAGNOSTICS ,
525: a practise that is now discouraged.
526: .Pp
527: See
528: .Sx \&Ex .
1.73 kristaps 529: .It Em EXAMPLES
1.100 kristaps 530: Example usages.
531: This often contains snippets of well-formed, well-tested invocations.
532: Make doubly sure that your examples work properly!
1.73 kristaps 533: .It Em DIAGNOSTICS
1.100 kristaps 534: Documents error conditions.
535: This is most useful in section 4 manuals.
1.73 kristaps 536: Historically, this section was used in place of
537: .Em EXIT STATUS
538: for manuals in sections 1, 6, and 8; however, this practise is
539: discouraged.
540: .Pp
541: See
1.80 kristaps 542: .Sx \&Bl
543: .Fl diag .
1.73 kristaps 544: .It Em ERRORS
545: Documents error handling in sections 2, 3, and 9.
546: .Pp
547: See
548: .Sx \&Er .
549: .It Em SEE ALSO
1.100 kristaps 550: References other manuals with related topics.
551: This section should exist for most manuals.
552: Cross-references should conventionally be ordered first by section, then
553: alphabetically.
1.73 kristaps 554: .Pp
555: See
556: .Sx \&Xr .
557: .It Em STANDARDS
1.100 kristaps 558: References any standards implemented or used.
559: If not adhering to any standards, the
1.73 kristaps 560: .Em HISTORY
561: section should be used instead.
562: .Pp
563: See
564: .Sx \&St .
565: .It Em HISTORY
566: The history of any manual without a
567: .Em STANDARDS
568: section should be described in this section.
569: .It Em AUTHORS
570: Credits to authors, if applicable, should appear in this section.
571: Authors should generally be noted by both name and an e-mail address.
572: .Pp
573: See
574: .Sx \&An .
575: .It Em CAVEATS
576: Explanations of common misuses and misunderstandings should be explained
577: in this section.
578: .It Em BUGS
579: Extant bugs should be described in this section.
580: .It Em SECURITY CONSIDERATIONS
581: Documents any security precautions that operators should consider.
1.66 kristaps 582: .El
1.43 kristaps 583: .Sh MACRO SYNTAX
1.56 kristaps 584: Macros are one to three three characters in length and begin with a
585: control character ,
1.57 kristaps 586: .Sq \&. ,
1.100 kristaps 587: at the beginning of the line.
588: An arbitrary amount of whitespace may sit between the control character
589: and the macro name.
590: Thus, the following are equivalent:
1.64 kristaps 591: .Bd -literal -offset indent
592: \&.Pp
593: \&.\ \ \ \&Pp
594: .Ed
1.57 kristaps 595: .Pp
1.100 kristaps 596: The syntax of a macro depends on its classification.
597: In this section,
1.57 kristaps 598: .Sq \-arg
1.43 kristaps 599: refers to macro arguments, which may be followed by zero or more
1.57 kristaps 600: .Sq parm
1.43 kristaps 601: parameters;
1.57 kristaps 602: .Sq \&Yo
1.43 kristaps 603: opens the scope of a macro; and if specified,
1.57 kristaps 604: .Sq \&Yc
1.43 kristaps 605: closes it out.
1.57 kristaps 606: .Pp
1.43 kristaps 607: The
1.57 kristaps 608: .Em Callable
1.43 kristaps 609: column indicates that the macro may be called subsequent to the initial
1.100 kristaps 610: line-macro.
611: If a macro is not callable, then its invocation after the initial line
612: macro is interpreted as opaque text, such that
1.60 kristaps 613: .Sq \&.Fl \&Sh
1.55 kristaps 614: produces
1.60 kristaps 615: .Sq Fl \&Sh .
1.57 kristaps 616: .Pp
1.55 kristaps 617: The
1.57 kristaps 618: .Em Parsable
1.43 kristaps 619: column indicates whether the macro may be followed by further
1.100 kristaps 620: (ostensibly callable) macros.
621: If a macro is not parsable, subsequent macro invocations on the line
622: will be interpreted as opaque text.
1.57 kristaps 623: .Pp
1.55 kristaps 624: The
1.57 kristaps 625: .Em Scope
1.43 kristaps 626: column, if applicable, describes closure rules.
1.57 kristaps 627: .Ss Block full-explicit
1.100 kristaps 628: Multi-line scope closed by an explicit closing macro.
629: All macros contains bodies; only
1.64 kristaps 630: .Sx \&Bf
1.43 kristaps 631: contains a head.
1.57 kristaps 632: .Bd -literal -offset indent
1.50 kristaps 633: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
634: \(lBbody...\(rB
1.43 kristaps 635: \&.Yc
1.57 kristaps 636: .Ed
637: .Pp
638: .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
639: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
1.64 kristaps 640: .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
641: .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
642: .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
643: .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
644: .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
645: .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
646: .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
647: .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
1.57 kristaps 648: .El
649: .Ss Block full-implicit
1.43 kristaps 650: Multi-line scope closed by end-of-file or implicitly by another macro.
1.50 kristaps 651: All macros have bodies; some
1.57 kristaps 652: .Po
1.64 kristaps 653: .Sx \&It Fl bullet ,
654: .Fl hyphen ,
655: .Fl dash ,
656: .Fl enum ,
657: .Fl item
1.57 kristaps 658: .Pc
1.64 kristaps 659: don't have heads; only one
660: .Po
661: .Sx \&It Fl column
1.82 kristaps 662: .Pc
1.64 kristaps 663: has multiple heads.
1.57 kristaps 664: .Bd -literal -offset indent
1.50 kristaps 665: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
666: \(lBbody...\(rB
1.57 kristaps 667: .Ed
668: .Pp
669: .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
670: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
1.64 kristaps 671: .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
672: .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
1.128 schwarze 673: .It Sx \&Nm Ta \&No Ta Yes Ta closed by Sx \&Nm , Sx \&Sh , Sx \&Ss
1.64 kristaps 674: .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
675: .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
1.57 kristaps 676: .El
1.128 schwarze 677: .Pp
678: Note that the
679: .Sx \&Nm
680: macro is a
681: .Sx Block full-implicit
682: macro only when invoked as the first macro
683: in a
684: .Em SYNOPSIS
685: section line, else it is
686: .Sx In-line .
1.57 kristaps 687: .Ss Block partial-explicit
1.100 kristaps 688: Like block full-explicit, but also with single-line scope.
689: Each has at least a body and, in limited circumstances, a head
1.64 kristaps 690: .Po
691: .Sx \&Fo ,
692: .Sx \&Eo
693: .Pc
1.50 kristaps 694: and/or tail
1.64 kristaps 695: .Pq Sx \&Ec .
1.57 kristaps 696: .Bd -literal -offset indent
1.50 kristaps 697: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
698: \(lBbody...\(rB
699: \&.Yc \(lBtail...\(rB
1.2 kristaps 700:
1.43 kristaps 701: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
1.50 kristaps 702: \(lBbody...\(rB \&Yc \(lBtail...\(rB
1.57 kristaps 703: .Ed
704: .Pp
705: .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
706: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
1.64 kristaps 707: .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
1.63 kristaps 708: .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
1.64 kristaps 709: .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
710: .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
711: .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
712: .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
713: .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
714: .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
715: .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
716: .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
717: .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
718: .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
719: .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
720: .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
721: .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
722: .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
723: .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
724: .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
1.63 kristaps 725: .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
726: .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
1.64 kristaps 727: .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
728: .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
729: .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
730: .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
1.57 kristaps 731: .El
732: .Ss Block partial-implicit
1.50 kristaps 733: Like block full-implicit, but with single-line scope closed by
1.57 kristaps 734: .Sx Reserved Characters
1.43 kristaps 735: or end of line.
1.57 kristaps 736: .Bd -literal -offset indent
1.43 kristaps 737: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
1.57 kristaps 738: .Ed
739: .Pp
740: .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
741: .It Em Macro Ta Em Callable Ta Em Parsable
1.64 kristaps 742: .It Sx \&Aq Ta Yes Ta Yes
743: .It Sx \&Bq Ta Yes Ta Yes
744: .It Sx \&Brq Ta Yes Ta Yes
745: .It Sx \&D1 Ta \&No Ta \&Yes
746: .It Sx \&Dl Ta \&No Ta Yes
747: .It Sx \&Dq Ta Yes Ta Yes
748: .It Sx \&Op Ta Yes Ta Yes
749: .It Sx \&Pq Ta Yes Ta Yes
750: .It Sx \&Ql Ta Yes Ta Yes
751: .It Sx \&Qq Ta Yes Ta Yes
752: .It Sx \&Sq Ta Yes Ta Yes
1.83 kristaps 753: .It Sx \&Vt Ta Yes Ta Yes
1.57 kristaps 754: .El
1.83 kristaps 755: .Pp
756: Note that the
757: .Sx \&Vt
758: macro is a
759: .Sx Block partial-implicit
760: only when invoked as the first macro
1.109 kristaps 761: in a
762: .Em SYNOPSIS
763: section line, else it is
1.83 kristaps 764: .Sx In-line .
1.57 kristaps 765: .Ss In-line
1.50 kristaps 766: Closed by
1.57 kristaps 767: .Sx Reserved Characters ,
1.100 kristaps 768: end of line, fixed argument lengths, and/or subsequent macros.
769: In-line macros have only text children.
770: If a number (or inequality) of arguments is
1.57 kristaps 771: .Pq n ,
1.3 kristaps 772: then the macro accepts an arbitrary number of arguments.
1.57 kristaps 773: .Bd -literal -offset indent
1.43 kristaps 774: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
775:
776: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
777:
778: \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
1.57 kristaps 779: .Ed
780: .Pp
781: .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
782: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
1.63 kristaps 783: .It Sx \&%A Ta \&No Ta \&No Ta >0
784: .It Sx \&%B Ta \&No Ta \&No Ta >0
785: .It Sx \&%C Ta \&No Ta \&No Ta >0
786: .It Sx \&%D Ta \&No Ta \&No Ta >0
787: .It Sx \&%I Ta \&No Ta \&No Ta >0
788: .It Sx \&%J Ta \&No Ta \&No Ta >0
789: .It Sx \&%N Ta \&No Ta \&No Ta >0
790: .It Sx \&%O Ta \&No Ta \&No Ta >0
791: .It Sx \&%P Ta \&No Ta \&No Ta >0
1.69 kristaps 792: .It Sx \&%Q Ta \&No Ta \&No Ta >0
1.63 kristaps 793: .It Sx \&%R Ta \&No Ta \&No Ta >0
794: .It Sx \&%T Ta \&No Ta \&No Ta >0
1.69 kristaps 795: .It Sx \&%U Ta \&No Ta \&No Ta >0
1.63 kristaps 796: .It Sx \&%V Ta \&No Ta \&No Ta >0
1.64 kristaps 797: .It Sx \&Ad Ta Yes Ta Yes Ta n
798: .It Sx \&An Ta Yes Ta Yes Ta n
799: .It Sx \&Ap Ta Yes Ta Yes Ta 0
800: .It Sx \&Ar Ta Yes Ta Yes Ta n
801: .It Sx \&At Ta Yes Ta Yes Ta 1
802: .It Sx \&Bsx Ta Yes Ta Yes Ta n
803: .It Sx \&Bt Ta \&No Ta \&No Ta 0
804: .It Sx \&Bx Ta Yes Ta Yes Ta n
805: .It Sx \&Cd Ta Yes Ta Yes Ta >0
806: .It Sx \&Cm Ta Yes Ta Yes Ta n
807: .It Sx \&Db Ta \&No Ta \&No Ta 1
808: .It Sx \&Dd Ta \&No Ta \&No Ta >0
809: .It Sx \&Dt Ta \&No Ta \&No Ta n
810: .It Sx \&Dv Ta Yes Ta Yes Ta n
811: .It Sx \&Dx Ta Yes Ta Yes Ta n
812: .It Sx \&Em Ta Yes Ta Yes Ta >0
813: .It Sx \&En Ta \&No Ta \&No Ta 0
814: .It Sx \&Er Ta Yes Ta Yes Ta >0
815: .It Sx \&Es Ta \&No Ta \&No Ta 0
816: .It Sx \&Ev Ta Yes Ta Yes Ta n
817: .It Sx \&Ex Ta \&No Ta \&No Ta n
818: .It Sx \&Fa Ta Yes Ta Yes Ta n
819: .It Sx \&Fd Ta \&No Ta \&No Ta >0
820: .It Sx \&Fl Ta Yes Ta Yes Ta n
821: .It Sx \&Fn Ta Yes Ta Yes Ta >0
822: .It Sx \&Fr Ta \&No Ta \&No Ta n
823: .It Sx \&Ft Ta Yes Ta Yes Ta n
824: .It Sx \&Fx Ta Yes Ta Yes Ta n
825: .It Sx \&Hf Ta \&No Ta \&No Ta n
826: .It Sx \&Ic Ta Yes Ta Yes Ta >0
827: .It Sx \&In Ta \&No Ta \&No Ta n
828: .It Sx \&Lb Ta \&No Ta \&No Ta 1
829: .It Sx \&Li Ta Yes Ta Yes Ta n
830: .It Sx \&Lk Ta Yes Ta Yes Ta n
831: .It Sx \&Lp Ta \&No Ta \&No Ta 0
832: .It Sx \&Ms Ta Yes Ta Yes Ta >0
833: .It Sx \&Mt Ta Yes Ta Yes Ta >0
834: .It Sx \&Nm Ta Yes Ta Yes Ta n
835: .It Sx \&No Ta Yes Ta Yes Ta 0
836: .It Sx \&Ns Ta Yes Ta Yes Ta 0
837: .It Sx \&Nx Ta Yes Ta Yes Ta n
838: .It Sx \&Os Ta \&No Ta \&No Ta n
839: .It Sx \&Ot Ta \&No Ta \&No Ta n
840: .It Sx \&Ox Ta Yes Ta Yes Ta n
841: .It Sx \&Pa Ta Yes Ta Yes Ta n
1.88 kristaps 842: .It Sx \&Pf Ta Yes Ta Yes Ta 1
1.64 kristaps 843: .It Sx \&Pp Ta \&No Ta \&No Ta 0
844: .It Sx \&Rv Ta \&No Ta \&No Ta n
845: .It Sx \&Sm Ta \&No Ta \&No Ta 1
846: .It Sx \&St Ta \&No Ta Yes Ta 1
847: .It Sx \&Sx Ta Yes Ta Yes Ta >0
848: .It Sx \&Sy Ta Yes Ta Yes Ta >0
849: .It Sx \&Tn Ta Yes Ta Yes Ta >0
850: .It Sx \&Ud Ta \&No Ta \&No Ta 0
851: .It Sx \&Ux Ta Yes Ta Yes Ta n
852: .It Sx \&Va Ta Yes Ta Yes Ta n
853: .It Sx \&Vt Ta Yes Ta Yes Ta >0
1.84 kristaps 854: .It Sx \&Xr Ta Yes Ta Yes Ta >0
1.64 kristaps 855: .It Sx \&br Ta \&No Ta \&No Ta 0
856: .It Sx \&sp Ta \&No Ta \&No Ta 1
1.82 kristaps 857: .El
1.63 kristaps 858: .Sh REFERENCE
859: This section is a canonical reference of all macros, arranged
1.100 kristaps 860: alphabetically.
861: For the scoping of individual macros, see
1.63 kristaps 862: .Sx MACRO SYNTAX .
863: .Ss \&%A
864: Author name of an
865: .Sx \&Rs
1.138 kristaps 866: block.
867: Multiple authors should each be accorded their own
1.64 kristaps 868: .Sx \%%A
1.138 kristaps 869: line.
870: Author names should be ordered with full or abbreviated forename(s)
871: first, then full surname.
1.63 kristaps 872: .Ss \&%B
873: Book title of an
874: .Sx \&Rs
1.138 kristaps 875: block.
876: This macro may also be used in a non-bibliographic context when
1.63 kristaps 877: referring to book titles.
878: .Ss \&%C
879: Publication city or location of an
880: .Sx \&Rs
881: block.
882: .Pp
1.65 kristaps 883: .Em Remarks :
1.63 kristaps 884: this macro is not implemented in
885: .Xr groff 1 .
886: .Ss \&%D
887: Publication date of an
888: .Sx \&Rs
1.138 kristaps 889: block.
890: This should follow the reduced or canonical form syntax described in
1.63 kristaps 891: .Sx Dates .
892: .Ss \&%I
893: Publisher or issuer name of an
894: .Sx \&Rs
895: block.
896: .Ss \&%J
897: Journal name of an
898: .Sx \&Rs
899: block.
900: .Ss \&%N
901: Issue number (usually for journals) of an
902: .Sx \&Rs
903: block.
904: .Ss \&%O
905: Optional information of an
906: .Sx \&Rs
907: block.
908: .Ss \&%P
909: Book or journal page number of an
910: .Sx \&Rs
911: block.
912: .Ss \&%Q
913: Institutional author (school, government, etc.) of an
914: .Sx \&Rs
1.138 kristaps 915: block.
916: Multiple institutional authors should each be accorded their own
1.64 kristaps 917: .Sx \&%Q
1.63 kristaps 918: line.
919: .Ss \&%R
920: Technical report name of an
921: .Sx \&Rs
922: block.
923: .Ss \&%T
924: Article title of an
925: .Sx \&Rs
1.138 kristaps 926: block.
927: This macro may also be used in a non-bibliographical context when
928: referring to article titles.
1.69 kristaps 929: .Ss \&%U
1.70 kristaps 930: URI of reference document.
1.63 kristaps 931: .Ss \&%V
932: Volume number of an
933: .Sx \&Rs
934: block.
935: .Ss \&Ac
936: Closes an
937: .Sx \&Ao
1.138 kristaps 938: block.
939: Does not have any tail arguments.
1.63 kristaps 940: .Ss \&Ad
941: Address construct: usually in the context of an computational address in
942: memory, not a physical (post) address.
943: .Pp
1.64 kristaps 944: Examples:
1.91 kristaps 945: .D1 \&.Ad [0,$]
946: .D1 \&.Ad 0x00000000
1.63 kristaps 947: .Ss \&An
1.100 kristaps 948: Author name.
949: This macro may alternatively accepts the following arguments, although
950: these may not be specified along with a parameter:
1.140 ! kristaps 951: .Pp
! 952: .Bl -tag -width "-nosplitX" -offset indent -compact
1.64 kristaps 953: .It Fl split
1.66 kristaps 954: Renders a line break before each author listing.
1.64 kristaps 955: .It Fl nosplit
956: The opposite of
957: .Fl split .
958: .El
959: .Pp
1.140 ! kristaps 960: In the
! 961: .Em AUTHORS
! 962: section, the default is not to split the first author
1.64 kristaps 963: listing, but all subsequent author listings, whether or not they're
1.100 kristaps 964: interspersed by other macros or text, are split.
965: Thus, specifying
1.64 kristaps 966: .Fl split
1.100 kristaps 967: will cause the first listing also to be split.
1.140 ! kristaps 968: If not in the
! 969: .Em AUTHORS
! 970: section, the default is not to split.
1.64 kristaps 971: .Pp
972: Examples:
1.91 kristaps 973: .D1 \&.An -nosplit
974: .D1 \&.An J. D. Ullman .
1.64 kristaps 975: .Pp
976: .Em Remarks :
977: the effects of
978: .Fl split
979: or
980: .Fl nosplit
1.140 ! kristaps 981: are re-set when entering the
! 982: .Em AUTHORS
! 983: section, so if one specifies
1.64 kristaps 984: .Sx \&An Fl nosplit
1.140 ! kristaps 985: in the general document body, it must be re-specified in the
! 986: .Em AUTHORS
1.64 kristaps 987: section.
1.63 kristaps 988: .Ss \&Ao
1.100 kristaps 989: Begins a block enclosed by angled brackets.
990: Does not have any head arguments.
1.63 kristaps 991: .Pp
1.64 kristaps 992: Examples:
1.91 kristaps 993: .D1 \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
1.63 kristaps 994: .Pp
1.64 kristaps 995: See also
996: .Sx \&Aq .
1.63 kristaps 997: .Ss \&Ap
1.138 kristaps 998: Inserts an apostrophe without any surrounding whitespace.
1.124 kristaps 999: This is generally used as a grammatical device when referring to the verb
1.140 ! kristaps 1000: form of a function.
! 1001: .Pp
! 1002: Examples:
! 1003: .D1 \&.Fn execve \&Ap d
1.63 kristaps 1004: .Ss \&Aq
1.82 kristaps 1005: Encloses its arguments in angled brackets.
1.64 kristaps 1006: .Pp
1007: Examples:
1.91 kristaps 1008: .D1 \&.Fl -key= \&Ns \&Aq \&Ar val
1.64 kristaps 1009: .Pp
1010: .Em Remarks :
1011: this macro is often abused for rendering URIs, which should instead use
1012: .Sx \&Lk
1013: or
1014: .Sx \&Mt ,
1015: or to note pre-processor
1016: .Dq Li #include
1017: statements, which should use
1018: .Sx \&In .
1019: .Pp
1020: See also
1021: .Sx \&Ao .
1.63 kristaps 1022: .Ss \&Ar
1.100 kristaps 1023: Command arguments.
1024: If an argument is not provided, the string
1.64 kristaps 1025: .Dq file ...
1.66 kristaps 1026: is used as a default.
1.64 kristaps 1027: .Pp
1028: Examples:
1.91 kristaps 1029: .D1 \&.Fl o \&Ns \&Ar file1
1030: .D1 \&.Ar
1031: .D1 \&.Ar arg1 , arg2 .
1.63 kristaps 1032: .Ss \&At
1.100 kristaps 1033: Formats an AT&T version.
1034: Accepts at most one parameter:
1.140 ! kristaps 1035: .Pp
! 1036: .Bl -tag -width "v[1-7] | 32vX" -offset indent -compact
1.64 kristaps 1037: .It Cm v[1-7] | 32v
1038: A version of
1039: .At .
1040: .It Cm V[.[1-4]]?
1041: A system version of
1042: .At .
1043: .El
1044: .Pp
1045: Note that these parameters do not begin with a hyphen.
1046: .Pp
1047: Examples:
1.91 kristaps 1048: .D1 \&.At
1049: .D1 \&.At V.1
1.65 kristaps 1050: .Pp
1051: See also
1.66 kristaps 1052: .Sx \&Bsx ,
1.65 kristaps 1053: .Sx \&Bx ,
1.66 kristaps 1054: .Sx \&Dx ,
1.65 kristaps 1055: .Sx \&Fx ,
1056: .Sx \&Nx ,
1057: .Sx \&Ox ,
1058: and
1059: .Sx \&Ux .
1.63 kristaps 1060: .Ss \&Bc
1.64 kristaps 1061: Closes a
1062: .Sx \&Bo
1.138 kristaps 1063: block.
1064: Does not have any tail arguments.
1.63 kristaps 1065: .Ss \&Bd
1.100 kristaps 1066: Begins a display block.
1.131 kristaps 1067: Its syntax is as follows:
1068: .Bd -ragged -offset indent
1069: .Pf \. Sx \&Bd
1070: .Fl type
1071: .Op Fl offset Ar width
1072: .Op Fl compact
1073: .Ed
1074: .Pp
1.100 kristaps 1075: A display is collection of macros or text which may be collectively
1076: offset or justified in a manner different from that
1077: of the enclosing context.
1078: By default, the block is preceded by a vertical space.
1.64 kristaps 1079: .Pp
1080: Each display is associated with a type, which must be one of the
1081: following arguments:
1082: .Bl -tag -width 12n -offset indent
1083: .It Fl ragged
1084: Only left-justify the block.
1085: .It Fl unfilled
1086: Do not justify the block at all.
1087: .It Fl filled
1088: Left- and right-justify the block.
1089: .It Fl literal
1090: Alias for
1091: .Fl unfilled .
1092: .It Fl centered
1093: Centre-justify each line.
1094: .El
1095: .Pp
1.100 kristaps 1096: The type must be provided first.
1097: Secondary arguments are as follows:
1.64 kristaps 1098: .Bl -tag -width 12n -offset indent
1.131 kristaps 1099: .It Fl offset Ar val
1.64 kristaps 1100: Offset by the value of
1.131 kristaps 1101: .Ar val ,
1.64 kristaps 1102: which is interpreted as one of the following, specified in order:
1103: .Bl -item
1104: .It
1105: As one of the pre-defined strings
1106: .Ar indent ,
1107: the width of standard indentation;
1108: .Ar indent-two ,
1109: twice
1110: .Ar indent ;
1111: .Ar left ,
1.131 kristaps 1112: which has no effect;
1.64 kristaps 1113: .Ar right ,
1114: which justifies to the right margin; and
1115: .Ar center ,
1116: which aligns around an imagined centre axis.
1117: .It
1.100 kristaps 1118: As a precalculated width for a named macro.
1119: The most popular is the imaginary macro
1.67 kristaps 1120: .Ar \&Ds ,
1.64 kristaps 1121: which resolves to
1122: .Ar 6n .
1123: .It
1124: As a scaling unit following the syntax described in
1125: .Sx Scaling Widths .
1126: .It
1127: As the calculated string length of the opaque string.
1128: .El
1129: .Pp
1.126 kristaps 1130: If not provided an argument, it will be ignored.
1.64 kristaps 1131: .It Fl compact
1132: Do not assert a vertical space before the block.
1133: .El
1134: .Pp
1135: Examples:
1136: .Bd -literal -offset indent
1137: \&.Bd \-unfilled \-offset two-indent \-compact
1.65 kristaps 1138: Hello world.
1.64 kristaps 1139: \&.Ed
1140: .Ed
1.66 kristaps 1141: .Pp
1142: See also
1143: .Sx \&D1
1144: and
1145: .Sx \&Dl .
1.63 kristaps 1146: .Ss \&Bf
1.129 kristaps 1147: Change the font mode for a scoped block of text.
1148: Its syntax is as follows:
1149: .Bd -ragged -offset indent
1150: .Pf \. Sx \&Bf
1151: .Oo
1152: .Fl emphasis | literal | symbolic |
1153: .Cm \&Em | \&Li | \&Sy
1154: .Oc
1155: .Ed
1156: .Pp
1157: The
1158: .Fl emphasis
1159: and
1160: .Cm \&Em
1161: argument are equivalent, as are
1162: .Fl symbolic
1163: and
1164: .Cm \&Sy,
1165: and
1166: .Fl literal
1167: and
1168: .Cm \&Li .
1169: Without an argument, this macro does nothing.
1170: The font mode continues until broken by a new font mode in a nested
1171: scope or
1172: .Sx \&Ef
1173: is encountered.
1174: .Pp
1175: See also
1176: .Sx \&Li ,
1177: .Sx \&Ef ,
1178: and
1179: .Sx \&Sy .
1.63 kristaps 1180: .Ss \&Bk
1.133 kristaps 1181: Begins a collection of macros or text not breaking the line.
1.131 kristaps 1182: Its syntax is as follows:
1183: .Pp
1184: .D1 Pf \. Sx \&Bk Fl words
1185: .Pp
1186: Subsequent arguments are ignored.
1.133 kristaps 1187: The
1188: .Fl words
1189: argument is required.
1.127 schwarze 1190: .Pp
1.133 kristaps 1191: Each line within a keep block is kept intact, so the following example
1192: will not break within each
1193: .Sx \&Op
1194: macro line:
1.127 schwarze 1195: .Bd -literal -offset indent
1196: \&.Bk \-words
1.133 kristaps 1197: \&.Op Fl f Ar flags
1198: \&.Op Fl o Ar output
1.127 schwarze 1199: \&.Ek
1200: .Ed
1.129 kristaps 1201: .Pp
1.133 kristaps 1202: Be careful in using over-long lines within a keep block!
1203: Doing so will clobber the right margin.
1.63 kristaps 1204: .Ss \&Bl
1.103 kristaps 1205: Begins a list composed of one or more list entries.
1.131 kristaps 1206: Its syntax is as follows:
1207: .Bd -ragged -offset indent
1208: .Pf \. Sx \&Bl
1209: .Fl type
1210: .Op Fl width Ar val
1211: .Op Fl offset Ar val
1212: .Op Fl compact
1213: .Op HEAD ...
1214: .Ed
1215: .Pp
1.104 kristaps 1216: A list is associated with a type, which is a required argument.
1217: Other arguments are
1218: .Fl width ,
1219: defined per-type as accepting a literal or
1220: .Sx Scaling Widths
1221: value;
1222: .Fl offset ,
1223: also accepting a literal or
1224: .Sx Scaling Widths
1225: value setting the list's global offset; and
1226: .Fl compact ,
1227: suppressing the default vertical space printed before each list entry.
1.103 kristaps 1228: A list entry is specified by the
1229: .Sx \&It
1230: macro, which consists of a head and optional body (depending on the list
1231: type).
1232: A list must specify one of the following list types:
1233: .Bl -tag -width 12n -offset indent
1234: .It Fl bullet
1235: A list offset by a bullet.
1236: The head of list entries must be empty.
1237: List entry bodies are positioned after the bullet.
1.104 kristaps 1238: The
1239: .Fl width
1240: argument varies the width of list bodies' left-margins.
1.103 kristaps 1241: .It Fl column
1242: A columnated list.
1.104 kristaps 1243: The
1244: .Fl width
1245: argument has no effect.
1.103 kristaps 1246: The number of columns is specified as parameters to the
1247: .Sx \&Bl
1248: macro.
1249: These dictate the width of columns either as
1250: .Sx Scaling Widths
1251: or literal text.
1.114 kristaps 1252: If the initial macro of a
1253: .Fl column
1254: list is not an
1255: .Sx \&It ,
1256: an
1257: .Sx \&It
1258: context spanning each line is implied until an
1259: .Sx \&It
1260: line macro is encountered, at which point list bodies are interpreted as
1261: described in the
1262: .Sx \&It
1263: documentation.
1.103 kristaps 1264: .It Fl dash
1265: A list offset by a dash (hyphen).
1266: The head of list entries must be empty.
1267: List entry bodies are positioned past the dash.
1.104 kristaps 1268: The
1269: .Fl width
1270: argument varies the width of list bodies' left-margins.
1.103 kristaps 1271: .It Fl diag
1272: Like
1273: .Fl inset ,
1274: but with additional formatting to the head.
1.104 kristaps 1275: The
1276: .Fl width
1277: argument varies the width of list bodies' left-margins.
1.103 kristaps 1278: .It Fl enum
1279: An enumerated list offset by the enumeration from 1.
1280: The head of list entries must be empty.
1281: List entry bodies are positioned after the enumeration.
1.104 kristaps 1282: The
1283: .Fl width
1284: argument varies the width of list bodies' left-margins.
1.103 kristaps 1285: .It Fl hang
1286: Like
1287: .Fl tag ,
1288: but instead of list bodies positioned after the head, they trail the
1289: head text.
1.104 kristaps 1290: The
1291: .Fl width
1292: argument varies the width of list bodies' left-margins.
1.103 kristaps 1293: .It Fl hyphen
1294: Synonym for
1295: .Fl dash .
1296: .It Fl inset
1297: List bodies follow the list head.
1.104 kristaps 1298: The
1299: .Fl width
1300: argument is ignored.
1.103 kristaps 1301: .It Fl item
1302: This produces blocks of text.
1303: The head of list entries must be empty.
1.104 kristaps 1304: The
1305: .Fl width
1306: argument is ignored.
1.103 kristaps 1307: .It Fl ohang
1308: List bodies are positioned on the line following the head.
1.104 kristaps 1309: The
1310: .Fl width
1311: argument is ignored.
1.103 kristaps 1312: .It Fl tag
1.138 kristaps 1313: A list offset by list entry heads.
1314: List entry bodies are positioned after the head as specified by the
1.103 kristaps 1315: .Fl width
1316: argument.
1317: .El
1.114 kristaps 1318: .Pp
1319: See also
1320: .Sx \&It .
1.63 kristaps 1321: .Ss \&Bo
1.100 kristaps 1322: Begins a block enclosed by square brackets.
1323: Does not have any head arguments.
1.65 kristaps 1324: .Pp
1325: Examples:
1.140 ! kristaps 1326: .Bd -literal -offset indent -compact
1.65 kristaps 1327: \&.Bo 1 ,
1.91 kristaps 1328: \&.Dv BUFSIZ \&Bc
1.65 kristaps 1329: .Ed
1330: .Pp
1331: See also
1332: .Sx \&Bq .
1.63 kristaps 1333: .Ss \&Bq
1.82 kristaps 1334: Encloses its arguments in square brackets.
1.65 kristaps 1335: .Pp
1336: Examples:
1.91 kristaps 1337: .D1 \&.Bq 1 , \&Dv BUFSIZ
1.65 kristaps 1338: .Pp
1339: .Em Remarks :
1340: this macro is sometimes abused to emulate optional arguments for
1341: commands; the correct macros to use for this purpose are
1342: .Sx \&Op ,
1343: .Sx \&Oo ,
1344: and
1345: .Sx \&Oc .
1346: .Pp
1347: See also
1348: .Sx \&Bo .
1.63 kristaps 1349: .Ss \&Brc
1.65 kristaps 1350: Closes a
1351: .Sx \&Bro
1.138 kristaps 1352: block.
1353: Does not have any tail arguments.
1.63 kristaps 1354: .Ss \&Bro
1.100 kristaps 1355: Begins a block enclosed by curly braces.
1356: Does not have any head arguments.
1.65 kristaps 1357: .Pp
1358: Examples:
1.140 ! kristaps 1359: .Bd -literal -offset indent -compact
1.65 kristaps 1360: \&.Bro 1 , ... ,
1.91 kristaps 1361: \&.Va n \&Brc
1.65 kristaps 1362: .Ed
1363: .Pp
1364: See also
1365: .Sx \&Brq .
1.63 kristaps 1366: .Ss \&Brq
1.65 kristaps 1367: Encloses its arguments in curly braces.
1368: .Pp
1369: Examples:
1.91 kristaps 1370: .D1 \&.Brq 1 , ... , \&Va n
1.65 kristaps 1371: .Pp
1372: See also
1373: .Sx \&Bro .
1.63 kristaps 1374: .Ss \&Bsx
1.65 kristaps 1375: Format the BSD/OS version provided as an argument, or a default value if
1376: no argument is provided.
1377: .Pp
1378: Examples:
1.91 kristaps 1379: .D1 \&.Bsx 1.0
1380: .D1 \&.Bsx
1.65 kristaps 1381: .Pp
1382: See also
1383: .Sx \&At ,
1384: .Sx \&Bx ,
1.66 kristaps 1385: .Sx \&Dx ,
1.65 kristaps 1386: .Sx \&Fx ,
1387: .Sx \&Nx ,
1388: .Sx \&Ox ,
1389: and
1390: .Sx \&Ux .
1.63 kristaps 1391: .Ss \&Bt
1.66 kristaps 1392: Prints
1393: .Dq is currently in beta test.
1.63 kristaps 1394: .Ss \&Bx
1.65 kristaps 1395: Format the BSD version provided as an argument, or a default value if no
1396: argument is provided.
1397: .Pp
1398: Examples:
1.91 kristaps 1399: .D1 \&.Bx 4.4
1400: .D1 \&.Bx
1.65 kristaps 1401: .Pp
1402: See also
1403: .Sx \&At ,
1404: .Sx \&Bsx ,
1.66 kristaps 1405: .Sx \&Dx ,
1.65 kristaps 1406: .Sx \&Fx ,
1407: .Sx \&Nx ,
1408: .Sx \&Ox ,
1409: and
1410: .Sx \&Ux .
1.63 kristaps 1411: .Ss \&Cd
1.100 kristaps 1412: Configuration declaration.
1413: This denotes strings accepted by
1.66 kristaps 1414: .Xr config 8 .
1415: .Pp
1416: Examples:
1.91 kristaps 1417: .D1 \&.Cd device le0 at scode?
1.66 kristaps 1418: .Pp
1419: .Em Remarks :
1420: this macro is commonly abused by using quoted literals to retain
1.138 kristaps 1421: whitespace and align consecutive
1.66 kristaps 1422: .Sx \&Cd
1.100 kristaps 1423: declarations.
1424: This practise is discouraged.
1.63 kristaps 1425: .Ss \&Cm
1.100 kristaps 1426: Command modifiers.
1427: Useful when specifying configuration options or keys.
1.66 kristaps 1428: .Pp
1429: Examples:
1.91 kristaps 1430: .D1 \&.Cm ControlPath
1431: .D1 \&.Cm ControlMaster
1.66 kristaps 1432: .Pp
1433: See also
1434: .Sx \&Fl .
1.63 kristaps 1435: .Ss \&D1
1.100 kristaps 1436: One-line indented display.
1437: This is formatted by the default rules and is useful for simple indented
1438: statements.
1439: It is followed by a newline.
1.66 kristaps 1440: .Pp
1441: Examples:
1.91 kristaps 1442: .D1 \&.D1 \&Fl abcdefgh
1.66 kristaps 1443: .Pp
1444: See also
1445: .Sx \&Bd
1446: and
1447: .Sx \&Dl .
1.63 kristaps 1448: .Ss \&Db
1.117 kristaps 1449: Start a debugging context.
1450: This macro is parsed, but generally ignored.
1.120 kristaps 1451: Its syntax is as follows:
1.117 kristaps 1452: .Pp
1.120 kristaps 1453: .D1 Pf \. Sx \&Db Cm on | off
1.63 kristaps 1454: .Ss \&Dc
1.66 kristaps 1455: Closes a
1456: .Sx \&Do
1.138 kristaps 1457: block.
1458: Does not have any tail arguments.
1.63 kristaps 1459: .Ss \&Dd
1.100 kristaps 1460: Document date.
1461: This is the mandatory first macro of any
1.66 kristaps 1462: .Nm
1.100 kristaps 1463: manual.
1.120 kristaps 1464: Its syntax is as follows:
1.66 kristaps 1465: .Pp
1.120 kristaps 1466: .D1 Pf \. Sx \&Dd Cm date
1.66 kristaps 1467: .Pp
1.82 kristaps 1468: The
1.66 kristaps 1469: .Cm date
1470: field may be either
1471: .Ar $\&Mdocdate$ ,
1472: which signifies the current manual revision date dictated by
1.72 kristaps 1473: .Xr cvs 1 ,
1.66 kristaps 1474: or instead a valid canonical date as specified by
1475: .Sx Dates .
1.72 kristaps 1476: If a date does not conform, the current date is used instead.
1.66 kristaps 1477: .Pp
1478: Examples:
1.91 kristaps 1479: .D1 \&.Dd $\&Mdocdate$
1480: .D1 \&.Dd $\&Mdocdate: July 21 2007$
1481: .D1 \&.Dd July 21, 2007
1.66 kristaps 1482: .Pp
1483: See also
1484: .Sx \&Dt
1485: and
1486: .Sx \&Os .
1.63 kristaps 1487: .Ss \&Dl
1.100 kristaps 1488: One-line intended display.
1489: This is formatted as literal text and is useful for commands and
1490: invocations.
1491: It is followed by a newline.
1.66 kristaps 1492: .Pp
1493: Examples:
1.140 ! kristaps 1494: .D1 \&.Dl % mandoc mdoc.7 \e(ba less
1.66 kristaps 1495: .Pp
1496: See also
1497: .Sx \&Bd
1498: and
1499: .Sx \&D1 .
1.63 kristaps 1500: .Ss \&Do
1.138 kristaps 1501: Begins a block enclosed by double quotes.
1502: Does not have any head arguments.
1.66 kristaps 1503: .Pp
1504: Examples:
1.140 ! kristaps 1505: .Bd -literal -offset indent -compact
! 1506: \&.Do
! 1507: April is the cruellest month
! 1508: \&.Dc
! 1509: \e(em T.S. Eliot
! 1510: .Ed
1.66 kristaps 1511: .Pp
1512: See also
1513: .Sx \&Dq .
1.63 kristaps 1514: .Ss \&Dq
1.138 kristaps 1515: Encloses its arguments in
1516: .Dq typographic
1517: double-quotes.
1.66 kristaps 1518: .Pp
1519: Examples:
1.91 kristaps 1520: .Bd -literal -offset indent -compact
1.66 kristaps 1521: \&.Dq April is the cruellest month
1522: \e(em T.S. Eliot
1523: .Ed
1524: .Pp
1525: See also
1.139 kristaps 1526: .Sx \&Qq ,
1527: .Sx \&Sq ,
1.138 kristaps 1528: and
1.66 kristaps 1529: .Sx \&Do .
1.139 kristaps 1530: .Ss \&Dt
1.100 kristaps 1531: Document title.
1532: This is the mandatory second macro of any
1.66 kristaps 1533: .Nm
1.100 kristaps 1534: file.
1.120 kristaps 1535: Its syntax is as follows:
1536: .Bd -ragged -offset indent
1537: .Pf \. Sx \&Dt
1538: .Oo
1539: .Cm title
1540: .Oo
1541: .Cm section
1542: .Op Cm volume | arch
1543: .Oc
1544: .Oc
1545: .Ed
1.66 kristaps 1546: .Pp
1547: Its arguments are as follows:
1548: .Bl -tag -width Ds -offset Ds
1549: .It Cm title
1.111 kristaps 1550: The document's title (name), defaulting to
1.138 kristaps 1551: .Dq UNKNOWN
1.111 kristaps 1552: if unspecified.
1553: It should be capitalised.
1.66 kristaps 1554: .It Cm section
1.100 kristaps 1555: The manual section.
1556: This may be one of
1.66 kristaps 1557: .Ar 1
1558: .Pq utilities ,
1559: .Ar 2
1560: .Pq system calls ,
1561: .Ar 3
1562: .Pq libraries ,
1563: .Ar 3p
1564: .Pq Perl libraries ,
1565: .Ar 4
1566: .Pq devices ,
1567: .Ar 5
1568: .Pq file formats ,
1569: .Ar 6
1570: .Pq games ,
1571: .Ar 7
1572: .Pq miscellaneous ,
1573: .Ar 8
1574: .Pq system utilities ,
1575: .Ar 9
1576: .Pq kernel functions ,
1577: .Ar X11
1578: .Pq X Window System ,
1579: .Ar X11R6
1580: .Pq X Window System ,
1581: .Ar unass
1582: .Pq unassociated ,
1583: .Ar local
1584: .Pq local system ,
1585: .Ar draft
1586: .Pq draft manual ,
1587: or
1588: .Ar paper
1589: .Pq paper .
1.111 kristaps 1590: It should correspond to the manual's filename suffix and defaults to
1.138 kristaps 1591: .Dq 1
1.111 kristaps 1592: if unspecified.
1.66 kristaps 1593: .It Cm volume
1594: This overrides the volume inferred from
1595: .Ar section .
1596: This field is optional, and if specified, must be one of
1597: .Ar USD
1598: .Pq users' supplementary documents ,
1599: .Ar PS1
1600: .Pq programmers' supplementary documents ,
1601: .Ar AMD
1602: .Pq administrators' supplementary documents ,
1603: .Ar SMM
1604: .Pq system managers' manuals ,
1605: .Ar URM
1606: .Pq users' reference manuals ,
1607: .Ar PRM
1608: .Pq programmers' reference manuals ,
1609: .Ar KM
1610: .Pq kernel manuals ,
1611: .Ar IND
1612: .Pq master index ,
1613: .Ar MMI
1614: .Pq master index ,
1615: .Ar LOCAL
1616: .Pq local manuals ,
1617: .Ar LOC
1618: .Pq local manuals ,
1619: or
1620: .Ar CON
1621: .Pq contributed manuals .
1622: .It Cm arch
1.100 kristaps 1623: This specifies a specific relevant architecture.
1624: If
1.66 kristaps 1625: .Cm volume
1626: is not provided, it may be used in its place, else it may be used
1.100 kristaps 1627: subsequent that.
1628: It, too, is optional.
1629: It must be one of
1.66 kristaps 1630: .Ar alpha ,
1631: .Ar amd64 ,
1632: .Ar amiga ,
1633: .Ar arc ,
1634: .Ar arm ,
1635: .Ar armish ,
1636: .Ar aviion ,
1637: .Ar hp300 ,
1638: .Ar hppa ,
1639: .Ar hppa64 ,
1640: .Ar i386 ,
1641: .Ar landisk ,
1.86 kristaps 1642: .Ar loongson ,
1.66 kristaps 1643: .Ar luna88k ,
1644: .Ar mac68k ,
1645: .Ar macppc ,
1646: .Ar mvme68k ,
1647: .Ar mvme88k ,
1648: .Ar mvmeppc ,
1649: .Ar pmax ,
1650: .Ar sgi ,
1651: .Ar socppc ,
1652: .Ar sparc ,
1653: .Ar sparc64 ,
1654: .Ar sun3 ,
1655: .Ar vax ,
1656: or
1657: .Ar zaurus .
1658: .El
1659: .Pp
1660: Examples:
1.91 kristaps 1661: .D1 \&.Dt FOO 1
1662: .D1 \&.Dt FOO 4 KM
1663: .D1 \&.Dt FOO 9 i386
1.66 kristaps 1664: .Pp
1665: See also
1666: .Sx \&Dd
1667: and
1668: .Sx \&Os .
1.63 kristaps 1669: .Ss \&Dv
1.66 kristaps 1670: Defined variables such as preprocessor constants.
1671: .Pp
1672: Examples:
1.91 kristaps 1673: .D1 \&.Dv BUFSIZ
1674: .D1 \&.Dv STDOUT_FILENO
1.66 kristaps 1675: .Pp
1676: See also
1677: .Sx \&Er .
1.63 kristaps 1678: .Ss \&Dx
1.71 kristaps 1679: Format the DragonFly BSD version provided as an argument, or a default
1.66 kristaps 1680: value if no argument is provided.
1681: .Pp
1682: Examples:
1.91 kristaps 1683: .D1 \&.Dx 2.4.1
1684: .D1 \&.Dx
1.66 kristaps 1685: .Pp
1686: See also
1687: .Sx \&At ,
1688: .Sx \&Bsx ,
1689: .Sx \&Bx ,
1690: .Sx \&Fx ,
1691: .Sx \&Nx ,
1692: .Sx \&Ox ,
1693: and
1694: .Sx \&Ux .
1.63 kristaps 1695: .Ss \&Ec
1.131 kristaps 1696: Close a scope started by
1697: .Sx \&Eo .
1698: Its syntax is as follows:
1699: .Pp
1700: .D1 Pf \. Sx \&Ec Op Cm TERM
1701: .Pp
1702: The
1703: .Cm TERM
1704: argument is used as the enclosure tail, for example, specifying \e(rq
1705: will emulate
1706: .Sx \&Dc .
1.63 kristaps 1707: .Ss \&Ed
1.131 kristaps 1708: End a display context started by
1709: .Sx \&Bd .
1.63 kristaps 1710: .Ss \&Ef
1.129 kristaps 1711: Ends a font mode context started by
1712: .Sx \&Bf .
1.63 kristaps 1713: .Ss \&Ek
1.127 schwarze 1714: Ends a keep context started by
1715: .Sx \&Bk .
1.63 kristaps 1716: .Ss \&El
1.117 kristaps 1717: Ends a list context started by
1718: .Sx \&Bl .
1719: .Pp
1720: See also
1721: .Sx \&Bl
1722: and
1723: .Sx \&It .
1.63 kristaps 1724: .Ss \&Em
1.100 kristaps 1725: Denotes text that should be emphasised.
1726: Note that this is a presentation term and should not be used for
1727: stylistically decorating technical terms.
1.66 kristaps 1728: .Pp
1729: Examples:
1.91 kristaps 1730: .D1 \&.Em Warnings!
1731: .D1 \&.Em Remarks :
1.138 kristaps 1732: .Pp
1733: See also
1734: .Sx \&Bf ,
1735: .Sx \&Sy ,
1736: and
1737: .Sx \&Li .
1.63 kristaps 1738: .Ss \&En
1.132 kristaps 1739: This macro is obsolete and not implemented.
1.63 kristaps 1740: .Ss \&Eo
1.131 kristaps 1741: An arbitrary enclosure.
1742: Its syntax is as follows:
1743: .Pp
1744: .D1 Pf \. Sx \&Eo Op Cm TERM
1745: .Pp
1746: The
1747: .Cm TERM
1748: argument is used as the enclosure head, for example, specifying \e(lq
1749: will emulate
1750: .Sx \&Do .
1.63 kristaps 1751: .Ss \&Er
1.90 kristaps 1752: Display error constants.
1.66 kristaps 1753: .Pp
1754: Examples:
1.91 kristaps 1755: .D1 \&.Er EPERM
1756: .D1 \&.Er ENOENT
1.66 kristaps 1757: .Pp
1758: See also
1759: .Sx \&Dv .
1.63 kristaps 1760: .Ss \&Es
1.132 kristaps 1761: This macro is obsolete and not implemented.
1.63 kristaps 1762: .Ss \&Ev
1.66 kristaps 1763: Environmental variables such as those specified in
1764: .Xr environ 7 .
1765: .Pp
1766: Examples:
1.91 kristaps 1767: .D1 \&.Ev DISPLAY
1768: .D1 \&.Ev PATH
1.63 kristaps 1769: .Ss \&Ex
1.139 kristaps 1770: Inserts text regarding a utility's exit value.
1771: This macro must consist of the
1.66 kristaps 1772: .Fl std
1.139 kristaps 1773: argument followed by an optional
1.66 kristaps 1774: .Ar utility .
1775: If
1776: .Ar utility
1777: is not provided, the document's name as stipulated in
1778: .Sx \&Nm
1779: is provided.
1.139 kristaps 1780: .Pp
1781: See also
1782: .Sx \&Rv .
1.63 kristaps 1783: .Ss \&Fa
1.117 kristaps 1784: Function argument.
1.120 kristaps 1785: Its syntax is as follows:
1786: .Bd -ragged -offset indent
1787: .Pf \. Sx \&Fa
1788: .Op Cm argtype
1789: .Cm argname
1790: .Ed
1791: .Pp
1.117 kristaps 1792: This may be invoked for names with or without the corresponding type.
1793: It is also used to specify the field name of a structure.
1794: Most often, the
1795: .Sx \&Fa
1796: macro is used in the
1797: .Em SYNOPSIS
1.120 kristaps 1798: within
1799: .Sx \&Fo
1.117 kristaps 1800: section when documenting multi-line function prototypes.
1801: If invoked with multiple arguments, the arguments are separated by a
1802: comma.
1803: Furthermore, if the following macro is another
1804: .Sx \&Fa ,
1805: the last argument will also have a trailing comma.
1806: .Pp
1807: Examples:
1808: .D1 \&.Fa \(dqconst char *p\(dq
1809: .D1 \&.Fa \(dqint a\(dq \(dqint b\(dq \(dqint c\(dq
1810: .D1 \&.Fa foo
1.120 kristaps 1811: .Pp
1812: See also
1813: .Sx \&Fo .
1.63 kristaps 1814: .Ss \&Fc
1.131 kristaps 1815: Ends a function context started by
1816: .Sx \&Fo .
1.63 kristaps 1817: .Ss \&Fd
1.117 kristaps 1818: Historically used to document include files.
1819: This usage has been deprecated in favour of
1820: .Sx \&In .
1821: Do not use this macro.
1822: .Pp
1823: See also
1.122 kristaps 1824: .Sx MANUAL STRUCTURE
1825: and
1.117 kristaps 1826: .Sx \&In .
1.63 kristaps 1827: .Ss \&Fl
1.100 kristaps 1828: Command-line flag.
1829: Used when listing arguments to command-line utilities.
1830: Prints a fixed-width hyphen
1.79 kristaps 1831: .Sq \-
1.100 kristaps 1832: directly followed by each argument.
1833: If no arguments are provided, a hyphen is printed followed by a space.
1834: If the argument is a macro, a hyphen is prefixed to the subsequent macro
1835: output.
1.79 kristaps 1836: .Pp
1837: Examples:
1.91 kristaps 1838: .D1 \&.Fl a b c
1839: .D1 \&.Fl \&Pf a b
1840: .D1 \&.Fl
1841: .D1 \&.Op \&Fl o \&Ns \&Ar file
1.79 kristaps 1842: .Pp
1843: See also
1844: .Sx \&Cm .
1.63 kristaps 1845: .Ss \&Fn
1.119 kristaps 1846: A function name.
1.120 kristaps 1847: Its syntax is as follows:
1.119 kristaps 1848: .Bd -ragged -offset indent
1849: .Pf \. Ns Sx \&Fn
1850: .Op Cm functype
1851: .Cm funcname
1852: .Op Oo Cm argtype Oc Cm argname
1853: .Ed
1.120 kristaps 1854: .Pp
1.122 kristaps 1855: Function arguments are surrounded in parenthesis and
1.119 kristaps 1856: are delimited by commas.
1857: If no arguments are specified, blank parenthesis are output.
1858: .Pp
1859: Examples:
1860: .D1 \&.Fn "int funcname" "int arg0" "int arg1"
1861: .D1 \&.Fn funcname "int arg0"
1862: .D1 \&.Fn funcname arg0
1.120 kristaps 1863: .Bd -literal -offset indent -compact
1864: \&.Ft functype
1865: \&.Fn funcname
1866: .Ed
1.119 kristaps 1867: .Pp
1868: See also
1.122 kristaps 1869: .Sx MANUAL STRUCTURE
1.119 kristaps 1870: and
1871: .Sx \&Ft .
1.63 kristaps 1872: .Ss \&Fo
1.120 kristaps 1873: Begin a function block.
1874: This is a multi-line version of
1875: .Sx \&Fn .
1876: Its syntax is as follows:
1877: .Pp
1878: .D1 Pf \. Sx \&Fo Cm funcname
1879: .Pp
1880: Invocations usually occur in the following context:
1881: .Bd -ragged -offset indent
1882: .Pf \. Sx \&Ft Cm functype
1883: .br
1884: .Pf \. Sx \&Fo Cm funcname
1885: .br
1886: .Pf \. Sx \&Fa Oo Cm argtype Oc Cm argname
1887: .br
1888: \.\.\.
1889: .br
1890: .Pf \. Sx \&Fc
1891: .Ed
1892: .Pp
1893: A
1894: .Sx \&Fo
1895: scope is closed by
1896: .Pp
1897: See also
1.122 kristaps 1898: .Sx MANUAL STRUCTURE ,
1.120 kristaps 1899: .Sx \&Fa ,
1900: .Sx \&Fc ,
1901: and
1.139 kristaps 1902: .Sx \&Ft .
1.63 kristaps 1903: .Ss \&Ft
1.120 kristaps 1904: A function type.
1905: Its syntax is as follows:
1906: .Pp
1907: .D1 Pf \. Sx \&Ft Cm functype
1908: .Pp
1909: Examples:
1910: .D1 \&.Ft int
1911: .Bd -literal -offset indent -compact
1912: \&.Ft functype
1913: \&.Fn funcname
1914: .Ed
1915: .Pp
1916: See also
1.122 kristaps 1917: .Sx MANUAL STRUCTURE ,
1918: .Sx \&Fn ,
1.120 kristaps 1919: and
1.122 kristaps 1920: .Sx \&Fo .
1.63 kristaps 1921: .Ss \&Fx
1.65 kristaps 1922: Format the FreeBSD version provided as an argument, or a default value
1923: if no argument is provided.
1924: .Pp
1925: Examples:
1.91 kristaps 1926: .D1 \&.Fx 7.1
1927: .D1 \&.Fx
1.65 kristaps 1928: .Pp
1929: See also
1930: .Sx \&At ,
1.66 kristaps 1931: .Sx \&Bsx ,
1.65 kristaps 1932: .Sx \&Bx ,
1.66 kristaps 1933: .Sx \&Dx ,
1.65 kristaps 1934: .Sx \&Nx ,
1935: .Sx \&Ox ,
1936: and
1937: .Sx \&Ux .
1.63 kristaps 1938: .Ss \&Hf
1.132 kristaps 1939: This macro is obsolete and not implemented.
1.63 kristaps 1940: .Ss \&Ic
1.132 kristaps 1941: Designate an internal or interactive command.
1942: This is similar to
1943: .Sx \&Cm
1944: but used for instructions rather than values.
1945: .Pp
1946: Examples:
1947: .D1 \&.Ic hash
1948: .D1 \&.Ic alias
1949: .Pp
1950: Note that using
1951: .Sx \&Bd No Fl literal
1952: or
1953: .Sx \&D1
1954: is preferred for displaying code; the
1955: .Sx \&Ic
1956: macro is used when referring to specific instructions.
1.63 kristaps 1957: .Ss \&In
1.118 kristaps 1958: An
1.138 kristaps 1959: .Dq include
1.118 kristaps 1960: file.
1961: In the
1962: .Em SYNOPSIS
1963: section (only if invoked as the line macro), the first argument is
1964: preceded by
1.138 kristaps 1965: .Dq #include ,
1.122 kristaps 1966: the arguments is enclosed in angled braces.
1.118 kristaps 1967: .Pp
1.122 kristaps 1968: Examples:
1.118 kristaps 1969: .D1 \&.In sys/types
1.122 kristaps 1970: .Pp
1971: See also
1972: .Sx MANUAL STRUCTURE .
1.63 kristaps 1973: .Ss \&It
1.120 kristaps 1974: A list item.
1975: The syntax of this macro depends on the list type.
1.114 kristaps 1976: .Pp
1977: Lists
1978: of type
1979: .Fl hang ,
1980: .Fl ohang ,
1981: .Fl inset ,
1982: and
1983: .Fl diag
1.120 kristaps 1984: have the following syntax:
1.114 kristaps 1985: .Pp
1.120 kristaps 1986: .D1 Pf \. Sx \&It Cm args
1.114 kristaps 1987: .Pp
1988: Lists of type
1989: .Fl bullet ,
1990: .Fl dash ,
1991: .Fl enum ,
1992: .Fl hyphen
1993: and
1994: .Fl item
1.120 kristaps 1995: have the following syntax:
1.114 kristaps 1996: .Pp
1.120 kristaps 1997: .D1 Pf \. Sx \&It
1.114 kristaps 1998: .Pp
1999: with subsequent lines interpreted within the scope of the
2000: .Sx \&It
2001: until either a closing
2002: .Sx \&El
2003: or another
2004: .Sx \&It .
2005: .Pp
2006: The
2007: .Fl tag
1.120 kristaps 2008: list has the following syntax:
1.114 kristaps 2009: .Pp
1.120 kristaps 2010: .D1 Pf \. Sx \&It Op Cm args
1.114 kristaps 2011: .Pp
1.120 kristaps 2012: Subsequent lines are interpreted as with
1.114 kristaps 2013: .Fl bullet
2014: and family.
2015: The line arguments correspond to the list's left-hand side; body
2016: arguments correspond to the list's contents.
2017: .Pp
2018: The
2019: .Fl column
2020: list is the most complicated.
1.120 kristaps 2021: Its syntax is as follows:
1.114 kristaps 2022: .Pp
1.120 kristaps 2023: .D1 Pf \. Sx \&It Op Cm args
1.114 kristaps 2024: .Pp
1.120 kristaps 2025: The
1.114 kristaps 2026: .Cm args
2027: are phrases, a mix of macros and text corresponding to a line column,
2028: delimited by tabs or the special
2029: .Sq \&Ta
2030: pseudo-macro.
2031: Lines subsequent the
2032: .Sx \&It
2033: are interpreted within the scope of the last phrase.
2034: Calling the pseudo-macro
2035: .Sq \&Ta
2036: will open a new phrase scope (this must occur on a macro line to be
1.138 kristaps 2037: interpreted as a macro).
2038: Note that the tab phrase delimiter may only be used within the
1.114 kristaps 2039: .Sx \&It
2040: line itself.
2041: Subsequent this, only the
2042: .Sq \&Ta
2043: pseudo-macro may be used to delimit phrases.
1.124 kristaps 2044: Furthermore, note that quoted sections propagate over tab-delimited
1.114 kristaps 2045: phrases on an
2046: .Sx \&It ,
2047: for example,
2048: .Pp
1.121 kristaps 2049: .D1 .It \(dqcol1 ; <TAB> col2 ;\(dq \&;
1.114 kristaps 2050: .Pp
2051: will preserve the semicolon whitespace except for the last.
2052: .Pp
2053: See also
2054: .Sx \&Bl .
1.63 kristaps 2055: .Ss \&Lb
1.109 kristaps 2056: Specify a library.
1.120 kristaps 2057: The syntax is as follows:
1.109 kristaps 2058: .Pp
1.120 kristaps 2059: .D1 Pf \. Sx \&Lb Cm library
1.109 kristaps 2060: .Pp
2061: The
2062: .Cm library
2063: parameter may be a system library, such as
2064: .Cm libz
2065: or
2066: .Cm libpam ,
2067: in which case a small library description is printed next to the linker
2068: invocation; or a custom library, in which case the library name is
2069: printed in quotes.
2070: This is most commonly used in the
2071: .Em SYNOPSIS
2072: section as described in
2073: .Sx MANUAL STRUCTURE .
2074: .Pp
2075: Examples:
2076: .D1 \&.Lb libz
2077: .D1 \&.Lb mdoc
1.63 kristaps 2078: .Ss \&Li
1.131 kristaps 2079: Denotes text that should be in a literal font mode.
2080: Note that this is a presentation term and should not be used for
2081: stylistically decorating technical terms.
1.138 kristaps 2082: .Pp
2083: See also
2084: .Sx \&Bf ,
2085: .Sx \&Sy ,
2086: and
2087: .Sx \&Em .
1.63 kristaps 2088: .Ss \&Lk
1.100 kristaps 2089: Format a hyperlink.
1.120 kristaps 2090: Its syntax is as follows:
1.70 kristaps 2091: .Pp
1.120 kristaps 2092: .D1 Pf \. Sx \&Lk Cm uri Op Cm name
1.70 kristaps 2093: .Pp
2094: Examples:
1.91 kristaps 2095: .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
2096: .D1 \&.Lk http://bsd.lv
1.70 kristaps 2097: .Pp
2098: See also
2099: .Sx \&Mt .
1.63 kristaps 2100: .Ss \&Lp
1.132 kristaps 2101: Synonym for
2102: .Sx \&Pp .
1.63 kristaps 2103: .Ss \&Ms
1.138 kristaps 2104: Display a mathematical symbol.
1.140 ! kristaps 2105: Its syntax is as follows:
! 2106: .Pp
! 2107: .D1 Pf \. Sx \&Ms Cm symbol
1.138 kristaps 2108: .Pp
2109: Examples:
2110: .D1 \&.Ms sigma
2111: .D1 \&.Ms aleph
1.63 kristaps 2112: .Ss \&Mt
1.116 kristaps 2113: Format a
1.138 kristaps 2114: .Dq mailto:
1.116 kristaps 2115: hyperlink.
1.120 kristaps 2116: Its syntax is as follows:
1.116 kristaps 2117: .Pp
1.120 kristaps 2118: .D1 Pf \. Sx \&Mt Cm address
1.116 kristaps 2119: .Pp
2120: Examples:
2121: .D1 \&.Mt discuss@manpages.bsd.lv
1.63 kristaps 2122: .Ss \&Nd
1.132 kristaps 2123: A one-line description of the manual's content.
2124: This may only be invoked in the
2125: .Em SYNOPSIS
2126: section subsequent the
2127: .Sx \&Nm
2128: macro.
2129: .Pp
2130: Examples:
2131: .D1 \&.Sx \&Nd mdoc language reference
2132: .D1 \&.Sx \&Nd format and display UNIX manuals
2133: .Pp
2134: The
2135: .Sx \&Nd
2136: macro technically accepts child macros and terminates with a subsequent
2137: .Sx \&Sh
2138: invocation.
2139: Do not assume this behaviour: some
2140: .Xr whatis 1
2141: database generators are not smart enough to parse more than the line
2142: arguments and will display macros verbatim.
2143: .Pp
2144: See also
2145: .Sx \&Nm .
1.63 kristaps 2146: .Ss \&Nm
1.128 schwarze 2147: The name of the manual page, or \(em in particular in section 1, 6,
2148: and 8 pages \(em of an additional command or feature documented in
2149: the manual page.
2150: When first invoked, the
2151: .Sx \&Nm
2152: macro expects a single argument, the name of the manual page.
2153: Usually, the first invocation happens in the
2154: .Em NAME
2155: section of the page.
2156: The specified name will be remembered and used whenever the macro is
2157: called again without arguments later in the page.
2158: The
2159: .Sx \&Nm
2160: macro uses
2161: .Sx Block full-implicit
2162: semantics when invoked as the first macro on an input line in the
2163: .Em SYNOPSIS
2164: section; otherwise, it uses ordinary
2165: .Sx In-line
2166: semantics.
2167: .Pp
2168: Examples:
2169: .Bd -literal -offset indent
2170: \&.Sh SYNOPSIS
2171: \&.Nm cat
2172: \&.Op Fl benstuv
2173: \&.Op Ar
2174: .Ed
2175: .Pp
2176: In the
2177: .Em SYNOPSIS
2178: of section 2, 3 and 9 manual pages, use the
2179: .Sx \&Fn
2180: macro rather than
2181: .Sx \&Nm
2182: to mark up the name of the manual page.
1.63 kristaps 2183: .Ss \&No
1.132 kristaps 2184: A
1.138 kristaps 2185: .Dq noop
1.132 kristaps 2186: macro used to terminate prior macro contexts.
2187: .Pp
2188: Examples:
2189: .D1 \&.Sx \&Fl ab \&No cd \&Fl ef
1.63 kristaps 2190: .Ss \&Ns
1.138 kristaps 2191: Suppress a space.
2192: Following invocation, text is interpreted as free-form text until a
2193: macro is encountered.
2194: .Pp
2195: Examples:
2196: .D1 \&.Fl o \&Ns \&Ar output
2197: .Pp
2198: See also
2199: .Sx \&No
2200: and
2201: .Sx \&Sm .
1.63 kristaps 2202: .Ss \&Nx
1.65 kristaps 2203: Format the NetBSD version provided as an argument, or a default value if
2204: no argument is provided.
2205: .Pp
2206: Examples:
1.91 kristaps 2207: .D1 \&.Nx 5.01
2208: .D1 \&.Nx
1.65 kristaps 2209: .Pp
2210: See also
2211: .Sx \&At ,
1.66 kristaps 2212: .Sx \&Bsx ,
1.65 kristaps 2213: .Sx \&Bx ,
1.66 kristaps 2214: .Sx \&Dx ,
1.65 kristaps 2215: .Sx \&Fx ,
2216: .Sx \&Ox ,
2217: and
2218: .Sx \&Ux .
1.63 kristaps 2219: .Ss \&Oc
1.132 kristaps 2220: Closes multi-line
2221: .Sx \&Oo
2222: context.
1.63 kristaps 2223: .Ss \&Oo
1.132 kristaps 2224: Multi-line version of
2225: .Sx \&Op .
2226: .Pp
2227: Examples:
1.138 kristaps 2228: .Bd -literal -offset indent -compact
1.132 kristaps 2229: \&.Oo
2230: \&.Op Fl flag Ns Ar value
2231: \&.Oc
2232: .Ed
1.63 kristaps 2233: .Ss \&Op
1.132 kristaps 2234: Command-line option.
2235: Used when listing options to command-line utilities.
2236: Prints the argument(s) in brackets.
2237: .Pp
2238: Examples:
2239: .D1 \&.Op \&Fl a \&Ar b
2240: .D1 \&.Op \&Ar a | b
2241: .Pp
2242: See also
2243: .Sx \&Oo .
1.63 kristaps 2244: .Ss \&Os
1.100 kristaps 2245: Document operating system version.
2246: This is the mandatory third macro of
1.66 kristaps 2247: any
2248: .Nm
1.120 kristaps 2249: file.
2250: Its syntax is as follows:
1.66 kristaps 2251: .Pp
1.120 kristaps 2252: .D1 Pf \. Sx \&Os Op Cm system
1.66 kristaps 2253: .Pp
2254: The optional
2255: .Cm system
1.100 kristaps 2256: parameter specifies the relevant operating system or environment.
2257: Left unspecified, it defaults to the local operating system version.
2258: This is the suggested form.
1.66 kristaps 2259: .Pp
2260: Examples:
1.91 kristaps 2261: .D1 \&.Os
2262: .D1 \&.Os KTH/CSC/TCS
2263: .D1 \&.Os BSD 4.3
1.66 kristaps 2264: .Pp
2265: See also
2266: .Sx \&Dd
2267: and
2268: .Sx \&Dt .
1.63 kristaps 2269: .Ss \&Ot
1.66 kristaps 2270: Unknown usage.
2271: .Pp
2272: .Em Remarks :
2273: this macro has been deprecated.
1.63 kristaps 2274: .Ss \&Ox
1.65 kristaps 2275: Format the OpenBSD version provided as an argument, or a default value
2276: if no argument is provided.
2277: .Pp
2278: Examples:
1.91 kristaps 2279: .D1 \&.Ox 4.5
2280: .D1 \&.Ox
1.65 kristaps 2281: .Pp
2282: See also
2283: .Sx \&At ,
2284: .Sx \&Bsx ,
2285: .Sx \&Bx ,
1.66 kristaps 2286: .Sx \&Dx ,
1.65 kristaps 2287: .Sx \&Fx ,
2288: .Sx \&Nx ,
2289: and
2290: .Sx \&Ux .
1.63 kristaps 2291: .Ss \&Pa
1.132 kristaps 2292: A file-system path.
2293: .Pp
2294: Examples:
2295: .D1 \&.Pa /usr/bin/mandoc
2296: .D1 \&.Pa /usr/share/man/man7/mdoc.7
2297: .Pp
2298: See also
2299: .Sx \&Lk .
1.63 kristaps 2300: .Ss \&Pc
1.132 kristaps 2301: Close parenthesised context opened by
2302: .Sx \&Po .
1.63 kristaps 2303: .Ss \&Pf
1.132 kristaps 2304: Removes the space
1.138 kristaps 2305: .Pq Dq prefix
1.132 kristaps 2306: between its arguments.
2307: Its syntax is as follows:
2308: .Pp
2309: .D1 Pf \. \&Pf Cm prefix suffix
2310: .Pp
2311: The
2312: .Cm suffix
2313: argument may be a macro.
2314: .Pp
2315: Examples:
2316: .D1 \&.Pf \e. \&Sx \&Pf \&Cm prefix suffix
1.63 kristaps 2317: .Ss \&Po
1.132 kristaps 2318: Multi-line version of
2319: .Sx \&Pq .
1.63 kristaps 2320: .Ss \&Pp
1.132 kristaps 2321: Break a paragraph.
2322: This will assert vertical space between prior and subsequent macros
2323: and/or text.
1.63 kristaps 2324: .Ss \&Pq
1.132 kristaps 2325: Parenthesised enclosure.
2326: .Pp
2327: See also
2328: .Sx \&Po .
1.63 kristaps 2329: .Ss \&Qc
1.138 kristaps 2330: Close quoted context opened by
2331: .Sx \&Qo .
1.63 kristaps 2332: .Ss \&Ql
1.138 kristaps 2333: Format a single-quoted literal.
2334: See also
2335: .Sx \&Qq
2336: and
2337: .Sx \&Sq .
1.63 kristaps 2338: .Ss \&Qo
1.138 kristaps 2339: Multi-line version of
2340: .Sx \&Qq .
1.63 kristaps 2341: .Ss \&Qq
1.138 kristaps 2342: Encloses its arguments in
2343: .Dq typewriter
2344: double-quotes.
2345: Consider using
2346: .Sx \&Dq .
2347: .Pp
2348: See also
2349: .Sx \&Dq ,
2350: .Sx \&Sq ,
2351: and
2352: .Sx \&Qo .
1.63 kristaps 2353: .Ss \&Re
2354: Closes a
2355: .Sx \&Rs
1.100 kristaps 2356: block.
2357: Does not have any tail arguments.
1.63 kristaps 2358: .Ss \&Rs
2359: Begins a bibliographic
2360: .Pq Dq reference
1.100 kristaps 2361: block.
2362: Does not have any head arguments.
2363: The block macro may only contain
1.63 kristaps 2364: .Sx \&%A ,
2365: .Sx \&%B ,
2366: .Sx \&%C ,
2367: .Sx \&%D ,
2368: .Sx \&%I ,
2369: .Sx \&%J ,
2370: .Sx \&%N ,
2371: .Sx \&%O ,
2372: .Sx \&%P ,
2373: .Sx \&%Q ,
2374: .Sx \&%R ,
2375: .Sx \&%T ,
1.120 kristaps 2376: .Sx \&%U ,
1.63 kristaps 2377: and
2378: .Sx \&%V
2379: child macros (at least one must be specified).
2380: .Pp
1.64 kristaps 2381: Examples:
1.91 kristaps 2382: .Bd -literal -offset indent -compact
1.63 kristaps 2383: \&.Rs
2384: \&.%A J. E. Hopcroft
2385: \&.%A J. D. Ullman
2386: \&.%B Introduction to Automata Theory, Languages, and Computation
2387: \&.%I Addison-Wesley
2388: \&.%C Reading, Massachusettes
2389: \&.%D 1979
2390: \&.Re
2391: .Ed
2392: .Pp
2393: If an
2394: .Sx \&Rs
2395: block is used within a SEE ALSO section, a vertical space is asserted
2396: before the rendered output, else the block continues on the current
2397: line.
2398: .Ss \&Rv
1.139 kristaps 2399: Inserts text regarding a function call's return value.
2400: This macro must consist of the
2401: .Fl std
2402: argument followed by an optional
2403: .Ar function .
2404: If
2405: .Ar function
2406: is not provided, the document's name as stipulated by the first
2407: .Sx \&Nm
2408: is provided.
2409: .Pp
2410: See also
2411: .Sx \&Ex .
1.63 kristaps 2412: .Ss \&Sc
1.138 kristaps 2413: Close single-quoted context opened by
2414: .Sx \&So .
1.63 kristaps 2415: .Ss \&Sh
1.138 kristaps 2416: Begin a new section.
2417: For a list of conventional manual sections, see
2418: .Sx MANUAL STRUCTURE .
2419: These sections should be used unless it's absolutely necessary that
2420: custom sections be used.
2421: .Pp
2422: Section names should be unique so that they may be keyed by
2423: .Sx \&Sx .
2424: .Pp
2425: See also
2426: .Sx \&Pp ,
2427: .Sx \&Ss ,
2428: and
2429: .Sx \&Sx .
1.63 kristaps 2430: .Ss \&Sm
1.134 schwarze 2431: Switches the spacing mode for output generated from macros.
2432: Its syntax is as follows:
2433: .Pp
2434: .D1 Pf \. Sx \&Sm Cm on | off
2435: .Pp
2436: By default, spacing is
2437: .Cm on .
2438: When switched
2439: .Cm off ,
2440: no white space is inserted between macro arguments and between the
2441: output generated from adjacent macros, but free-form text lines
2442: still get normal spacing between words and sentences.
1.63 kristaps 2443: .Ss \&So
1.138 kristaps 2444: Multi-line version of
2445: .Sx \&Sq .
1.63 kristaps 2446: .Ss \&Sq
1.138 kristaps 2447: Encloses its arguments in
2448: .Dq typewriter
2449: single-quotes.
2450: .Pp
2451: See also
2452: .Sx \&Dq ,
2453: .Sx \&Qq ,
2454: and
2455: .Sx \&So .
1.63 kristaps 2456: .Ss \&Ss
1.138 kristaps 2457: Begin a new sub-section.
2458: Unlike with
2459: .Sx \&Sh ,
2460: there's no convention for sub-sections.
2461: Conventional sections, as described in
2462: .Sx MANUAL STRUCTURE ,
2463: rarely have sub-sections.
2464: .Pp
2465: Sub-section names should be unique so that they may be keyed by
2466: .Sx \&Sx .
2467: .Pp
2468: See also
2469: .Sx \&Pp ,
2470: .Sx \&Sh ,
2471: and
2472: .Sx \&Sx .
1.63 kristaps 2473: .Ss \&St
1.139 kristaps 2474: Replace an abbreviation for a standard with the full form.
2475: The following standards are recognised:
2476: .Pp
2477: .Bl -tag -width "-p1003.1g-2000X" -compact
2478: .It \-p1003.1-88
2479: .St -p1003.1-88
2480: .It \-p1003.1-90
2481: .St -p1003.1-90
2482: .It \-p1003.1-96
2483: .St -p1003.1-96
2484: .It \-p1003.1-2001
2485: .St -p1003.1-2001
2486: .It \-p1003.1-2004
2487: .St -p1003.1-2004
2488: .It \-p1003.1-2008
2489: .St -p1003.1-2008
2490: .It \-p1003.1
2491: .St -p1003.1
2492: .It \-p1003.1b
2493: .St -p1003.1b
2494: .It \-p1003.1b-93
2495: .St -p1003.1b-93
2496: .It \-p1003.1c-95
2497: .St -p1003.1c-95
2498: .It \-p1003.1g-2000
2499: .St -p1003.1g-2000
2500: .It \-p1003.1i-95
2501: .St -p1003.1i-95
2502: .It \-p1003.2-92
2503: .St -p1003.2-92
2504: .It \-p1003.2a-92
2505: .St -p1003.2a-92
2506: .It \-p1387.2-95
2507: .St -p1387.2-95
2508: .It \-p1003.2
2509: .St -p1003.2
2510: .It \-p1387.2
2511: .St -p1387.2
2512: .It \-isoC
2513: .St -isoC
2514: .It \-isoC-90
2515: .St -isoC-90
2516: .It \-isoC-amd1
2517: .St -isoC-amd1
2518: .It \-isoC-tcor1
2519: .St -isoC-tcor1
2520: .It \-isoC-tcor2
2521: .St -isoC-tcor2
2522: .It \-isoC-99
2523: .St -isoC-99
2524: .It \-iso9945-1-90
2525: .St -iso9945-1-90
2526: .It \-iso9945-1-96
2527: .St -iso9945-1-96
2528: .It \-iso9945-2-93
2529: .St -iso9945-2-93
2530: .It \-ansiC
2531: .St -ansiC
2532: .It \-ansiC-89
2533: .St -ansiC-89
2534: .It \-ansiC-99
2535: .St -ansiC-99
2536: .It \-ieee754
2537: .St -ieee754
2538: .It \-iso8802-3
2539: .St -iso8802-3
2540: .It \-ieee1275-94
2541: .St -ieee1275-94
2542: .It \-xpg3
2543: .St -xpg3
2544: .It \-xpg4
2545: .St -xpg4
2546: .It \-xpg4.2
2547: .St -xpg4.2
2548: .St -xpg4.3
2549: .It \-xbd5
2550: .St -xbd5
2551: .It \-xcu5
2552: .St -xcu5
2553: .It \-xsh5
2554: .St -xsh5
2555: .It \-xns5
2556: .St -xns5
2557: .It \-xns5.2
2558: .St -xns5.2
2559: .It \-xns5.2d2.0
2560: .St -xns5.2d2.0
2561: .It \-xcurses4.2
2562: .St -xcurses4.2
2563: .It \-susv2
2564: .St -susv2
2565: .It \-susv3
2566: .St -susv3
2567: .It \-svid4
2568: .St -svid4
2569: .El
1.63 kristaps 2570: .Ss \&Sx
1.138 kristaps 2571: Reference a section or sub-section.
2572: The referenced section or sub-section name must be identical to the
2573: enclosed argument, including whitespace.
2574: .Pp
2575: Examples:
2576: .D1 \&.Sx MANUAL STRUCTURE
1.63 kristaps 2577: .Ss \&Sy
1.138 kristaps 2578: Format enclosed arguments in symbolic
2579: .Pq Dq boldface .
2580: Note that this is a presentation term and should not be used for
2581: stylistically decorating technical terms.
2582: .Pp
2583: See also
2584: .Sx \&Bf ,
2585: .Sx \&Li ,
2586: and
2587: .Sx \&Em .
1.63 kristaps 2588: .Ss \&Tn
1.138 kristaps 2589: Format a tradename.
2590: .Pp
2591: Examples:
1.139 kristaps 2592: .D1 \&.Tn IBM
1.63 kristaps 2593: .Ss \&Ud
1.110 kristaps 2594: Prints out
2595: .Dq currently under development.
1.63 kristaps 2596: .Ss \&Ux
1.100 kristaps 2597: Format the UNIX name.
2598: Accepts no argument.
1.65 kristaps 2599: .Pp
2600: Examples:
1.91 kristaps 2601: .D1 \&.Ux
1.65 kristaps 2602: .Pp
2603: See also
2604: .Sx \&At ,
1.66 kristaps 2605: .Sx \&Bsx ,
1.65 kristaps 2606: .Sx \&Bx ,
1.66 kristaps 2607: .Sx \&Dx ,
1.65 kristaps 2608: .Sx \&Fx ,
2609: .Sx \&Nx ,
2610: and
2611: .Sx \&Ox .
1.63 kristaps 2612: .Ss \&Va
1.132 kristaps 2613: A variable name.
2614: .Pp
2615: Examples:
2616: .D1 \&.Va foo
2617: .D1 \&.Va const char *bar ;
1.63 kristaps 2618: .Ss \&Vt
1.100 kristaps 2619: A variable type.
1.122 kristaps 2620: This is also used for indicating global variables in the
2621: .Em SYNOPSIS
1.100 kristaps 2622: section, in which case a variable name is also specified.
2623: Note that it accepts
1.83 kristaps 2624: .Sx Block partial-implicit
1.123 kristaps 2625: syntax when invoked as the first macro in the
1.122 kristaps 2626: .Em SYNOPSIS
2627: section, else it accepts ordinary
1.83 kristaps 2628: .Sx In-line
2629: syntax.
2630: .Pp
2631: Note that this should not be confused with
2632: .Sx \&Ft ,
2633: which is used for function return types.
2634: .Pp
2635: Examples:
1.91 kristaps 2636: .D1 \&.Vt unsigned char
1.121 kristaps 2637: .D1 \&.Vt extern const char * const sys_signame[] \&;
1.83 kristaps 2638: .Pp
2639: See also
1.122 kristaps 2640: .Sx MANUAL STRUCTURE
1.83 kristaps 2641: and
2642: .Sx \&Va .
1.84 kristaps 2643: .Ss \&Xc
1.87 kristaps 2644: Close a scope opened by
2645: .Sx \&Xo .
1.84 kristaps 2646: .Ss \&Xo
1.100 kristaps 2647: Open an extension scope.
2648: This macro originally existed to extend the 9-argument limit of troff;
2649: since this limit has been lifted, the macro has been deprecated.
1.84 kristaps 2650: .Ss \&Xr
2651: Link to another manual
2652: .Pq Qq cross-reference .
1.120 kristaps 2653: Its syntax is as follows:
1.84 kristaps 2654: .Pp
1.120 kristaps 2655: .D1 Pf \. Sx \&Xr Cm name section
1.84 kristaps 2656: .Pp
2657: The
2658: .Cm name
2659: and
2660: .Cm section
1.100 kristaps 2661: are the name and section of the linked manual.
2662: If
1.84 kristaps 2663: .Cm section
2664: is followed by non-punctuation, an
2665: .Sx \&Ns
1.100 kristaps 2666: is inserted into the token stream.
2667: This behaviour is for compatibility with
1.84 kristaps 2668: .Xr groff 1 .
2669: .Pp
2670: Examples:
1.91 kristaps 2671: .D1 \&.Xr mandoc 1
1.121 kristaps 2672: .D1 \&.Xr mandoc 1 \&;
1.91 kristaps 2673: .D1 \&.Xr mandoc 1 \&Ns s behaviour
1.84 kristaps 2674: .Ss \&br
1.140 ! kristaps 2675: Emits a line-break.
! 2676: This macro should not be used; it is implemented for compatibility with
! 2677: historical manuals.
! 2678: .Pp
! 2679: Consider using
! 2680: .Sx \&Pp
! 2681: in the event of natural paragraph breaks.
1.84 kristaps 2682: .Ss \&sp
1.140 ! kristaps 2683: Emits vertical space.
! 2684: This macro should not be used; it is implemented for compatibility with
! 2685: historical manuals.
! 2686: Its syntax is as follows:
! 2687: .Pp
! 2688: .D1 Pf \. Sx \&sp Op Cm height
! 2689: .Pp
! 2690: The
! 2691: .Cm height
! 2692: argument must be formatted as described in
! 2693: .Sx Scaling Widths .
! 2694: If unspecified,
! 2695: .Sx \&sp
! 2696: asserts a single vertical space.
1.4 kristaps 2697: .Sh COMPATIBILITY
1.93 kristaps 2698: This section documents compatibility between mandoc and other other
2699: troff implementations, at this time limited to GNU troff
2700: .Pq Qq groff .
1.50 kristaps 2701: The term
1.57 kristaps 2702: .Qq historic groff
1.93 kristaps 2703: refers to groff versions before the
1.57 kristaps 2704: .Pa doc.tmac
1.50 kristaps 2705: file re-write
1.57 kristaps 2706: .Pq somewhere between 1.15 and 1.19 .
2707: .Pp
1.93 kristaps 2708: Heirloom troff, the other significant troff implementation accepting
2709: \-mdoc, is similar to historic groff.
2710: .Pp
1.57 kristaps 2711: .Bl -dash -compact
1.125 kristaps 2712: .It
1.137 kristaps 2713: The \es (font size), \em (font colour), and \eM (font filling colour)
2714: font decoration escapes are all discarded in mandoc.
2715: .It
1.126 kristaps 2716: Old groff fails to assert a newline before
2717: .Sx \&Bd Fl ragged compact .
1.119 kristaps 2718: .It
1.120 kristaps 2719: groff behaves inconsistently when encountering
2720: .Pf non- Sx \&Fa
2721: children of
2722: .Sx \&Fo
2723: regarding spacing between arguments.
2724: In mandoc, this is not the case: each argument is consistently followed
2725: by a single space and the trailing
2726: .Sq \&)
2727: suppresses prior spacing.
2728: .It
2729: groff behaves inconsistently when encountering
2730: .Sx \&Ft
2731: and
2732: .Sx \&Fn
2733: in the
2734: .Em SYNOPSIS :
1.124 kristaps 2735: at times newline(s) are suppressed depending on whether a prior
1.120 kristaps 2736: .Sx \&Fn
2737: has been invoked.
2738: In mandoc, this is not the case.
2739: See
2740: .Sx \&Ft
2741: and
2742: .Sx \&Fn
2743: for the normalised behaviour.
2744: .It
1.119 kristaps 2745: Historic groff does not break before an
2746: .Sx \&Fn
2747: when not invoked as the line macro in the
2748: .Em SYNOPSIS
2749: section.
1.118 kristaps 2750: .It
2751: Historic groff formats the
2752: .Sx \&In
2753: badly: trailing arguments are trashed and
2754: .Em SYNOPSIS
2755: is not specially treated.
1.115 kristaps 2756: .It
2757: groff does not accept the
2758: .Sq \&Ta
2759: pseudo-macro as a line macro.
2760: mandoc does.
1.57 kristaps 2761: .It
1.81 kristaps 2762: The comment syntax
1.137 kristaps 2763: .Sq \e\."
1.81 kristaps 2764: is no longer accepted.
2765: .It
1.93 kristaps 2766: In groff, the
1.80 kristaps 2767: .Sx \&Pa
2768: macro does not format its arguments when used in the FILES section under
1.100 kristaps 2769: certain list types.
2770: mandoc does.
1.80 kristaps 2771: .It
1.93 kristaps 2772: Historic groff does not print a dash for empty
1.79 kristaps 2773: .Sx \&Fl
1.100 kristaps 2774: arguments.
2775: mandoc and newer groff implementations do.
1.79 kristaps 2776: .It
1.93 kristaps 2777: groff behaves irregularly when specifying
1.77 kristaps 2778: .Sq \ef
1.93 kristaps 2779: .Sx Text Decoration
1.100 kristaps 2780: within line-macro scopes.
2781: mandoc follows a consistent system.
1.77 kristaps 2782: .It
1.93 kristaps 2783: In mandoc, negative scaling units are truncated to zero; groff would
1.100 kristaps 2784: move to prior lines.
2785: Furthermore, the
1.61 kristaps 2786: .Sq f
2787: scaling unit, while accepted, is rendered as the default unit.
2788: .It
1.48 kristaps 2789: In quoted literals, groff allowed pair-wise double-quotes to produce a
1.100 kristaps 2790: standalone double-quote in formatted output.
2791: This idiosyncratic behaviour is not applicable in mandoc.
1.57 kristaps 2792: .It
1.126 kristaps 2793: Display offsets
1.78 kristaps 2794: .Sx \&Bd
1.126 kristaps 2795: .Fl offset Ar center
1.64 kristaps 2796: and
1.126 kristaps 2797: .Fl offset Ar right
2798: are disregarded in mandoc.
1.131 kristaps 2799: Furthermore, troff specifies a
1.64 kristaps 2800: .Fl file Ar file
1.131 kristaps 2801: argument that is not supported in mandoc.
1.100 kristaps 2802: Lastly, since text is not right-justified in mandoc (or even groff),
1.64 kristaps 2803: .Fl ragged
2804: and
2805: .Fl filled
2806: are aliases, as are
2807: .Fl literal
2808: and
2809: .Fl unfilled .
1.57 kristaps 2810: .It
1.100 kristaps 2811: Historic groff has many un-callable macros.
2812: Most of these (excluding some block-level macros) are now callable.
1.57 kristaps 2813: .It
1.50 kristaps 2814: The vertical bar
1.57 kristaps 2815: .Sq \(ba
1.28 kristaps 2816: made historic groff
1.57 kristaps 2817: .Qq go orbital
1.93 kristaps 2818: but has been a proper delimiter since then.
1.57 kristaps 2819: .It
1.93 kristaps 2820: .Sx \&It Fl nested
1.28 kristaps 2821: is assumed for all lists (it wasn't in historic groff): any list may be
2822: nested and
1.64 kristaps 2823: .Fl enum
1.4 kristaps 2824: lists will restart the sequence only for the sub-list.
1.57 kristaps 2825: .It
1.4 kristaps 2826: Some manuals use
1.64 kristaps 2827: .Sx \&Li
1.4 kristaps 2828: incorrectly by following it with a reserved character and expecting the
1.100 kristaps 2829: delimiter to render.
2830: This is not supported in mandoc.
1.93 kristaps 2831: .It
2832: In groff, the
2833: .Sx \&Cd ,
2834: .Sx \&Er ,
1.106 kristaps 2835: .Sx \&Ex ,
1.93 kristaps 2836: and
1.106 kristaps 2837: .Sx \&Rv
1.100 kristaps 2838: macros were stipulated only to occur in certain manual sections.
2839: mandoc does not have these restrictions.
1.105 kristaps 2840: .It
2841: Newer groff and mandoc print
2842: .Qq AT&T UNIX
2843: prior to unknown arguments of
2844: .Sx \&At ;
2845: older groff did nothing.
1.57 kristaps 2846: .El
1.2 kristaps 2847: .Sh SEE ALSO
1.57 kristaps 2848: .Xr mandoc 1 ,
2849: .Xr mandoc_char 7
1.2 kristaps 2850: .Sh AUTHORS
2851: The
1.57 kristaps 2852: .Nm
1.50 kristaps 2853: reference was written by
1.94 kristaps 2854: .An Kristaps Dzonsons Aq kristaps@bsd.lv .
CVSweb