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