Annotation of mandoc/mdoc.7, Revision 1.138
1.138 ! kristaps 1: .\" $Id: mdoc.7,v 1.137 2010/07/19 10:48:36 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.64 kristaps 951: .Bl -tag -width 12n -offset indent
952: .It Fl split
1.66 kristaps 953: Renders a line break before each author listing.
1.64 kristaps 954: .It Fl nosplit
955: The opposite of
956: .Fl split .
957: .El
958: .Pp
959: In the AUTHORS section, the default is not to split the first author
960: listing, but all subsequent author listings, whether or not they're
1.100 kristaps 961: interspersed by other macros or text, are split.
962: Thus, specifying
1.64 kristaps 963: .Fl split
1.100 kristaps 964: will cause the first listing also to be split.
965: If not in the AUTHORS section, the default is not to split.
1.64 kristaps 966: .Pp
967: Examples:
1.91 kristaps 968: .D1 \&.An -nosplit
969: .D1 \&.An J. D. Ullman .
1.64 kristaps 970: .Pp
971: .Em Remarks :
972: the effects of
973: .Fl split
974: or
975: .Fl nosplit
976: are re-set when entering the AUTHORS section, so if one specifies
977: .Sx \&An Fl nosplit
978: in the general document body, it must be re-specified in the AUTHORS
979: section.
1.63 kristaps 980: .Ss \&Ao
1.100 kristaps 981: Begins a block enclosed by angled brackets.
982: Does not have any head arguments.
1.63 kristaps 983: .Pp
1.64 kristaps 984: Examples:
1.91 kristaps 985: .D1 \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
1.63 kristaps 986: .Pp
1.64 kristaps 987: See also
988: .Sx \&Aq .
1.63 kristaps 989: .Ss \&Ap
1.138 ! kristaps 990: Inserts an apostrophe without any surrounding whitespace.
1.124 kristaps 991: This is generally used as a grammatical device when referring to the verb
1.100 kristaps 992: form of a function:
1.64 kristaps 993: .Bd -literal -offset indent
994: \&.Fn execve Ap d
995: .Ed
1.63 kristaps 996: .Ss \&Aq
1.82 kristaps 997: Encloses its arguments in angled brackets.
1.64 kristaps 998: .Pp
999: Examples:
1.91 kristaps 1000: .D1 \&.Fl -key= \&Ns \&Aq \&Ar val
1.64 kristaps 1001: .Pp
1002: .Em Remarks :
1003: this macro is often abused for rendering URIs, which should instead use
1004: .Sx \&Lk
1005: or
1006: .Sx \&Mt ,
1007: or to note pre-processor
1008: .Dq Li #include
1009: statements, which should use
1010: .Sx \&In .
1011: .Pp
1012: See also
1013: .Sx \&Ao .
1.63 kristaps 1014: .Ss \&Ar
1.100 kristaps 1015: Command arguments.
1016: If an argument is not provided, the string
1.64 kristaps 1017: .Dq file ...
1.66 kristaps 1018: is used as a default.
1.64 kristaps 1019: .Pp
1020: Examples:
1.91 kristaps 1021: .D1 \&.Fl o \&Ns \&Ar file1
1022: .D1 \&.Ar
1023: .D1 \&.Ar arg1 , arg2 .
1.63 kristaps 1024: .Ss \&At
1.100 kristaps 1025: Formats an AT&T version.
1026: Accepts at most one parameter:
1.64 kristaps 1027: .Bl -tag -width 12n -offset indent
1028: .It Cm v[1-7] | 32v
1029: A version of
1030: .At .
1031: .It Cm V[.[1-4]]?
1032: A system version of
1033: .At .
1034: .El
1035: .Pp
1036: Note that these parameters do not begin with a hyphen.
1037: .Pp
1038: Examples:
1.91 kristaps 1039: .D1 \&.At
1040: .D1 \&.At V.1
1.65 kristaps 1041: .Pp
1042: See also
1.66 kristaps 1043: .Sx \&Bsx ,
1.65 kristaps 1044: .Sx \&Bx ,
1.66 kristaps 1045: .Sx \&Dx ,
1.65 kristaps 1046: .Sx \&Fx ,
1047: .Sx \&Nx ,
1048: .Sx \&Ox ,
1049: and
1050: .Sx \&Ux .
1.63 kristaps 1051: .Ss \&Bc
1.64 kristaps 1052: Closes a
1053: .Sx \&Bo
1.138 ! kristaps 1054: block.
! 1055: Does not have any tail arguments.
1.63 kristaps 1056: .Ss \&Bd
1.100 kristaps 1057: Begins a display block.
1.131 kristaps 1058: Its syntax is as follows:
1059: .Bd -ragged -offset indent
1060: .Pf \. Sx \&Bd
1061: .Fl type
1062: .Op Fl offset Ar width
1063: .Op Fl compact
1064: .Ed
1065: .Pp
1.100 kristaps 1066: A display is collection of macros or text which may be collectively
1067: offset or justified in a manner different from that
1068: of the enclosing context.
1069: By default, the block is preceded by a vertical space.
1.64 kristaps 1070: .Pp
1071: Each display is associated with a type, which must be one of the
1072: following arguments:
1073: .Bl -tag -width 12n -offset indent
1074: .It Fl ragged
1075: Only left-justify the block.
1076: .It Fl unfilled
1077: Do not justify the block at all.
1078: .It Fl filled
1079: Left- and right-justify the block.
1080: .It Fl literal
1081: Alias for
1082: .Fl unfilled .
1083: .It Fl centered
1084: Centre-justify each line.
1085: .El
1086: .Pp
1.100 kristaps 1087: The type must be provided first.
1088: Secondary arguments are as follows:
1.64 kristaps 1089: .Bl -tag -width 12n -offset indent
1.131 kristaps 1090: .It Fl offset Ar val
1.64 kristaps 1091: Offset by the value of
1.131 kristaps 1092: .Ar val ,
1.64 kristaps 1093: which is interpreted as one of the following, specified in order:
1094: .Bl -item
1095: .It
1096: As one of the pre-defined strings
1097: .Ar indent ,
1098: the width of standard indentation;
1099: .Ar indent-two ,
1100: twice
1101: .Ar indent ;
1102: .Ar left ,
1.131 kristaps 1103: which has no effect;
1.64 kristaps 1104: .Ar right ,
1105: which justifies to the right margin; and
1106: .Ar center ,
1107: which aligns around an imagined centre axis.
1108: .It
1.100 kristaps 1109: As a precalculated width for a named macro.
1110: The most popular is the imaginary macro
1.67 kristaps 1111: .Ar \&Ds ,
1.64 kristaps 1112: which resolves to
1113: .Ar 6n .
1114: .It
1115: As a scaling unit following the syntax described in
1116: .Sx Scaling Widths .
1117: .It
1118: As the calculated string length of the opaque string.
1119: .El
1120: .Pp
1.126 kristaps 1121: If not provided an argument, it will be ignored.
1.64 kristaps 1122: .It Fl compact
1123: Do not assert a vertical space before the block.
1124: .El
1125: .Pp
1126: Examples:
1127: .Bd -literal -offset indent
1128: \&.Bd \-unfilled \-offset two-indent \-compact
1.65 kristaps 1129: Hello world.
1.64 kristaps 1130: \&.Ed
1131: .Ed
1.66 kristaps 1132: .Pp
1133: See also
1134: .Sx \&D1
1135: and
1136: .Sx \&Dl .
1.63 kristaps 1137: .Ss \&Bf
1.129 kristaps 1138: Change the font mode for a scoped block of text.
1139: Its syntax is as follows:
1140: .Bd -ragged -offset indent
1141: .Pf \. Sx \&Bf
1142: .Oo
1143: .Fl emphasis | literal | symbolic |
1144: .Cm \&Em | \&Li | \&Sy
1145: .Oc
1146: .Ed
1147: .Pp
1148: The
1149: .Fl emphasis
1150: and
1151: .Cm \&Em
1152: argument are equivalent, as are
1153: .Fl symbolic
1154: and
1155: .Cm \&Sy,
1156: and
1157: .Fl literal
1158: and
1159: .Cm \&Li .
1160: Without an argument, this macro does nothing.
1161: The font mode continues until broken by a new font mode in a nested
1162: scope or
1163: .Sx \&Ef
1164: is encountered.
1165: .Pp
1166: See also
1167: .Sx \&Li ,
1168: .Sx \&Ef ,
1169: and
1170: .Sx \&Sy .
1.63 kristaps 1171: .Ss \&Bk
1.133 kristaps 1172: Begins a collection of macros or text not breaking the line.
1.131 kristaps 1173: Its syntax is as follows:
1174: .Pp
1175: .D1 Pf \. Sx \&Bk Fl words
1176: .Pp
1177: Subsequent arguments are ignored.
1.133 kristaps 1178: The
1179: .Fl words
1180: argument is required.
1.127 schwarze 1181: .Pp
1.133 kristaps 1182: Each line within a keep block is kept intact, so the following example
1183: will not break within each
1184: .Sx \&Op
1185: macro line:
1.127 schwarze 1186: .Bd -literal -offset indent
1187: \&.Bk \-words
1.133 kristaps 1188: \&.Op Fl f Ar flags
1189: \&.Op Fl o Ar output
1.127 schwarze 1190: \&.Ek
1191: .Ed
1.129 kristaps 1192: .Pp
1.133 kristaps 1193: Be careful in using over-long lines within a keep block!
1194: Doing so will clobber the right margin.
1.63 kristaps 1195: .Ss \&Bl
1.103 kristaps 1196: Begins a list composed of one or more list entries.
1.131 kristaps 1197: Its syntax is as follows:
1198: .Bd -ragged -offset indent
1199: .Pf \. Sx \&Bl
1200: .Fl type
1201: .Op Fl width Ar val
1202: .Op Fl offset Ar val
1203: .Op Fl compact
1204: .Op HEAD ...
1205: .Ed
1206: .Pp
1.104 kristaps 1207: A list is associated with a type, which is a required argument.
1208: Other arguments are
1209: .Fl width ,
1210: defined per-type as accepting a literal or
1211: .Sx Scaling Widths
1212: value;
1213: .Fl offset ,
1214: also accepting a literal or
1215: .Sx Scaling Widths
1216: value setting the list's global offset; and
1217: .Fl compact ,
1218: suppressing the default vertical space printed before each list entry.
1.103 kristaps 1219: A list entry is specified by the
1220: .Sx \&It
1221: macro, which consists of a head and optional body (depending on the list
1222: type).
1223: A list must specify one of the following list types:
1224: .Bl -tag -width 12n -offset indent
1225: .It Fl bullet
1226: A list offset by a bullet.
1227: The head of list entries must be empty.
1228: List entry bodies are positioned after the bullet.
1.104 kristaps 1229: The
1230: .Fl width
1231: argument varies the width of list bodies' left-margins.
1.103 kristaps 1232: .It Fl column
1233: A columnated list.
1.104 kristaps 1234: The
1235: .Fl width
1236: argument has no effect.
1.103 kristaps 1237: The number of columns is specified as parameters to the
1238: .Sx \&Bl
1239: macro.
1240: These dictate the width of columns either as
1241: .Sx Scaling Widths
1242: or literal text.
1.114 kristaps 1243: If the initial macro of a
1244: .Fl column
1245: list is not an
1246: .Sx \&It ,
1247: an
1248: .Sx \&It
1249: context spanning each line is implied until an
1250: .Sx \&It
1251: line macro is encountered, at which point list bodies are interpreted as
1252: described in the
1253: .Sx \&It
1254: documentation.
1.103 kristaps 1255: .It Fl dash
1256: A list offset by a dash (hyphen).
1257: The head of list entries must be empty.
1258: List entry bodies are positioned past the dash.
1.104 kristaps 1259: The
1260: .Fl width
1261: argument varies the width of list bodies' left-margins.
1.103 kristaps 1262: .It Fl diag
1263: Like
1264: .Fl inset ,
1265: but with additional formatting to the head.
1.104 kristaps 1266: The
1267: .Fl width
1268: argument varies the width of list bodies' left-margins.
1.103 kristaps 1269: .It Fl enum
1270: An enumerated list offset by the enumeration from 1.
1271: The head of list entries must be empty.
1272: List entry bodies are positioned after the enumeration.
1.104 kristaps 1273: The
1274: .Fl width
1275: argument varies the width of list bodies' left-margins.
1.103 kristaps 1276: .It Fl hang
1277: Like
1278: .Fl tag ,
1279: but instead of list bodies positioned after the head, they trail the
1280: head text.
1.104 kristaps 1281: The
1282: .Fl width
1283: argument varies the width of list bodies' left-margins.
1.103 kristaps 1284: .It Fl hyphen
1285: Synonym for
1286: .Fl dash .
1287: .It Fl inset
1288: List bodies follow the list head.
1.104 kristaps 1289: The
1290: .Fl width
1291: argument is ignored.
1.103 kristaps 1292: .It Fl item
1293: This produces blocks of text.
1294: The head of list entries must be empty.
1.104 kristaps 1295: The
1296: .Fl width
1297: argument is ignored.
1.103 kristaps 1298: .It Fl ohang
1299: List bodies are positioned on the line following the head.
1.104 kristaps 1300: The
1301: .Fl width
1302: argument is ignored.
1.103 kristaps 1303: .It Fl tag
1.138 ! kristaps 1304: A list offset by list entry heads.
! 1305: List entry bodies are positioned after the head as specified by the
1.103 kristaps 1306: .Fl width
1307: argument.
1308: .El
1.114 kristaps 1309: .Pp
1310: See also
1311: .Sx \&It .
1.63 kristaps 1312: .Ss \&Bo
1.100 kristaps 1313: Begins a block enclosed by square brackets.
1314: Does not have any head arguments.
1.65 kristaps 1315: .Pp
1316: Examples:
1317: .Bd -literal -offset indent
1318: \&.Bo 1 ,
1.91 kristaps 1319: \&.Dv BUFSIZ \&Bc
1.65 kristaps 1320: .Ed
1321: .Pp
1322: See also
1323: .Sx \&Bq .
1.63 kristaps 1324: .Ss \&Bq
1.82 kristaps 1325: Encloses its arguments in square brackets.
1.65 kristaps 1326: .Pp
1327: Examples:
1.91 kristaps 1328: .D1 \&.Bq 1 , \&Dv BUFSIZ
1.65 kristaps 1329: .Pp
1330: .Em Remarks :
1331: this macro is sometimes abused to emulate optional arguments for
1332: commands; the correct macros to use for this purpose are
1333: .Sx \&Op ,
1334: .Sx \&Oo ,
1335: and
1336: .Sx \&Oc .
1337: .Pp
1338: See also
1339: .Sx \&Bo .
1.63 kristaps 1340: .Ss \&Brc
1.65 kristaps 1341: Closes a
1342: .Sx \&Bro
1.138 ! kristaps 1343: block.
! 1344: Does not have any tail arguments.
1.63 kristaps 1345: .Ss \&Bro
1.100 kristaps 1346: Begins a block enclosed by curly braces.
1347: Does not have any head arguments.
1.65 kristaps 1348: .Pp
1349: Examples:
1350: .Bd -literal -offset indent
1351: \&.Bro 1 , ... ,
1.91 kristaps 1352: \&.Va n \&Brc
1.65 kristaps 1353: .Ed
1354: .Pp
1355: See also
1356: .Sx \&Brq .
1.63 kristaps 1357: .Ss \&Brq
1.65 kristaps 1358: Encloses its arguments in curly braces.
1359: .Pp
1360: Examples:
1.91 kristaps 1361: .D1 \&.Brq 1 , ... , \&Va n
1.65 kristaps 1362: .Pp
1363: See also
1364: .Sx \&Bro .
1.63 kristaps 1365: .Ss \&Bsx
1.65 kristaps 1366: Format the BSD/OS version provided as an argument, or a default value if
1367: no argument is provided.
1368: .Pp
1369: Examples:
1.91 kristaps 1370: .D1 \&.Bsx 1.0
1371: .D1 \&.Bsx
1.65 kristaps 1372: .Pp
1373: See also
1374: .Sx \&At ,
1375: .Sx \&Bx ,
1.66 kristaps 1376: .Sx \&Dx ,
1.65 kristaps 1377: .Sx \&Fx ,
1378: .Sx \&Nx ,
1379: .Sx \&Ox ,
1380: and
1381: .Sx \&Ux .
1.63 kristaps 1382: .Ss \&Bt
1.66 kristaps 1383: Prints
1384: .Dq is currently in beta test.
1.63 kristaps 1385: .Ss \&Bx
1.65 kristaps 1386: Format the BSD version provided as an argument, or a default value if no
1387: argument is provided.
1388: .Pp
1389: Examples:
1.91 kristaps 1390: .D1 \&.Bx 4.4
1391: .D1 \&.Bx
1.65 kristaps 1392: .Pp
1393: See also
1394: .Sx \&At ,
1395: .Sx \&Bsx ,
1.66 kristaps 1396: .Sx \&Dx ,
1.65 kristaps 1397: .Sx \&Fx ,
1398: .Sx \&Nx ,
1399: .Sx \&Ox ,
1400: and
1401: .Sx \&Ux .
1.63 kristaps 1402: .Ss \&Cd
1.100 kristaps 1403: Configuration declaration.
1404: This denotes strings accepted by
1.66 kristaps 1405: .Xr config 8 .
1406: .Pp
1407: Examples:
1.91 kristaps 1408: .D1 \&.Cd device le0 at scode?
1.66 kristaps 1409: .Pp
1410: .Em Remarks :
1411: this macro is commonly abused by using quoted literals to retain
1.138 ! kristaps 1412: whitespace and align consecutive
1.66 kristaps 1413: .Sx \&Cd
1.100 kristaps 1414: declarations.
1415: This practise is discouraged.
1.63 kristaps 1416: .Ss \&Cm
1.100 kristaps 1417: Command modifiers.
1418: Useful when specifying configuration options or keys.
1.66 kristaps 1419: .Pp
1420: Examples:
1.91 kristaps 1421: .D1 \&.Cm ControlPath
1422: .D1 \&.Cm ControlMaster
1.66 kristaps 1423: .Pp
1424: See also
1425: .Sx \&Fl .
1.63 kristaps 1426: .Ss \&D1
1.100 kristaps 1427: One-line indented display.
1428: This is formatted by the default rules and is useful for simple indented
1429: statements.
1430: It is followed by a newline.
1.66 kristaps 1431: .Pp
1432: Examples:
1.91 kristaps 1433: .D1 \&.D1 \&Fl abcdefgh
1.66 kristaps 1434: .Pp
1435: See also
1436: .Sx \&Bd
1437: and
1438: .Sx \&Dl .
1.63 kristaps 1439: .Ss \&Db
1.117 kristaps 1440: Start a debugging context.
1441: This macro is parsed, but generally ignored.
1.120 kristaps 1442: Its syntax is as follows:
1.117 kristaps 1443: .Pp
1.120 kristaps 1444: .D1 Pf \. Sx \&Db Cm on | off
1.63 kristaps 1445: .Ss \&Dc
1.66 kristaps 1446: Closes a
1447: .Sx \&Do
1.138 ! kristaps 1448: block.
! 1449: Does not have any tail arguments.
1.63 kristaps 1450: .Ss \&Dd
1.100 kristaps 1451: Document date.
1452: This is the mandatory first macro of any
1.66 kristaps 1453: .Nm
1.100 kristaps 1454: manual.
1.120 kristaps 1455: Its syntax is as follows:
1.66 kristaps 1456: .Pp
1.120 kristaps 1457: .D1 Pf \. Sx \&Dd Cm date
1.66 kristaps 1458: .Pp
1.82 kristaps 1459: The
1.66 kristaps 1460: .Cm date
1461: field may be either
1462: .Ar $\&Mdocdate$ ,
1463: which signifies the current manual revision date dictated by
1.72 kristaps 1464: .Xr cvs 1 ,
1.66 kristaps 1465: or instead a valid canonical date as specified by
1466: .Sx Dates .
1.72 kristaps 1467: If a date does not conform, the current date is used instead.
1.66 kristaps 1468: .Pp
1469: Examples:
1.91 kristaps 1470: .D1 \&.Dd $\&Mdocdate$
1471: .D1 \&.Dd $\&Mdocdate: July 21 2007$
1472: .D1 \&.Dd July 21, 2007
1.66 kristaps 1473: .Pp
1474: See also
1475: .Sx \&Dt
1476: and
1477: .Sx \&Os .
1.63 kristaps 1478: .Ss \&Dl
1.100 kristaps 1479: One-line intended display.
1480: This is formatted as literal text and is useful for commands and
1481: invocations.
1482: It is followed by a newline.
1.66 kristaps 1483: .Pp
1484: Examples:
1.91 kristaps 1485: .D1 \&.Dl % mandoc mdoc.7 | less
1.66 kristaps 1486: .Pp
1487: See also
1488: .Sx \&Bd
1489: and
1490: .Sx \&D1 .
1.63 kristaps 1491: .Ss \&Do
1.138 ! kristaps 1492: Begins a block enclosed by double quotes.
! 1493: Does not have any head arguments.
1.66 kristaps 1494: .Pp
1495: Examples:
1.91 kristaps 1496: .D1 \&.D1 \&Do April is the cruellest month \&Dc \e(em T.S. Eliot
1.66 kristaps 1497: .Pp
1498: See also
1499: .Sx \&Dq .
1.63 kristaps 1500: .Ss \&Dq
1.138 ! kristaps 1501: Encloses its arguments in
! 1502: .Dq typographic
! 1503: double-quotes.
1.66 kristaps 1504: .Pp
1505: Examples:
1.91 kristaps 1506: .Bd -literal -offset indent -compact
1.66 kristaps 1507: \&.Dq April is the cruellest month
1508: \e(em T.S. Eliot
1509: .Ed
1510: .Pp
1511: See also
1.138 ! kristaps 1512: .Ss \&Qq ,
! 1513: .Ss \&Sq ,
! 1514: and
1.66 kristaps 1515: .Sx \&Do .
1.100 kristaps 1516: Document title.
1517: This is the mandatory second macro of any
1.66 kristaps 1518: .Nm
1.100 kristaps 1519: file.
1.120 kristaps 1520: Its syntax is as follows:
1521: .Bd -ragged -offset indent
1522: .Pf \. Sx \&Dt
1523: .Oo
1524: .Cm title
1525: .Oo
1526: .Cm section
1527: .Op Cm volume | arch
1528: .Oc
1529: .Oc
1530: .Ed
1.66 kristaps 1531: .Pp
1532: Its arguments are as follows:
1533: .Bl -tag -width Ds -offset Ds
1534: .It Cm title
1.111 kristaps 1535: The document's title (name), defaulting to
1.138 ! kristaps 1536: .Dq UNKNOWN
1.111 kristaps 1537: if unspecified.
1538: It should be capitalised.
1.66 kristaps 1539: .It Cm section
1.100 kristaps 1540: The manual section.
1541: This may be one of
1.66 kristaps 1542: .Ar 1
1543: .Pq utilities ,
1544: .Ar 2
1545: .Pq system calls ,
1546: .Ar 3
1547: .Pq libraries ,
1548: .Ar 3p
1549: .Pq Perl libraries ,
1550: .Ar 4
1551: .Pq devices ,
1552: .Ar 5
1553: .Pq file formats ,
1554: .Ar 6
1555: .Pq games ,
1556: .Ar 7
1557: .Pq miscellaneous ,
1558: .Ar 8
1559: .Pq system utilities ,
1560: .Ar 9
1561: .Pq kernel functions ,
1562: .Ar X11
1563: .Pq X Window System ,
1564: .Ar X11R6
1565: .Pq X Window System ,
1566: .Ar unass
1567: .Pq unassociated ,
1568: .Ar local
1569: .Pq local system ,
1570: .Ar draft
1571: .Pq draft manual ,
1572: or
1573: .Ar paper
1574: .Pq paper .
1.111 kristaps 1575: It should correspond to the manual's filename suffix and defaults to
1.138 ! kristaps 1576: .Dq 1
1.111 kristaps 1577: if unspecified.
1.66 kristaps 1578: .It Cm volume
1579: This overrides the volume inferred from
1580: .Ar section .
1581: This field is optional, and if specified, must be one of
1582: .Ar USD
1583: .Pq users' supplementary documents ,
1584: .Ar PS1
1585: .Pq programmers' supplementary documents ,
1586: .Ar AMD
1587: .Pq administrators' supplementary documents ,
1588: .Ar SMM
1589: .Pq system managers' manuals ,
1590: .Ar URM
1591: .Pq users' reference manuals ,
1592: .Ar PRM
1593: .Pq programmers' reference manuals ,
1594: .Ar KM
1595: .Pq kernel manuals ,
1596: .Ar IND
1597: .Pq master index ,
1598: .Ar MMI
1599: .Pq master index ,
1600: .Ar LOCAL
1601: .Pq local manuals ,
1602: .Ar LOC
1603: .Pq local manuals ,
1604: or
1605: .Ar CON
1606: .Pq contributed manuals .
1607: .It Cm arch
1.100 kristaps 1608: This specifies a specific relevant architecture.
1609: If
1.66 kristaps 1610: .Cm volume
1611: is not provided, it may be used in its place, else it may be used
1.100 kristaps 1612: subsequent that.
1613: It, too, is optional.
1614: It must be one of
1.66 kristaps 1615: .Ar alpha ,
1616: .Ar amd64 ,
1617: .Ar amiga ,
1618: .Ar arc ,
1619: .Ar arm ,
1620: .Ar armish ,
1621: .Ar aviion ,
1622: .Ar hp300 ,
1623: .Ar hppa ,
1624: .Ar hppa64 ,
1625: .Ar i386 ,
1626: .Ar landisk ,
1.86 kristaps 1627: .Ar loongson ,
1.66 kristaps 1628: .Ar luna88k ,
1629: .Ar mac68k ,
1630: .Ar macppc ,
1631: .Ar mvme68k ,
1632: .Ar mvme88k ,
1633: .Ar mvmeppc ,
1634: .Ar pmax ,
1635: .Ar sgi ,
1636: .Ar socppc ,
1637: .Ar sparc ,
1638: .Ar sparc64 ,
1639: .Ar sun3 ,
1640: .Ar vax ,
1641: or
1642: .Ar zaurus .
1643: .El
1644: .Pp
1645: Examples:
1.91 kristaps 1646: .D1 \&.Dt FOO 1
1647: .D1 \&.Dt FOO 4 KM
1648: .D1 \&.Dt FOO 9 i386
1.66 kristaps 1649: .Pp
1650: See also
1651: .Sx \&Dd
1652: and
1653: .Sx \&Os .
1.63 kristaps 1654: .Ss \&Dv
1.66 kristaps 1655: Defined variables such as preprocessor constants.
1656: .Pp
1657: Examples:
1.91 kristaps 1658: .D1 \&.Dv BUFSIZ
1659: .D1 \&.Dv STDOUT_FILENO
1.66 kristaps 1660: .Pp
1661: See also
1662: .Sx \&Er .
1.63 kristaps 1663: .Ss \&Dx
1.71 kristaps 1664: Format the DragonFly BSD version provided as an argument, or a default
1.66 kristaps 1665: value if no argument is provided.
1666: .Pp
1667: Examples:
1.91 kristaps 1668: .D1 \&.Dx 2.4.1
1669: .D1 \&.Dx
1.66 kristaps 1670: .Pp
1671: See also
1672: .Sx \&At ,
1673: .Sx \&Bsx ,
1674: .Sx \&Bx ,
1675: .Sx \&Fx ,
1676: .Sx \&Nx ,
1677: .Sx \&Ox ,
1678: and
1679: .Sx \&Ux .
1.63 kristaps 1680: .Ss \&Ec
1.131 kristaps 1681: Close a scope started by
1682: .Sx \&Eo .
1683: Its syntax is as follows:
1684: .Pp
1685: .D1 Pf \. Sx \&Ec Op Cm TERM
1686: .Pp
1687: The
1688: .Cm TERM
1689: argument is used as the enclosure tail, for example, specifying \e(rq
1690: will emulate
1691: .Sx \&Dc .
1.63 kristaps 1692: .Ss \&Ed
1.131 kristaps 1693: End a display context started by
1694: .Sx \&Bd .
1.63 kristaps 1695: .Ss \&Ef
1.129 kristaps 1696: Ends a font mode context started by
1697: .Sx \&Bf .
1.63 kristaps 1698: .Ss \&Ek
1.127 schwarze 1699: Ends a keep context started by
1700: .Sx \&Bk .
1.63 kristaps 1701: .Ss \&El
1.117 kristaps 1702: Ends a list context started by
1703: .Sx \&Bl .
1704: .Pp
1705: See also
1706: .Sx \&Bl
1707: and
1708: .Sx \&It .
1.63 kristaps 1709: .Ss \&Em
1.100 kristaps 1710: Denotes text that should be emphasised.
1711: Note that this is a presentation term and should not be used for
1712: stylistically decorating technical terms.
1.66 kristaps 1713: .Pp
1714: Examples:
1.91 kristaps 1715: .D1 \&.Em Warnings!
1716: .D1 \&.Em Remarks :
1.138 ! kristaps 1717: .Pp
! 1718: See also
! 1719: .Sx \&Bf ,
! 1720: .Sx \&Sy ,
! 1721: and
! 1722: .Sx \&Li .
1.63 kristaps 1723: .Ss \&En
1.132 kristaps 1724: This macro is obsolete and not implemented.
1.63 kristaps 1725: .Ss \&Eo
1.131 kristaps 1726: An arbitrary enclosure.
1727: Its syntax is as follows:
1728: .Pp
1729: .D1 Pf \. Sx \&Eo Op Cm TERM
1730: .Pp
1731: The
1732: .Cm TERM
1733: argument is used as the enclosure head, for example, specifying \e(lq
1734: will emulate
1735: .Sx \&Do .
1.63 kristaps 1736: .Ss \&Er
1.90 kristaps 1737: Display error constants.
1.66 kristaps 1738: .Pp
1739: Examples:
1.91 kristaps 1740: .D1 \&.Er EPERM
1741: .D1 \&.Er ENOENT
1.66 kristaps 1742: .Pp
1743: See also
1744: .Sx \&Dv .
1.63 kristaps 1745: .Ss \&Es
1.132 kristaps 1746: This macro is obsolete and not implemented.
1.63 kristaps 1747: .Ss \&Ev
1.66 kristaps 1748: Environmental variables such as those specified in
1749: .Xr environ 7 .
1750: .Pp
1751: Examples:
1.91 kristaps 1752: .D1 \&.Ev DISPLAY
1753: .D1 \&.Ev PATH
1.63 kristaps 1754: .Ss \&Ex
1.100 kristaps 1755: Inserts text regarding a utility's exit values.
1756: This macro must have first the
1.66 kristaps 1757: .Fl std
1758: argument specified, then an optional
1759: .Ar utility .
1760: If
1761: .Ar utility
1762: is not provided, the document's name as stipulated in
1763: .Sx \&Nm
1764: is provided.
1.63 kristaps 1765: .Ss \&Fa
1.117 kristaps 1766: Function argument.
1.120 kristaps 1767: Its syntax is as follows:
1768: .Bd -ragged -offset indent
1769: .Pf \. Sx \&Fa
1770: .Op Cm argtype
1771: .Cm argname
1772: .Ed
1773: .Pp
1.117 kristaps 1774: This may be invoked for names with or without the corresponding type.
1775: It is also used to specify the field name of a structure.
1776: Most often, the
1777: .Sx \&Fa
1778: macro is used in the
1779: .Em SYNOPSIS
1.120 kristaps 1780: within
1781: .Sx \&Fo
1.117 kristaps 1782: section when documenting multi-line function prototypes.
1783: If invoked with multiple arguments, the arguments are separated by a
1784: comma.
1785: Furthermore, if the following macro is another
1786: .Sx \&Fa ,
1787: the last argument will also have a trailing comma.
1788: .Pp
1789: Examples:
1790: .D1 \&.Fa \(dqconst char *p\(dq
1791: .D1 \&.Fa \(dqint a\(dq \(dqint b\(dq \(dqint c\(dq
1792: .D1 \&.Fa foo
1.120 kristaps 1793: .Pp
1794: See also
1795: .Sx \&Fo .
1.63 kristaps 1796: .Ss \&Fc
1.131 kristaps 1797: Ends a function context started by
1798: .Sx \&Fo .
1.63 kristaps 1799: .Ss \&Fd
1.117 kristaps 1800: Historically used to document include files.
1801: This usage has been deprecated in favour of
1802: .Sx \&In .
1803: Do not use this macro.
1804: .Pp
1805: See also
1.122 kristaps 1806: .Sx MANUAL STRUCTURE
1807: and
1.117 kristaps 1808: .Sx \&In .
1.63 kristaps 1809: .Ss \&Fl
1.100 kristaps 1810: Command-line flag.
1811: Used when listing arguments to command-line utilities.
1812: Prints a fixed-width hyphen
1.79 kristaps 1813: .Sq \-
1.100 kristaps 1814: directly followed by each argument.
1815: If no arguments are provided, a hyphen is printed followed by a space.
1816: If the argument is a macro, a hyphen is prefixed to the subsequent macro
1817: output.
1.79 kristaps 1818: .Pp
1819: Examples:
1.91 kristaps 1820: .D1 \&.Fl a b c
1821: .D1 \&.Fl \&Pf a b
1822: .D1 \&.Fl
1823: .D1 \&.Op \&Fl o \&Ns \&Ar file
1.79 kristaps 1824: .Pp
1825: See also
1826: .Sx \&Cm .
1.63 kristaps 1827: .Ss \&Fn
1.119 kristaps 1828: A function name.
1.120 kristaps 1829: Its syntax is as follows:
1.119 kristaps 1830: .Bd -ragged -offset indent
1831: .Pf \. Ns Sx \&Fn
1832: .Op Cm functype
1833: .Cm funcname
1834: .Op Oo Cm argtype Oc Cm argname
1835: .Ed
1.120 kristaps 1836: .Pp
1.122 kristaps 1837: Function arguments are surrounded in parenthesis and
1.119 kristaps 1838: are delimited by commas.
1839: If no arguments are specified, blank parenthesis are output.
1840: .Pp
1841: Examples:
1842: .D1 \&.Fn "int funcname" "int arg0" "int arg1"
1843: .D1 \&.Fn funcname "int arg0"
1844: .D1 \&.Fn funcname arg0
1.120 kristaps 1845: .Bd -literal -offset indent -compact
1846: \&.Ft functype
1847: \&.Fn funcname
1848: .Ed
1.119 kristaps 1849: .Pp
1850: See also
1.122 kristaps 1851: .Sx MANUAL STRUCTURE
1.119 kristaps 1852: and
1853: .Sx \&Ft .
1.63 kristaps 1854: .Ss \&Fo
1.120 kristaps 1855: Begin a function block.
1856: This is a multi-line version of
1857: .Sx \&Fn .
1858: Its syntax is as follows:
1859: .Pp
1860: .D1 Pf \. Sx \&Fo Cm funcname
1861: .Pp
1862: Invocations usually occur in the following context:
1863: .Bd -ragged -offset indent
1864: .Pf \. Sx \&Ft Cm functype
1865: .br
1866: .Pf \. Sx \&Fo Cm funcname
1867: .br
1868: .Pf \. Sx \&Fa Oo Cm argtype Oc Cm argname
1869: .br
1870: \.\.\.
1871: .br
1872: .Pf \. Sx \&Fc
1873: .Ed
1874: .Pp
1875: A
1876: .Sx \&Fo
1877: scope is closed by
1878: .Pp
1879: See also
1.122 kristaps 1880: .Sx MANUAL STRUCTURE ,
1.120 kristaps 1881: .Sx \&Fa ,
1882: .Sx \&Fc ,
1883: and
1.63 kristaps 1884: .Ss \&Ft
1.120 kristaps 1885: A function type.
1886: Its syntax is as follows:
1887: .Pp
1888: .D1 Pf \. Sx \&Ft Cm functype
1889: .Pp
1890: Examples:
1891: .D1 \&.Ft int
1892: .Bd -literal -offset indent -compact
1893: \&.Ft functype
1894: \&.Fn funcname
1895: .Ed
1896: .Pp
1897: See also
1.122 kristaps 1898: .Sx MANUAL STRUCTURE ,
1899: .Sx \&Fn ,
1.120 kristaps 1900: and
1.122 kristaps 1901: .Sx \&Fo .
1.63 kristaps 1902: .Ss \&Fx
1.65 kristaps 1903: Format the FreeBSD version provided as an argument, or a default value
1904: if no argument is provided.
1905: .Pp
1906: Examples:
1.91 kristaps 1907: .D1 \&.Fx 7.1
1908: .D1 \&.Fx
1.65 kristaps 1909: .Pp
1910: See also
1911: .Sx \&At ,
1.66 kristaps 1912: .Sx \&Bsx ,
1.65 kristaps 1913: .Sx \&Bx ,
1.66 kristaps 1914: .Sx \&Dx ,
1.65 kristaps 1915: .Sx \&Nx ,
1916: .Sx \&Ox ,
1917: and
1918: .Sx \&Ux .
1.63 kristaps 1919: .Ss \&Hf
1.132 kristaps 1920: This macro is obsolete and not implemented.
1.63 kristaps 1921: .Ss \&Ic
1.132 kristaps 1922: Designate an internal or interactive command.
1923: This is similar to
1924: .Sx \&Cm
1925: but used for instructions rather than values.
1926: .Pp
1927: Examples:
1928: .D1 \&.Ic hash
1929: .D1 \&.Ic alias
1930: .Pp
1931: Note that using
1932: .Sx \&Bd No Fl literal
1933: or
1934: .Sx \&D1
1935: is preferred for displaying code; the
1936: .Sx \&Ic
1937: macro is used when referring to specific instructions.
1.63 kristaps 1938: .Ss \&In
1.118 kristaps 1939: An
1.138 ! kristaps 1940: .Dq include
1.118 kristaps 1941: file.
1942: In the
1943: .Em SYNOPSIS
1944: section (only if invoked as the line macro), the first argument is
1945: preceded by
1.138 ! kristaps 1946: .Dq #include ,
1.122 kristaps 1947: the arguments is enclosed in angled braces.
1.118 kristaps 1948: .Pp
1.122 kristaps 1949: Examples:
1.118 kristaps 1950: .D1 \&.In sys/types
1.122 kristaps 1951: .Pp
1952: See also
1953: .Sx MANUAL STRUCTURE .
1.63 kristaps 1954: .Ss \&It
1.120 kristaps 1955: A list item.
1956: The syntax of this macro depends on the list type.
1.114 kristaps 1957: .Pp
1958: Lists
1959: of type
1960: .Fl hang ,
1961: .Fl ohang ,
1962: .Fl inset ,
1963: and
1964: .Fl diag
1.120 kristaps 1965: have the following syntax:
1.114 kristaps 1966: .Pp
1.120 kristaps 1967: .D1 Pf \. Sx \&It Cm args
1.114 kristaps 1968: .Pp
1969: Lists of type
1970: .Fl bullet ,
1971: .Fl dash ,
1972: .Fl enum ,
1973: .Fl hyphen
1974: and
1975: .Fl item
1.120 kristaps 1976: have the following syntax:
1.114 kristaps 1977: .Pp
1.120 kristaps 1978: .D1 Pf \. Sx \&It
1.114 kristaps 1979: .Pp
1980: with subsequent lines interpreted within the scope of the
1981: .Sx \&It
1982: until either a closing
1983: .Sx \&El
1984: or another
1985: .Sx \&It .
1986: .Pp
1987: The
1988: .Fl tag
1.120 kristaps 1989: list has the following syntax:
1.114 kristaps 1990: .Pp
1.120 kristaps 1991: .D1 Pf \. Sx \&It Op Cm args
1.114 kristaps 1992: .Pp
1.120 kristaps 1993: Subsequent lines are interpreted as with
1.114 kristaps 1994: .Fl bullet
1995: and family.
1996: The line arguments correspond to the list's left-hand side; body
1997: arguments correspond to the list's contents.
1998: .Pp
1999: The
2000: .Fl column
2001: list is the most complicated.
1.120 kristaps 2002: Its syntax is as follows:
1.114 kristaps 2003: .Pp
1.120 kristaps 2004: .D1 Pf \. Sx \&It Op Cm args
1.114 kristaps 2005: .Pp
1.120 kristaps 2006: The
1.114 kristaps 2007: .Cm args
2008: are phrases, a mix of macros and text corresponding to a line column,
2009: delimited by tabs or the special
2010: .Sq \&Ta
2011: pseudo-macro.
2012: Lines subsequent the
2013: .Sx \&It
2014: are interpreted within the scope of the last phrase.
2015: Calling the pseudo-macro
2016: .Sq \&Ta
2017: will open a new phrase scope (this must occur on a macro line to be
1.138 ! kristaps 2018: interpreted as a macro).
! 2019: Note that the tab phrase delimiter may only be used within the
1.114 kristaps 2020: .Sx \&It
2021: line itself.
2022: Subsequent this, only the
2023: .Sq \&Ta
2024: pseudo-macro may be used to delimit phrases.
1.124 kristaps 2025: Furthermore, note that quoted sections propagate over tab-delimited
1.114 kristaps 2026: phrases on an
2027: .Sx \&It ,
2028: for example,
2029: .Pp
1.121 kristaps 2030: .D1 .It \(dqcol1 ; <TAB> col2 ;\(dq \&;
1.114 kristaps 2031: .Pp
2032: will preserve the semicolon whitespace except for the last.
2033: .Pp
2034: See also
2035: .Sx \&Bl .
1.63 kristaps 2036: .Ss \&Lb
1.109 kristaps 2037: Specify a library.
1.120 kristaps 2038: The syntax is as follows:
1.109 kristaps 2039: .Pp
1.120 kristaps 2040: .D1 Pf \. Sx \&Lb Cm library
1.109 kristaps 2041: .Pp
2042: The
2043: .Cm library
2044: parameter may be a system library, such as
2045: .Cm libz
2046: or
2047: .Cm libpam ,
2048: in which case a small library description is printed next to the linker
2049: invocation; or a custom library, in which case the library name is
2050: printed in quotes.
2051: This is most commonly used in the
2052: .Em SYNOPSIS
2053: section as described in
2054: .Sx MANUAL STRUCTURE .
2055: .Pp
2056: Examples:
2057: .D1 \&.Lb libz
2058: .D1 \&.Lb mdoc
1.63 kristaps 2059: .Ss \&Li
1.131 kristaps 2060: Denotes text that should be in a literal font mode.
2061: Note that this is a presentation term and should not be used for
2062: stylistically decorating technical terms.
1.138 ! kristaps 2063: .Pp
! 2064: See also
! 2065: .Sx \&Bf ,
! 2066: .Sx \&Sy ,
! 2067: and
! 2068: .Sx \&Em .
1.63 kristaps 2069: .Ss \&Lk
1.100 kristaps 2070: Format a hyperlink.
1.120 kristaps 2071: Its syntax is as follows:
1.70 kristaps 2072: .Pp
1.120 kristaps 2073: .D1 Pf \. Sx \&Lk Cm uri Op Cm name
1.70 kristaps 2074: .Pp
2075: Examples:
1.91 kristaps 2076: .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
2077: .D1 \&.Lk http://bsd.lv
1.70 kristaps 2078: .Pp
2079: See also
2080: .Sx \&Mt .
1.63 kristaps 2081: .Ss \&Lp
1.132 kristaps 2082: Synonym for
2083: .Sx \&Pp .
1.63 kristaps 2084: .Ss \&Ms
1.138 ! kristaps 2085: Display a mathematical symbol.
! 2086: .Pp
! 2087: Examples:
! 2088: .D1 \&.Ms sigma
! 2089: .D1 \&.Ms aleph
1.63 kristaps 2090: .Ss \&Mt
1.116 kristaps 2091: Format a
1.138 ! kristaps 2092: .Dq mailto:
1.116 kristaps 2093: hyperlink.
1.120 kristaps 2094: Its syntax is as follows:
1.116 kristaps 2095: .Pp
1.120 kristaps 2096: .D1 Pf \. Sx \&Mt Cm address
1.116 kristaps 2097: .Pp
2098: Examples:
2099: .D1 \&.Mt discuss@manpages.bsd.lv
1.63 kristaps 2100: .Ss \&Nd
1.132 kristaps 2101: A one-line description of the manual's content.
2102: This may only be invoked in the
2103: .Em SYNOPSIS
2104: section subsequent the
2105: .Sx \&Nm
2106: macro.
2107: .Pp
2108: Examples:
2109: .D1 \&.Sx \&Nd mdoc language reference
2110: .D1 \&.Sx \&Nd format and display UNIX manuals
2111: .Pp
2112: The
2113: .Sx \&Nd
2114: macro technically accepts child macros and terminates with a subsequent
2115: .Sx \&Sh
2116: invocation.
2117: Do not assume this behaviour: some
2118: .Xr whatis 1
2119: database generators are not smart enough to parse more than the line
2120: arguments and will display macros verbatim.
2121: .Pp
2122: See also
2123: .Sx \&Nm .
1.63 kristaps 2124: .Ss \&Nm
1.128 schwarze 2125: The name of the manual page, or \(em in particular in section 1, 6,
2126: and 8 pages \(em of an additional command or feature documented in
2127: the manual page.
2128: When first invoked, the
2129: .Sx \&Nm
2130: macro expects a single argument, the name of the manual page.
2131: Usually, the first invocation happens in the
2132: .Em NAME
2133: section of the page.
2134: The specified name will be remembered and used whenever the macro is
2135: called again without arguments later in the page.
2136: The
2137: .Sx \&Nm
2138: macro uses
2139: .Sx Block full-implicit
2140: semantics when invoked as the first macro on an input line in the
2141: .Em SYNOPSIS
2142: section; otherwise, it uses ordinary
2143: .Sx In-line
2144: semantics.
2145: .Pp
2146: Examples:
2147: .Bd -literal -offset indent
2148: \&.Sh SYNOPSIS
2149: \&.Nm cat
2150: \&.Op Fl benstuv
2151: \&.Op Ar
2152: .Ed
2153: .Pp
2154: In the
2155: .Em SYNOPSIS
2156: of section 2, 3 and 9 manual pages, use the
2157: .Sx \&Fn
2158: macro rather than
2159: .Sx \&Nm
2160: to mark up the name of the manual page.
1.63 kristaps 2161: .Ss \&No
1.132 kristaps 2162: A
1.138 ! kristaps 2163: .Dq noop
1.132 kristaps 2164: macro used to terminate prior macro contexts.
2165: .Pp
2166: Examples:
2167: .D1 \&.Sx \&Fl ab \&No cd \&Fl ef
1.63 kristaps 2168: .Ss \&Ns
1.138 ! kristaps 2169: Suppress a space.
! 2170: Following invocation, text is interpreted as free-form text until a
! 2171: macro is encountered.
! 2172: .Pp
! 2173: Examples:
! 2174: .D1 \&.Fl o \&Ns \&Ar output
! 2175: .Pp
! 2176: See also
! 2177: .Sx \&No
! 2178: and
! 2179: .Sx \&Sm .
1.63 kristaps 2180: .Ss \&Nx
1.65 kristaps 2181: Format the NetBSD version provided as an argument, or a default value if
2182: no argument is provided.
2183: .Pp
2184: Examples:
1.91 kristaps 2185: .D1 \&.Nx 5.01
2186: .D1 \&.Nx
1.65 kristaps 2187: .Pp
2188: See also
2189: .Sx \&At ,
1.66 kristaps 2190: .Sx \&Bsx ,
1.65 kristaps 2191: .Sx \&Bx ,
1.66 kristaps 2192: .Sx \&Dx ,
1.65 kristaps 2193: .Sx \&Fx ,
2194: .Sx \&Ox ,
2195: and
2196: .Sx \&Ux .
1.63 kristaps 2197: .Ss \&Oc
1.132 kristaps 2198: Closes multi-line
2199: .Sx \&Oo
2200: context.
1.63 kristaps 2201: .Ss \&Oo
1.132 kristaps 2202: Multi-line version of
2203: .Sx \&Op .
2204: .Pp
2205: Examples:
1.138 ! kristaps 2206: .Bd -literal -offset indent -compact
1.132 kristaps 2207: \&.Oo
2208: \&.Op Fl flag Ns Ar value
2209: \&.Oc
2210: .Ed
1.63 kristaps 2211: .Ss \&Op
1.132 kristaps 2212: Command-line option.
2213: Used when listing options to command-line utilities.
2214: Prints the argument(s) in brackets.
2215: .Pp
2216: Examples:
2217: .D1 \&.Op \&Fl a \&Ar b
2218: .D1 \&.Op \&Ar a | b
2219: .Pp
2220: See also
2221: .Sx \&Oo .
1.63 kristaps 2222: .Ss \&Os
1.100 kristaps 2223: Document operating system version.
2224: This is the mandatory third macro of
1.66 kristaps 2225: any
2226: .Nm
1.120 kristaps 2227: file.
2228: Its syntax is as follows:
1.66 kristaps 2229: .Pp
1.120 kristaps 2230: .D1 Pf \. Sx \&Os Op Cm system
1.66 kristaps 2231: .Pp
2232: The optional
2233: .Cm system
1.100 kristaps 2234: parameter specifies the relevant operating system or environment.
2235: Left unspecified, it defaults to the local operating system version.
2236: This is the suggested form.
1.66 kristaps 2237: .Pp
2238: Examples:
1.91 kristaps 2239: .D1 \&.Os
2240: .D1 \&.Os KTH/CSC/TCS
2241: .D1 \&.Os BSD 4.3
1.66 kristaps 2242: .Pp
2243: See also
2244: .Sx \&Dd
2245: and
2246: .Sx \&Dt .
1.63 kristaps 2247: .Ss \&Ot
1.66 kristaps 2248: Unknown usage.
2249: .Pp
2250: .Em Remarks :
2251: this macro has been deprecated.
1.63 kristaps 2252: .Ss \&Ox
1.65 kristaps 2253: Format the OpenBSD version provided as an argument, or a default value
2254: if no argument is provided.
2255: .Pp
2256: Examples:
1.91 kristaps 2257: .D1 \&.Ox 4.5
2258: .D1 \&.Ox
1.65 kristaps 2259: .Pp
2260: See also
2261: .Sx \&At ,
2262: .Sx \&Bsx ,
2263: .Sx \&Bx ,
1.66 kristaps 2264: .Sx \&Dx ,
1.65 kristaps 2265: .Sx \&Fx ,
2266: .Sx \&Nx ,
2267: and
2268: .Sx \&Ux .
1.63 kristaps 2269: .Ss \&Pa
1.132 kristaps 2270: A file-system path.
2271: .Pp
2272: Examples:
2273: .D1 \&.Pa /usr/bin/mandoc
2274: .D1 \&.Pa /usr/share/man/man7/mdoc.7
2275: .Pp
2276: See also
2277: .Sx \&Lk .
1.63 kristaps 2278: .Ss \&Pc
1.132 kristaps 2279: Close parenthesised context opened by
2280: .Sx \&Po .
1.63 kristaps 2281: .Ss \&Pf
1.132 kristaps 2282: Removes the space
1.138 ! kristaps 2283: .Pq Dq prefix
1.132 kristaps 2284: between its arguments.
2285: Its syntax is as follows:
2286: .Pp
2287: .D1 Pf \. \&Pf Cm prefix suffix
2288: .Pp
2289: The
2290: .Cm suffix
2291: argument may be a macro.
2292: .Pp
2293: Examples:
2294: .D1 \&.Pf \e. \&Sx \&Pf \&Cm prefix suffix
1.63 kristaps 2295: .Ss \&Po
1.132 kristaps 2296: Multi-line version of
2297: .Sx \&Pq .
1.63 kristaps 2298: .Ss \&Pp
1.132 kristaps 2299: Break a paragraph.
2300: This will assert vertical space between prior and subsequent macros
2301: and/or text.
1.63 kristaps 2302: .Ss \&Pq
1.132 kristaps 2303: Parenthesised enclosure.
2304: .Pp
2305: See also
2306: .Sx \&Po .
1.63 kristaps 2307: .Ss \&Qc
1.138 ! kristaps 2308: Close quoted context opened by
! 2309: .Sx \&Qo .
1.63 kristaps 2310: .Ss \&Ql
1.138 ! kristaps 2311: Format a single-quoted literal.
! 2312: See also
! 2313: .Sx \&Qq
! 2314: and
! 2315: .Sx \&Sq .
1.63 kristaps 2316: .Ss \&Qo
1.138 ! kristaps 2317: Multi-line version of
! 2318: .Sx \&Qq .
1.63 kristaps 2319: .Ss \&Qq
1.138 ! kristaps 2320: Encloses its arguments in
! 2321: .Dq typewriter
! 2322: double-quotes.
! 2323: Consider using
! 2324: .Sx \&Dq .
! 2325: .Pp
! 2326: See also
! 2327: .Sx \&Dq ,
! 2328: .Sx \&Sq ,
! 2329: and
! 2330: .Sx \&Qo .
1.63 kristaps 2331: .Ss \&Re
2332: Closes a
2333: .Sx \&Rs
1.100 kristaps 2334: block.
2335: Does not have any tail arguments.
1.63 kristaps 2336: .Ss \&Rs
2337: Begins a bibliographic
2338: .Pq Dq reference
1.100 kristaps 2339: block.
2340: Does not have any head arguments.
2341: The block macro may only contain
1.63 kristaps 2342: .Sx \&%A ,
2343: .Sx \&%B ,
2344: .Sx \&%C ,
2345: .Sx \&%D ,
2346: .Sx \&%I ,
2347: .Sx \&%J ,
2348: .Sx \&%N ,
2349: .Sx \&%O ,
2350: .Sx \&%P ,
2351: .Sx \&%Q ,
2352: .Sx \&%R ,
2353: .Sx \&%T ,
1.120 kristaps 2354: .Sx \&%U ,
1.63 kristaps 2355: and
2356: .Sx \&%V
2357: child macros (at least one must be specified).
2358: .Pp
1.64 kristaps 2359: Examples:
1.91 kristaps 2360: .Bd -literal -offset indent -compact
1.63 kristaps 2361: \&.Rs
2362: \&.%A J. E. Hopcroft
2363: \&.%A J. D. Ullman
2364: \&.%B Introduction to Automata Theory, Languages, and Computation
2365: \&.%I Addison-Wesley
2366: \&.%C Reading, Massachusettes
2367: \&.%D 1979
2368: \&.Re
2369: .Ed
2370: .Pp
2371: If an
2372: .Sx \&Rs
2373: block is used within a SEE ALSO section, a vertical space is asserted
2374: before the rendered output, else the block continues on the current
2375: line.
2376: .Ss \&Rv
2377: .Ss \&Sc
1.138 ! kristaps 2378: Close single-quoted context opened by
! 2379: .Sx \&So .
1.63 kristaps 2380: .Ss \&Sh
1.138 ! kristaps 2381: Begin a new section.
! 2382: For a list of conventional manual sections, see
! 2383: .Sx MANUAL STRUCTURE .
! 2384: These sections should be used unless it's absolutely necessary that
! 2385: custom sections be used.
! 2386: .Pp
! 2387: Section names should be unique so that they may be keyed by
! 2388: .Sx \&Sx .
! 2389: .Pp
! 2390: See also
! 2391: .Sx \&Pp ,
! 2392: .Sx \&Ss ,
! 2393: and
! 2394: .Sx \&Sx .
1.63 kristaps 2395: .Ss \&Sm
1.134 schwarze 2396: Switches the spacing mode for output generated from macros.
2397: Its syntax is as follows:
2398: .Pp
2399: .D1 Pf \. Sx \&Sm Cm on | off
2400: .Pp
2401: By default, spacing is
2402: .Cm on .
2403: When switched
2404: .Cm off ,
2405: no white space is inserted between macro arguments and between the
2406: output generated from adjacent macros, but free-form text lines
2407: still get normal spacing between words and sentences.
1.63 kristaps 2408: .Ss \&So
1.138 ! kristaps 2409: Multi-line version of
! 2410: .Sx \&Sq .
1.63 kristaps 2411: .Ss \&Sq
1.138 ! kristaps 2412: Encloses its arguments in
! 2413: .Dq typewriter
! 2414: single-quotes.
! 2415: .Pp
! 2416: See also
! 2417: .Sx \&Dq ,
! 2418: .Sx \&Qq ,
! 2419: and
! 2420: .Sx \&So .
1.63 kristaps 2421: .Ss \&Ss
1.138 ! kristaps 2422: Begin a new sub-section.
! 2423: Unlike with
! 2424: .Sx \&Sh ,
! 2425: there's no convention for sub-sections.
! 2426: Conventional sections, as described in
! 2427: .Sx MANUAL STRUCTURE ,
! 2428: rarely have sub-sections.
! 2429: .Pp
! 2430: Sub-section names should be unique so that they may be keyed by
! 2431: .Sx \&Sx .
! 2432: .Pp
! 2433: See also
! 2434: .Sx \&Pp ,
! 2435: .Sx \&Sh ,
! 2436: and
! 2437: .Sx \&Sx .
1.63 kristaps 2438: .Ss \&St
2439: .Ss \&Sx
1.138 ! kristaps 2440: Reference a section or sub-section.
! 2441: The referenced section or sub-section name must be identical to the
! 2442: enclosed argument, including whitespace.
! 2443: .Pp
! 2444: Examples:
! 2445: .D1 \&.Sx MANUAL STRUCTURE
1.63 kristaps 2446: .Ss \&Sy
1.138 ! kristaps 2447: Format enclosed arguments in symbolic
! 2448: .Pq Dq boldface .
! 2449: Note that this is a presentation term and should not be used for
! 2450: stylistically decorating technical terms.
! 2451: .Pp
! 2452: See also
! 2453: .Sx \&Bf ,
! 2454: .Sx \&Li ,
! 2455: and
! 2456: .Sx \&Em .
1.63 kristaps 2457: .Ss \&Tn
1.138 ! kristaps 2458: Format a tradename.
! 2459: .Pp
! 2460: Examples:
! 2461: .D1 \&.Tn IBM .
1.63 kristaps 2462: .Ss \&Ud
1.110 kristaps 2463: Prints out
2464: .Dq currently under development.
1.63 kristaps 2465: .Ss \&Ux
1.100 kristaps 2466: Format the UNIX name.
2467: Accepts no argument.
1.65 kristaps 2468: .Pp
2469: Examples:
1.91 kristaps 2470: .D1 \&.Ux
1.65 kristaps 2471: .Pp
2472: See also
2473: .Sx \&At ,
1.66 kristaps 2474: .Sx \&Bsx ,
1.65 kristaps 2475: .Sx \&Bx ,
1.66 kristaps 2476: .Sx \&Dx ,
1.65 kristaps 2477: .Sx \&Fx ,
2478: .Sx \&Nx ,
2479: and
2480: .Sx \&Ox .
1.63 kristaps 2481: .Ss \&Va
1.132 kristaps 2482: A variable name.
2483: .Pp
2484: Examples:
2485: .D1 \&.Va foo
2486: .D1 \&.Va const char *bar ;
1.63 kristaps 2487: .Ss \&Vt
1.100 kristaps 2488: A variable type.
1.122 kristaps 2489: This is also used for indicating global variables in the
2490: .Em SYNOPSIS
1.100 kristaps 2491: section, in which case a variable name is also specified.
2492: Note that it accepts
1.83 kristaps 2493: .Sx Block partial-implicit
1.123 kristaps 2494: syntax when invoked as the first macro in the
1.122 kristaps 2495: .Em SYNOPSIS
2496: section, else it accepts ordinary
1.83 kristaps 2497: .Sx In-line
2498: syntax.
2499: .Pp
2500: Note that this should not be confused with
2501: .Sx \&Ft ,
2502: which is used for function return types.
2503: .Pp
2504: Examples:
1.91 kristaps 2505: .D1 \&.Vt unsigned char
1.121 kristaps 2506: .D1 \&.Vt extern const char * const sys_signame[] \&;
1.83 kristaps 2507: .Pp
2508: See also
1.122 kristaps 2509: .Sx MANUAL STRUCTURE
1.83 kristaps 2510: and
2511: .Sx \&Va .
1.84 kristaps 2512: .Ss \&Xc
1.87 kristaps 2513: Close a scope opened by
2514: .Sx \&Xo .
1.84 kristaps 2515: .Ss \&Xo
1.100 kristaps 2516: Open an extension scope.
2517: This macro originally existed to extend the 9-argument limit of troff;
2518: since this limit has been lifted, the macro has been deprecated.
1.84 kristaps 2519: .Ss \&Xr
2520: Link to another manual
2521: .Pq Qq cross-reference .
1.120 kristaps 2522: Its syntax is as follows:
1.84 kristaps 2523: .Pp
1.120 kristaps 2524: .D1 Pf \. Sx \&Xr Cm name section
1.84 kristaps 2525: .Pp
2526: The
2527: .Cm name
2528: and
2529: .Cm section
1.100 kristaps 2530: are the name and section of the linked manual.
2531: If
1.84 kristaps 2532: .Cm section
2533: is followed by non-punctuation, an
2534: .Sx \&Ns
1.100 kristaps 2535: is inserted into the token stream.
2536: This behaviour is for compatibility with
1.84 kristaps 2537: .Xr groff 1 .
2538: .Pp
2539: Examples:
1.91 kristaps 2540: .D1 \&.Xr mandoc 1
1.121 kristaps 2541: .D1 \&.Xr mandoc 1 \&;
1.91 kristaps 2542: .D1 \&.Xr mandoc 1 \&Ns s behaviour
1.84 kristaps 2543: .Ss \&br
2544: .Ss \&sp
1.4 kristaps 2545: .Sh COMPATIBILITY
1.93 kristaps 2546: This section documents compatibility between mandoc and other other
2547: troff implementations, at this time limited to GNU troff
2548: .Pq Qq groff .
1.50 kristaps 2549: The term
1.57 kristaps 2550: .Qq historic groff
1.93 kristaps 2551: refers to groff versions before the
1.57 kristaps 2552: .Pa doc.tmac
1.50 kristaps 2553: file re-write
1.57 kristaps 2554: .Pq somewhere between 1.15 and 1.19 .
2555: .Pp
1.93 kristaps 2556: Heirloom troff, the other significant troff implementation accepting
2557: \-mdoc, is similar to historic groff.
2558: .Pp
1.57 kristaps 2559: .Bl -dash -compact
1.125 kristaps 2560: .It
1.137 kristaps 2561: The \es (font size), \em (font colour), and \eM (font filling colour)
2562: font decoration escapes are all discarded in mandoc.
2563: .It
1.126 kristaps 2564: Old groff fails to assert a newline before
2565: .Sx \&Bd Fl ragged compact .
1.119 kristaps 2566: .It
1.120 kristaps 2567: groff behaves inconsistently when encountering
2568: .Pf non- Sx \&Fa
2569: children of
2570: .Sx \&Fo
2571: regarding spacing between arguments.
2572: In mandoc, this is not the case: each argument is consistently followed
2573: by a single space and the trailing
2574: .Sq \&)
2575: suppresses prior spacing.
2576: .It
2577: groff behaves inconsistently when encountering
2578: .Sx \&Ft
2579: and
2580: .Sx \&Fn
2581: in the
2582: .Em SYNOPSIS :
1.124 kristaps 2583: at times newline(s) are suppressed depending on whether a prior
1.120 kristaps 2584: .Sx \&Fn
2585: has been invoked.
2586: In mandoc, this is not the case.
2587: See
2588: .Sx \&Ft
2589: and
2590: .Sx \&Fn
2591: for the normalised behaviour.
2592: .It
1.119 kristaps 2593: Historic groff does not break before an
2594: .Sx \&Fn
2595: when not invoked as the line macro in the
2596: .Em SYNOPSIS
2597: section.
1.118 kristaps 2598: .It
2599: Historic groff formats the
2600: .Sx \&In
2601: badly: trailing arguments are trashed and
2602: .Em SYNOPSIS
2603: is not specially treated.
1.115 kristaps 2604: .It
2605: groff does not accept the
2606: .Sq \&Ta
2607: pseudo-macro as a line macro.
2608: mandoc does.
1.57 kristaps 2609: .It
1.81 kristaps 2610: The comment syntax
1.137 kristaps 2611: .Sq \e\."
1.81 kristaps 2612: is no longer accepted.
2613: .It
1.93 kristaps 2614: In groff, the
1.80 kristaps 2615: .Sx \&Pa
2616: macro does not format its arguments when used in the FILES section under
1.100 kristaps 2617: certain list types.
2618: mandoc does.
1.80 kristaps 2619: .It
1.93 kristaps 2620: Historic groff does not print a dash for empty
1.79 kristaps 2621: .Sx \&Fl
1.100 kristaps 2622: arguments.
2623: mandoc and newer groff implementations do.
1.79 kristaps 2624: .It
1.93 kristaps 2625: groff behaves irregularly when specifying
1.77 kristaps 2626: .Sq \ef
1.93 kristaps 2627: .Sx Text Decoration
1.100 kristaps 2628: within line-macro scopes.
2629: mandoc follows a consistent system.
1.77 kristaps 2630: .It
1.93 kristaps 2631: In mandoc, negative scaling units are truncated to zero; groff would
1.100 kristaps 2632: move to prior lines.
2633: Furthermore, the
1.61 kristaps 2634: .Sq f
2635: scaling unit, while accepted, is rendered as the default unit.
2636: .It
1.48 kristaps 2637: In quoted literals, groff allowed pair-wise double-quotes to produce a
1.100 kristaps 2638: standalone double-quote in formatted output.
2639: This idiosyncratic behaviour is not applicable in mandoc.
1.57 kristaps 2640: .It
1.126 kristaps 2641: Display offsets
1.78 kristaps 2642: .Sx \&Bd
1.126 kristaps 2643: .Fl offset Ar center
1.64 kristaps 2644: and
1.126 kristaps 2645: .Fl offset Ar right
2646: are disregarded in mandoc.
1.131 kristaps 2647: Furthermore, troff specifies a
1.64 kristaps 2648: .Fl file Ar file
1.131 kristaps 2649: argument that is not supported in mandoc.
1.100 kristaps 2650: Lastly, since text is not right-justified in mandoc (or even groff),
1.64 kristaps 2651: .Fl ragged
2652: and
2653: .Fl filled
2654: are aliases, as are
2655: .Fl literal
2656: and
2657: .Fl unfilled .
1.57 kristaps 2658: .It
1.100 kristaps 2659: Historic groff has many un-callable macros.
2660: Most of these (excluding some block-level macros) are now callable.
1.57 kristaps 2661: .It
1.50 kristaps 2662: The vertical bar
1.57 kristaps 2663: .Sq \(ba
1.28 kristaps 2664: made historic groff
1.57 kristaps 2665: .Qq go orbital
1.93 kristaps 2666: but has been a proper delimiter since then.
1.57 kristaps 2667: .It
1.93 kristaps 2668: .Sx \&It Fl nested
1.28 kristaps 2669: is assumed for all lists (it wasn't in historic groff): any list may be
2670: nested and
1.64 kristaps 2671: .Fl enum
1.4 kristaps 2672: lists will restart the sequence only for the sub-list.
1.57 kristaps 2673: .It
1.4 kristaps 2674: Some manuals use
1.64 kristaps 2675: .Sx \&Li
1.4 kristaps 2676: incorrectly by following it with a reserved character and expecting the
1.100 kristaps 2677: delimiter to render.
2678: This is not supported in mandoc.
1.93 kristaps 2679: .It
2680: In groff, the
2681: .Sx \&Cd ,
2682: .Sx \&Er ,
1.106 kristaps 2683: .Sx \&Ex ,
1.93 kristaps 2684: and
1.106 kristaps 2685: .Sx \&Rv
1.100 kristaps 2686: macros were stipulated only to occur in certain manual sections.
2687: mandoc does not have these restrictions.
1.105 kristaps 2688: .It
2689: Newer groff and mandoc print
2690: .Qq AT&T UNIX
2691: prior to unknown arguments of
2692: .Sx \&At ;
2693: older groff did nothing.
1.57 kristaps 2694: .El
1.2 kristaps 2695: .Sh SEE ALSO
1.57 kristaps 2696: .Xr mandoc 1 ,
2697: .Xr mandoc_char 7
1.2 kristaps 2698: .Sh AUTHORS
2699: The
1.57 kristaps 2700: .Nm
1.50 kristaps 2701: reference was written by
1.94 kristaps 2702: .An Kristaps Dzonsons Aq kristaps@bsd.lv .
CVSweb