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