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