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