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