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