Annotation of mandoc/man.7, Revision 1.74
1.74 ! kristaps 1: .\" $Id: man.7,v 1.73 2010/05/25 22:48:04 kristaps Exp $
1.1 kristaps 2: .\"
1.62 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.10 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.
8: .\"
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.1 kristaps 16: .\"
1.74 ! kristaps 17: .Dd $Mdocdate: May 25 2010 $
1.9 kristaps 18: .Dt MAN 7
1.1 kristaps 19: .Os
20: .Sh NAME
1.32 kristaps 21: .Nm man
22: .Nd man language reference
1.1 kristaps 23: .Sh DESCRIPTION
24: The
1.32 kristaps 25: .Nm man
1.20 kristaps 26: language was historically used to format
1.32 kristaps 27: .Ux
1.68 kristaps 28: manuals.
29: This reference document describes its syntax, structure, and usage.
1.32 kristaps 30: .Pp
31: .Bf -emphasis
1.20 kristaps 32: Do not use
1.32 kristaps 33: .Nm
1.20 kristaps 34: to write your manuals.
1.32 kristaps 35: .Ef
1.19 kristaps 36: Use the
1.32 kristaps 37: .Xr mdoc 7
1.1 kristaps 38: language, instead.
1.32 kristaps 39: .Pp
1.1 kristaps 40: An
1.32 kristaps 41: .Nm
1.1 kristaps 42: document follows simple rules: lines beginning with the control
1.20 kristaps 43: character
1.32 kristaps 44: .Sq \&.
1.68 kristaps 45: are parsed for macros.
46: Other lines are interpreted within the scope of
1.1 kristaps 47: prior macros:
1.32 kristaps 48: .Bd -literal -offset indent
1.1 kristaps 49: \&.SH Macro lines change control state.
50: Other lines are interpreted within the current state.
1.32 kristaps 51: .Ed
1.1 kristaps 52: .Sh INPUT ENCODING
1.32 kristaps 53: .Nm
1.14 kristaps 54: documents may contain only graphable 7-bit ASCII characters, the
1.68 kristaps 55: space character, and the tabs character.
56: All manuals must have
1.32 kristaps 57: .Ux
1.20 kristaps 58: line termination.
1.32 kristaps 59: .Pp
1.5 kristaps 60: Blank lines are acceptable; where found, the output will assert a
1.1 kristaps 61: vertical space.
1.32 kristaps 62: .Ss Comments
1.21 kristaps 63: Text following a
1.32 kristaps 64: .Sq \e\*" ,
1.21 kristaps 65: whether in a macro or free-form text line, is ignored to the end of
1.68 kristaps 66: line.
67: A macro line with only a control character and comment escape,
1.32 kristaps 68: .Sq \&.\e" ,
1.68 kristaps 69: is also ignored.
70: Macro lines with only a control character and optionally whitespace are
71: stripped from input.
1.32 kristaps 72: .Ss Special Characters
1.21 kristaps 73: Special characters may occur in both macro and free-form lines.
74: Sequences begin with the escape character
1.32 kristaps 75: .Sq \e
1.20 kristaps 76: followed by either an open-parenthesis
1.32 kristaps 77: .Sq \&(
1.1 kristaps 78: for two-character sequences; an open-bracket
1.32 kristaps 79: .Sq \&[
1.1 kristaps 80: for n-character sequences (terminated at a close-bracket
1.32 kristaps 81: .Sq \&] ) ;
1.68 kristaps 82: or a single one-character sequence.
83: See
1.32 kristaps 84: .Xr mandoc_char 7
1.68 kristaps 85: for a complete list.
86: Examples include
1.32 kristaps 87: .Sq \e(em
88: .Pq em-dash
1.21 kristaps 89: and
1.32 kristaps 90: .Sq \ee
91: .Pq back-slash .
92: .Ss Text Decoration
1.21 kristaps 93: Terms may be text-decorated using the
1.32 kristaps 94: .Sq \ef
1.47 kristaps 95: escape followed by an indicator: B (bold), I, (italic), R (Roman), or P
1.55 kristaps 96: (revert to previous mode):
1.48 kristaps 97: .Pp
98: .D1 \efBbold\efR \efIitalic\efP
99: .Pp
100: A numerical representation 3, 2, or 1 (bold, italic, and Roman,
1.68 kristaps 101: respectively) may be used instead.
102: A text decoration is only valid, if specified in free-form text, until
103: the next macro invocation; if specified within a macro, it's only valid
104: until the macro closes scope.
1.54 kristaps 105: Note that macros like
106: .Sx \&BR
107: open and close a font scope with each argument.
1.48 kristaps 108: .Pp
109: Text may also be sized with the
110: .Sq \es
111: escape, whose syntax is one of
112: .Sq \es+-n
113: for one-digit numerals;
114: .Sq \es(+-nn
115: or
116: .Sq \es+-(nn
117: for two-digit numerals; and
118: .Sq \es[+-N] ,
119: .Sq \es+-[N] ,
120: .Sq \es'+-N' ,
121: or
122: .Sq \es+-'N'
123: for arbitrary-digit numerals:
124: .Pp
125: .D1 \es+1bigger\es-1
126: .D1 \es[+10]much bigger\es[-10]
127: .D1 \es+(10much bigger\es-(10
128: .D1 \es+'100'much much bigger\es-'100'
1.49 kristaps 129: .Pp
130: Both
131: .Sq \es
132: and
133: .Sq \ef
1.53 kristaps 134: attributes are forgotten when entering or exiting a macro block.
1.32 kristaps 135: .Ss Whitespace
1.66 kristaps 136: Whitespace consists of the space character.
1.64 kristaps 137: In free-form lines, whitespace is preserved within a line; un-escaped
138: trailing spaces are stripped from input (unless in a literal context).
139: Blank free-form lines, which may include spaces, are permitted and
140: rendered as an empty line.
141: .Pp
1.68 kristaps 142: In macro lines, whitespace delimits arguments and is discarded.
143: If arguments are quoted, whitespace within the quotes is retained.
1.43 kristaps 144: .Ss Dates
145: The
146: .Sx \&TH
147: macro is the only
148: .Nm
1.68 kristaps 149: macro that requires a date.
150: The form for this date is the ISO-8601
1.43 kristaps 151: standard
152: .Cm YYYY-MM-DD .
1.38 kristaps 153: .Ss Scaling Widths
154: Many macros support scaled widths for their arguments, such as
155: stipulating a two-inch paragraph indentation with the following:
156: .Bd -literal -offset indent
157: \&.HP 2i
158: .Ed
159: .Pp
160: The syntax for scaled widths is
161: .Sq Li [+-]?[0-9]*.[0-9]*[:unit:]? ,
162: where a decimal must be preceded or proceeded by at least one digit.
1.68 kristaps 163: Negative numbers, while accepted, are truncated to zero.
164: The following scaling units are accepted:
1.38 kristaps 165: .Pp
166: .Bl -tag -width Ds -offset indent -compact
167: .It c
168: centimetre
169: .It i
170: inch
171: .It P
172: pica (~1/6 inch)
173: .It p
174: point (~1/72 inch)
175: .It f
176: synonym for
177: .Sq u
178: .It v
179: default vertical span
180: .It m
181: width of rendered
182: .Sq m
183: .Pq em
184: character
185: .It n
186: width of rendered
187: .Sq n
188: .Pq en
189: character
190: .It u
191: default horizontal span
192: .It M
193: mini-em (~1/100 em)
194: .El
195: .Pp
196: Using anything other than
197: .Sq m ,
198: .Sq n ,
199: .Sq u ,
200: or
201: .Sq v
1.44 kristaps 202: is necessarily non-portable across output media.
1.38 kristaps 203: .Pp
204: If a scaling unit is not provided, the numerical value is interpreted
205: under the default rules of
206: .Sq v
207: for vertical spaces and
208: .Sq u
209: for horizontal ones.
210: .Em Note :
211: this differs from
212: .Xr mdoc 7 ,
213: which, if a unit is not provided, will instead interpret the string as
214: literal text.
1.69 kristaps 215: .Ss Sentence Spacing
216: When composing a manual, make sure that your sentences end at the end of
217: a line.
218: By doing so, front-ends will be able to apply the proper amount of
1.71 kristaps 219: spacing after the end of sentence (unescaped) period, exclamation mark,
220: or question mark followed by zero or more non-sentence closing
221: delimiters (
222: .Ns Sq \&) ,
223: .Sq \&] ,
224: .Sq \&' ,
225: .Sq \&" ) .
1.22 kristaps 226: .Sh MANUAL STRUCTURE
1.16 kristaps 227: Each
1.32 kristaps 228: .Nm
1.16 kristaps 229: document must contain contains at least the
1.39 kristaps 230: .Sx \&TH
1.68 kristaps 231: macro describing the document's section and title.
232: It may occur anywhere in the document, although conventionally, it
233: appears as the first macro.
1.32 kristaps 234: .Pp
1.22 kristaps 235: Beyond
1.39 kristaps 236: .Sx \&TH ,
1.68 kristaps 237: at least one macro or text node must appear in the document.
238: Documents are generally structured as follows:
1.32 kristaps 239: .Bd -literal -offset indent
1.43 kristaps 240: \&.TH FOO 1 2009-10-10
1.22 kristaps 241: \&.
242: \&.SH NAME
1.29 kristaps 243: \efBfoo\efR \e(en a description goes here
1.33 kristaps 244: \&.\e\*q The next is for sections 2 & 3 only.
245: \&.\e\*q .SH LIBRARY
1.22 kristaps 246: \&.
247: \&.SH SYNOPSIS
248: \efBfoo\efR [\efB\e-options\efR] arguments...
249: \&.
250: \&.SH DESCRIPTION
1.33 kristaps 251: The \efBfoo\efR utility processes files...
1.22 kristaps 252: \&.
1.33 kristaps 253: \&.\e\*q .SH IMPLEMENTATION NOTES
254: \&.\e\*q The next is for sections 2, 3, & 9 only.
1.22 kristaps 255: \&.\e\*q .SH RETURN VALUES
1.33 kristaps 256: \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
1.22 kristaps 257: \&.\e\*q .SH ENVIRONMENT
258: \&.\e\*q .SH FILES
1.67 kristaps 259: \&.\e\*q The next is for sections 1 & 8 only.
260: \&.\e\*q .SH EXIT STATUS
1.22 kristaps 261: \&.\e\*q .SH EXAMPLES
1.33 kristaps 262: \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
1.22 kristaps 263: \&.\e\*q .SH DIAGNOSTICS
1.33 kristaps 264: \&.\e\*q The next is for sections 2, 3, & 9 only.
1.22 kristaps 265: \&.\e\*q .SH ERRORS
266: \&.\e\*q .SH SEE ALSO
1.42 kristaps 267: \&.\e\*q .BR foo ( 1 )
1.22 kristaps 268: \&.\e\*q .SH STANDARDS
269: \&.\e\*q .SH HISTORY
270: \&.\e\*q .SH AUTHORS
271: \&.\e\*q .SH CAVEATS
272: \&.\e\*q .SH BUGS
1.33 kristaps 273: \&.\e\*q .SH SECURITY CONSIDERATIONS
1.32 kristaps 274: .Ed
1.41 kristaps 275: .Pp
276: The sections in a
277: .Nm
1.68 kristaps 278: document are conventionally ordered as they appear above.
279: Sections should be composed as follows:
1.42 kristaps 280: .Bl -ohang -offset indent
281: .It Em NAME
1.68 kristaps 282: The name(s) and a short description of the documented material.
283: The syntax for this is generally as follows:
1.41 kristaps 284: .Pp
285: .D1 \efBname\efR \e(en description
1.42 kristaps 286: .It Em LIBRARY
1.41 kristaps 287: The name of the library containing the documented material, which is
1.68 kristaps 288: assumed to be a function in a section 2 or 3 manual.
289: For functions in the C library, this may be as follows:
1.41 kristaps 290: .Pp
291: .D1 Standard C Library (libc, -lc)
1.42 kristaps 292: .It Em SYNOPSIS
1.41 kristaps 293: Documents the utility invocation syntax, function call syntax, or device
1.55 kristaps 294: configuration.
1.41 kristaps 295: .Pp
296: For the first, utilities (sections 1, 6, and 8), this is
297: generally structured as follows:
298: .Pp
299: .D1 \efBname\efR [-\efBab\efR] [-\efBc\efR\efIarg\efR] \efBpath\efR...
300: .Pp
301: For the second, function calls (sections 2, 3, 9):
302: .Pp
1.44 kristaps 303: .D1 \&.B char *name(char *\efIarg\efR);
1.41 kristaps 304: .Pp
305: And for the third, configurations (section 4):
306: .Pp
1.44 kristaps 307: .D1 \&.B name* at cardbus ? function ?
1.41 kristaps 308: .Pp
1.55 kristaps 309: Manuals not in these sections generally don't need a
1.42 kristaps 310: .Em SYNOPSIS .
311: .It Em DESCRIPTION
1.55 kristaps 312: This expands upon the brief, one-line description in
1.42 kristaps 313: .Em NAME .
314: It usually contains a break-down of the options (if documenting a
315: command).
316: .It Em IMPLEMENTATION NOTES
1.68 kristaps 317: Implementation-specific notes should be kept here.
318: This is useful when implementing standard functions that may have side
319: effects or notable algorithmic implications.
1.42 kristaps 320: .It Em RETURN VALUES
321: This section is the dual of
322: .Em EXIT STATUS ,
1.68 kristaps 323: which is used for commands.
324: It documents the return values of functions in sections 2, 3, and 9.
1.42 kristaps 325: .It Em ENVIRONMENT
326: Documents any usages of environment variables, e.g.,
327: .Xr environ 7 .
328: .It Em FILES
1.68 kristaps 329: Documents files used.
330: It's helpful to document both the file and a short description of how
331: the file is used (created, modified, etc.).
1.67 kristaps 332: .It Em EXIT STATUS
1.68 kristaps 333: Command exit status for section 1, 6, and 8 manuals.
334: This section is the dual of
1.67 kristaps 335: .Em RETURN VALUES ,
1.68 kristaps 336: which is used for functions.
337: Historically, this information was described in
1.67 kristaps 338: .Em DIAGNOSTICS ,
339: a practise that is now discouraged.
1.42 kristaps 340: .It Em EXAMPLES
1.68 kristaps 341: Example usages.
342: This often contains snippets of well-formed,
343: well-tested invocations.
344: Make doubly sure that your examples work properly!
1.42 kristaps 345: .It Em DIAGNOSTICS
1.68 kristaps 346: Documents error conditions.
347: This is most useful in section 4 manuals.
1.42 kristaps 348: Historically, this section was used in place of
349: .Em EXIT STATUS
350: for manuals in sections 1, 6, and 8; however, this practise is
351: discouraged.
352: .It Em ERRORS
353: Documents error handling in sections 2, 3, and 9.
354: .It Em SEE ALSO
1.68 kristaps 355: References other manuals with related topics.
356: This section should exist for most manuals.
1.44 kristaps 357: .Pp
358: .D1 \&.BR bar \&( 1 \&),
359: .Pp
360: Cross-references should conventionally be ordered
1.42 kristaps 361: first by section, then alphabetically.
362: .It Em STANDARDS
363: References any standards implemented or used, such as
364: .Pp
365: .D1 IEEE Std 1003.2 (\e(lqPOSIX.2\e(rq)
366: .Pp
367: If not adhering to any standards, the
368: .Em HISTORY
369: section should be used.
370: .It Em HISTORY
371: The history of any manual without a
372: .Em STANDARDS
373: section should be described in this section.
374: .It Em AUTHORS
375: Credits to authors, if applicable, should appear in this section.
376: Authors should generally be noted by both name and an e-mail address.
377: .It Em CAVEATS
378: Explanations of common misuses and misunderstandings should be explained
379: in this section.
380: .It Em BUGS
381: Extant bugs should be described in this section.
382: .It Em SECURITY CONSIDERATIONS
383: Documents any security precautions that operators should consider.
1.41 kristaps 384: .El
1.22 kristaps 385: .Sh MACRO SYNTAX
1.2 kristaps 386: Macros are one to three three characters in length and begin with a
1.4 kristaps 387: control character ,
1.32 kristaps 388: .Sq \&. ,
1.68 kristaps 389: at the beginning of the line.
390: The
1.59 kristaps 391: .Sq \(aq
1.68 kristaps 392: macro control character is also accepted.
393: An arbitrary amount of whitespace (spaces or tabs) may sit between the
394: control character and the macro name.
395: Thus, the following are equivalent:
1.39 kristaps 396: .Bd -literal -offset indent
397: \&.PP
398: \&.\ \ \ PP
399: .Ed
1.32 kristaps 400: .Pp
1.1 kristaps 401: The
1.32 kristaps 402: .Nm
1.68 kristaps 403: macros are classified by scope: line scope or block scope.
404: Line macros are only scoped to the current line (and, in some
405: situations, the subsequent line).
406: Block macros are scoped to the current line and subsequent lines until
407: closed by another block macro.
1.32 kristaps 408: .Ss Line Macros
1.30 kristaps 409: Line macros are generally scoped to the current line, with the body
1.68 kristaps 410: consisting of zero or more arguments.
411: If a macro is scoped to the next line and the line arguments are empty,
412: the next line, which must be text, is used instead.
413: Thus:
1.32 kristaps 414: .Bd -literal -offset indent
1.30 kristaps 415: \&.I
1.4 kristaps 416: foo
1.32 kristaps 417: .Ed
418: .Pp
1.20 kristaps 419: is equivalent to
1.32 kristaps 420: .Sq \&.I foo .
1.56 kristaps 421: If next-line macros are invoked consecutively, only the last is used.
422: If a next-line macro is followed by a non-next-line macro, an error is
423: raised (unless in the case of
424: .Sx \&br ,
425: .Sx \&sp ,
426: or
427: .Sx \&na ) .
428: .Pp
429: The syntax is as follows:
1.32 kristaps 430: .Bd -literal -offset indent
1.22 kristaps 431: \&.YO \(lBbody...\(rB
432: \(lBbody...\(rB
1.32 kristaps 433: .Ed
434: .Pp
1.57 kristaps 435: .Bl -column -compact -offset indent "MacroX" "ArgumentsX" "ScopeXXXXX" "CompatX"
436: .It Em Macro Ta Em Arguments Ta Em Scope Ta Em Notes
1.73 kristaps 437: .It Sx \&AT Ta <=1 Ta current Ta \&
1.57 kristaps 438: .It Sx \&B Ta n Ta next-line Ta \&
439: .It Sx \&BI Ta n Ta current Ta \&
440: .It Sx \&BR Ta n Ta current Ta \&
441: .It Sx \&DT Ta 0 Ta current Ta \&
442: .It Sx \&I Ta n Ta next-line Ta \&
443: .It Sx \&IB Ta n Ta current Ta \&
444: .It Sx \&IR Ta n Ta current Ta \&
1.58 kristaps 445: .\" .It Sx \&PD Ta n Ta current Ta compat
1.57 kristaps 446: .It Sx \&R Ta n Ta next-line Ta \&
447: .It Sx \&RB Ta n Ta current Ta \&
448: .It Sx \&RI Ta n Ta current Ta \&
449: .It Sx \&SB Ta n Ta next-line Ta \&
450: .It Sx \&SM Ta n Ta next-line Ta \&
451: .It Sx \&TH Ta >1, <6 Ta current Ta \&
1.73 kristaps 452: .It Sx \&UC Ta <=1 Ta current Ta \&
1.57 kristaps 453: .It Sx \&br Ta 0 Ta current Ta compat
454: .It Sx \&fi Ta 0 Ta current Ta compat
455: .It Sx \&i Ta n Ta current Ta compat
456: .It Sx \&na Ta 0 Ta current Ta compat
457: .It Sx \&nf Ta 0 Ta current Ta compat
458: .It Sx \&r Ta 0 Ta current Ta compat
459: .It Sx \&sp Ta 1 Ta current Ta compat
1.70 kristaps 460: .\" .It Sx \&Sp Ta <1 Ta current Ta compat
1.58 kristaps 461: .\" .It Sx \&Vb Ta <1 Ta current Ta compat
462: .\" .It Sx \&Ve Ta 0 Ta current Ta compat
1.32 kristaps 463: .El
464: .Pp
1.57 kristaps 465: Macros marked as
466: .Qq compat
467: are included for compatibility with the significant corpus of existing
1.68 kristaps 468: manuals that mix dialects of roff.
469: These macros should not be used for portable
1.58 kristaps 470: .Nm
471: manuals.
1.32 kristaps 472: .Ss Block Macros
1.68 kristaps 473: Block macros are comprised of a head and body.
474: Like for in-line macros, the head is scoped to the current line and, in
475: one circumstance, the next line (the next-line stipulations as in
1.57 kristaps 476: .Sx Line Macros
477: apply here as well).
1.56 kristaps 478: .Pp
479: The syntax is as follows:
1.32 kristaps 480: .Bd -literal -offset indent
1.22 kristaps 481: \&.YO \(lBhead...\(rB
482: \(lBhead...\(rB
483: \(lBbody...\(rB
1.32 kristaps 484: .Ed
485: .Pp
1.30 kristaps 486: The closure of body scope may be to the section, where a macro is closed
487: by
1.39 kristaps 488: .Sx \&SH ;
1.30 kristaps 489: sub-section, closed by a section or
1.39 kristaps 490: .Sx \&SS ;
1.30 kristaps 491: part, closed by a section, sub-section, or
1.39 kristaps 492: .Sx \&RE ;
1.55 kristaps 493: or paragraph, closed by a section, sub-section, part,
1.39 kristaps 494: .Sx \&HP ,
495: .Sx \&IP ,
496: .Sx \&LP ,
497: .Sx \&P ,
498: .Sx \&PP ,
1.30 kristaps 499: or
1.39 kristaps 500: .Sx \&TP .
1.30 kristaps 501: No closure refers to an explicit block closing macro.
1.32 kristaps 502: .Pp
1.58 kristaps 503: As a rule, block macros may not be nested; thus, calling a block macro
504: while another block macro scope is open, and the open scope is not
505: implicitly closed, is syntactically incorrect.
506: .Pp
1.57 kristaps 507: .Bl -column -compact -offset indent "MacroX" "ArgumentsX" "Head ScopeX" "sub-sectionX" "compatX"
508: .It Em Macro Ta Em Arguments Ta Em Head Scope Ta Em Body Scope Ta Em Notes
509: .It Sx \&HP Ta <2 Ta current Ta paragraph Ta \&
510: .It Sx \&IP Ta <3 Ta current Ta paragraph Ta \&
511: .It Sx \&LP Ta 0 Ta current Ta paragraph Ta \&
512: .It Sx \&P Ta 0 Ta current Ta paragraph Ta \&
513: .It Sx \&PP Ta 0 Ta current Ta paragraph Ta \&
514: .It Sx \&RE Ta 0 Ta current Ta none Ta compat
515: .It Sx \&RS Ta 1 Ta current Ta part Ta compat
516: .It Sx \&SH Ta >0 Ta next-line Ta section Ta \&
517: .It Sx \&SS Ta >0 Ta next-line Ta sub-section Ta \&
518: .It Sx \&TP Ta n Ta next-line Ta paragraph Ta \&
1.32 kristaps 519: .El
1.57 kristaps 520: .Pp
521: Macros marked
522: .Qq compat
523: are as mentioned in
524: .Sx Line Macros .
1.32 kristaps 525: .Pp
1.22 kristaps 526: If a block macro is next-line scoped, it may only be followed by in-line
1.57 kristaps 527: macros for decorating text.
1.22 kristaps 528: .Sh REFERENCE
529: This section is a canonical reference to all macros, arranged
1.68 kristaps 530: alphabetically.
531: For the scoping of individual macros, see
1.32 kristaps 532: .Sx MACRO SYNTAX .
1.72 joerg 533: .Ss \&AT
534: Sets the volume for the footer for compatibility with man pages from
535: .Tn AT&T UNIX
536: releases.
537: The optional arguments specify which release it is from.
1.39 kristaps 538: .Ss \&B
1.22 kristaps 539: Text is rendered in bold face.
1.44 kristaps 540: .Pp
541: See also
542: .Sx \&I ,
543: .Sx \&R ,
544: .Sx \&b ,
545: .Sx \&i ,
546: and
547: .Sx \&r .
1.39 kristaps 548: .Ss \&BI
1.68 kristaps 549: Text is rendered alternately in bold face and italic.
550: Thus,
1.32 kristaps 551: .Sq .BI this word and that
1.22 kristaps 552: causes
1.32 kristaps 553: .Sq this
1.22 kristaps 554: and
1.32 kristaps 555: .Sq and
1.55 kristaps 556: to render in bold face, while
1.32 kristaps 557: .Sq word
1.22 kristaps 558: and
1.32 kristaps 559: .Sq that
1.68 kristaps 560: render in italics.
561: Whitespace between arguments is omitted in output.
1.44 kristaps 562: .Pp
563: Examples:
1.46 kristaps 564: .Pp
565: .D1 \&.BI bold italic bold italic
1.44 kristaps 566: .Pp
567: The output of this example will be emboldened
568: .Dq bold
569: and italicised
570: .Dq italic ,
571: with spaces stripped between arguments.
572: .Pp
573: See also
574: .Sx \&IB ,
575: .Sx \&BR ,
576: .Sx \&RB ,
577: .Sx \&RI ,
578: and
579: .Sx \&IR .
1.39 kristaps 580: .Ss \&BR
1.22 kristaps 581: Text is rendered alternately in bold face and roman (the default font).
582: Whitespace between arguments is omitted in output.
1.44 kristaps 583: .Pp
584: See
585: .Sx \&BI
586: for an equivalent example.
587: .Pp
588: See also
589: .Sx \&BI ,
590: .Sx \&IB ,
591: .Sx \&RB ,
592: .Sx \&RI ,
593: and
594: .Sx \&IR .
1.39 kristaps 595: .Ss \&DT
1.68 kristaps 596: Has no effect.
597: Included for compatibility.
1.39 kristaps 598: .Ss \&HP
1.23 kristaps 599: Begin a paragraph whose initial output line is left-justified, but
1.27 kristaps 600: subsequent output lines are indented, with the following syntax:
1.44 kristaps 601: .Bd -filled -offset indent
602: .Pf \. Sx \&HP
603: .Op Cm width
1.32 kristaps 604: .Ed
1.44 kristaps 605: .Pp
606: The
607: .Cm width
608: argument must conform to
609: .Sx Scaling Widths .
610: If specified, it's saved for later paragraph left-margins; if unspecified, the
611: saved or default width is used.
612: .Pp
613: See also
1.45 kristaps 614: .Sx \&IP ,
615: .Sx \&LP ,
616: .Sx \&P ,
617: .Sx \&PP ,
1.44 kristaps 618: and
1.45 kristaps 619: .Sx \&TP .
1.39 kristaps 620: .Ss \&I
1.22 kristaps 621: Text is rendered in italics.
1.44 kristaps 622: .Pp
623: See also
624: .Sx \&B ,
625: .Sx \&R ,
626: .Sx \&b ,
627: .Sx \&i ,
628: and
629: .Sx \&r .
1.39 kristaps 630: .Ss \&IB
1.22 kristaps 631: Text is rendered alternately in italics and bold face. Whitespace
632: between arguments is omitted in output.
1.44 kristaps 633: .Pp
634: See
635: .Sx \&BI
636: for an equivalent example.
637: .Pp
638: See also
639: .Sx \&BI ,
640: .Sx \&BR ,
641: .Sx \&RB ,
642: .Sx \&RI ,
643: and
644: .Sx \&IR .
1.39 kristaps 645: .Ss \&IP
1.44 kristaps 646: Begin an indented paragraph with the following syntax:
647: .Bd -filled -offset indent
648: .Pf \. Sx \&IP
649: .Op Cm head Op Cm width
1.32 kristaps 650: .Ed
1.44 kristaps 651: .Pp
652: The
653: .Cm width
654: argument defines the width of the left margin and is defined by
655: .Sx Scaling Widths ,
656: It's saved for later paragraph left-margins; if unspecified, the saved or
657: default width is used.
658: .Pp
659: The
660: .Cm head
1.68 kristaps 661: argument is used as a leading term, flushed to the left margin.
662: This is useful for bulleted paragraphs and so on.
1.44 kristaps 663: .Pp
664: See also
1.45 kristaps 665: .Sx \&HP ,
666: .Sx \&LP ,
667: .Sx \&P ,
668: .Sx \&PP ,
1.44 kristaps 669: and
1.45 kristaps 670: .Sx \&TP .
1.39 kristaps 671: .Ss \&IR
1.22 kristaps 672: Text is rendered alternately in italics and roman (the default font).
673: Whitespace between arguments is omitted in output.
1.44 kristaps 674: .Pp
675: See
676: .Sx \&BI
677: for an equivalent example.
678: .Pp
679: See also
680: .Sx \&BI ,
681: .Sx \&IB ,
682: .Sx \&BR ,
683: .Sx \&RB ,
684: and
685: .Sx \&RI .
1.39 kristaps 686: .Ss \&LP
1.68 kristaps 687: Begin an undecorated paragraph.
688: The scope of a paragraph is closed by a subsequent paragraph,
689: sub-section, section, or end of file.
690: The saved paragraph left-margin width is re-set to the default.
1.44 kristaps 691: .Pp
692: See also
1.45 kristaps 693: .Sx \&HP ,
694: .Sx \&IP ,
695: .Sx \&P ,
696: .Sx \&PP ,
1.44 kristaps 697: and
1.45 kristaps 698: .Sx \&TP .
1.39 kristaps 699: .Ss \&P
700: Synonym for
701: .Sx \&LP .
1.44 kristaps 702: .Pp
703: See also
1.45 kristaps 704: .Sx \&HP ,
705: .Sx \&IP ,
706: .Sx \&LP ,
707: .Sx \&PP ,
1.44 kristaps 708: and
1.45 kristaps 709: .Sx \&TP .
1.39 kristaps 710: .Ss \&PP
711: Synonym for
712: .Sx \&LP .
1.44 kristaps 713: .Pp
714: See also
1.45 kristaps 715: .Sx \&HP ,
716: .Sx \&IP ,
717: .Sx \&LP ,
718: .Sx \&P ,
1.44 kristaps 719: and
1.45 kristaps 720: .Sx \&TP .
1.39 kristaps 721: .Ss \&R
1.22 kristaps 722: Text is rendered in roman (the default font).
1.44 kristaps 723: .Pp
724: See also
725: .Sx \&I ,
726: .Sx \&B ,
727: .Sx \&b ,
728: .Sx \&i ,
729: and
730: .Sx \&r .
1.39 kristaps 731: .Ss \&RB
1.22 kristaps 732: Text is rendered alternately in roman (the default font) and bold face.
733: Whitespace between arguments is omitted in output.
1.44 kristaps 734: .Pp
735: See
736: .Sx \&BI
737: for an equivalent example.
738: .Pp
739: See also
740: .Sx \&BI ,
741: .Sx \&IB ,
742: .Sx \&BR ,
743: .Sx \&RI ,
744: and
745: .Sx \&IR .
1.39 kristaps 746: .Ss \&RE
1.30 kristaps 747: Explicitly close out the scope of a prior
1.39 kristaps 748: .Sx \&RS .
749: .Ss \&RI
1.22 kristaps 750: Text is rendered alternately in roman (the default font) and italics.
751: Whitespace between arguments is omitted in output.
1.44 kristaps 752: .Pp
753: See
754: .Sx \&BI
755: for an equivalent example.
756: .Pp
757: See also
758: .Sx \&BI ,
759: .Sx \&IB ,
760: .Sx \&BR ,
761: .Sx \&RB ,
762: and
763: .Sx \&IR .
1.39 kristaps 764: .Ss \&RS
1.68 kristaps 765: Begin a part setting the left margin.
766: The left margin controls the offset, following an initial indentation,
767: to un-indented text such as that of
1.39 kristaps 768: .Sx \&PP .
1.44 kristaps 769: This has the following syntax:
770: .Bd -filled -offset indent
771: .Pf \. Sx \&Rs
772: .Op Cm width
1.32 kristaps 773: .Ed
1.44 kristaps 774: .Pp
775: The
776: .Cm width
777: argument must conform to
778: .Sx Scaling Widths .
1.55 kristaps 779: If not specified, the saved or default width is used.
1.39 kristaps 780: .Ss \&SB
1.22 kristaps 781: Text is rendered in small size (one point smaller than the default font)
782: bold face.
1.39 kristaps 783: .Ss \&SH
1.68 kristaps 784: Begin a section.
785: The scope of a section is only closed by another section or the end of
786: file.
787: The paragraph left-margin width is re-set to the default.
1.39 kristaps 788: .Ss \&SM
1.22 kristaps 789: Text is rendered in small size (one point smaller than the default
790: font).
1.39 kristaps 791: .Ss \&SS
1.68 kristaps 792: Begin a sub-section.
793: The scope of a sub-section is closed by a subsequent sub-section,
794: section, or end of file.
795: The paragraph left-margin width is re-set to the default.
1.39 kristaps 796: .Ss \&TH
1.22 kristaps 797: Sets the title of the manual page with the following syntax:
1.44 kristaps 798: .Bd -filled -offset indent
799: .Pf \. Sx \&TH
800: .Cm title section
801: .Op Cm date Op Cm source Op Cm volume
802: .Ed
1.43 kristaps 803: .Pp
804: At least the upper-case document title
805: .Cm title
806: and numeric manual section
1.44 kristaps 807: .Cm section
1.68 kristaps 808: arguments must be provided.
809: The
1.43 kristaps 810: .Cm date
811: argument should be formatted as described in
1.74 ! kristaps 812: .Sx Dates ,
! 813: but will be printed verbatim if it is not.
! 814: If the date is not specified, the current date is used.
1.68 kristaps 815: The
1.44 kristaps 816: .Cm source
1.68 kristaps 817: string specifies the organisation providing the utility.
818: The
1.44 kristaps 819: .Cm volume
1.43 kristaps 820: string replaces the default rendered volume, which is dictated by the
821: manual section.
822: .Pp
823: Examples:
1.46 kristaps 824: .Pp
825: .D1 \&.TH CVS 5 "1992-02-12" GNU
1.39 kristaps 826: .Ss \&TP
1.25 kristaps 827: Begin a paragraph where the head, if exceeding the indentation width, is
1.24 kristaps 828: followed by a newline; if not, the body follows on the same line after a
1.68 kristaps 829: buffer to the indentation width.
830: Subsequent output lines are indented.
1.44 kristaps 831: The syntax is as follows:
832: .Bd -filled -offset indent
833: .Pf \. Sx \&TP
834: .Op Cm width
1.32 kristaps 835: .Ed
836: .Pp
1.44 kristaps 837: The
838: .Cm width
839: argument must conform to
840: .Sx Scaling Widths .
841: If specified, it's saved for later paragraph left-margins; if
1.27 kristaps 842: unspecified, the saved or default width is used.
1.44 kristaps 843: .Pp
844: See also
1.45 kristaps 845: .Sx \&HP ,
846: .Sx \&IP ,
847: .Sx \&LP ,
848: .Sx \&P ,
1.44 kristaps 849: and
1.45 kristaps 850: .Sx \&PP .
1.58 kristaps 851: .\" .
852: .\" .
853: .\" .Ss \&PD
854: .\" Has no effect. Included for compatibility.
855: .\" .
856: .\" .
1.72 joerg 857: .Ss \&UC
858: Sets the volume for the footer for compatibility with man pages from
859: BSD releases.
860: The optional first argument specifies which release it is from.
1.39 kristaps 861: .Ss \&br
1.68 kristaps 862: Breaks the current line.
863: Consecutive invocations have no further effect.
1.44 kristaps 864: .Pp
865: See also
866: .Sx \&sp .
1.39 kristaps 867: .Ss \&fi
1.22 kristaps 868: End literal mode begun by
1.39 kristaps 869: .Sx \&nf .
870: .Ss \&i
1.68 kristaps 871: Italicise arguments.
872: Synonym for
1.51 kristaps 873: .Sx \&I .
1.44 kristaps 874: .Pp
875: See also
876: .Sx \&B ,
877: .Sx \&I ,
878: .Sx \&R .
879: .Sx \&b ,
880: and
881: .Sx \&r .
1.39 kristaps 882: .Ss \&na
1.36 kristaps 883: Don't align to the right margin.
1.39 kristaps 884: .Ss \&nf
1.22 kristaps 885: Begin literal mode: all subsequent free-form lines have their end of
1.68 kristaps 886: line boundaries preserved.
887: May be ended by
1.39 kristaps 888: .Sx \&fi .
889: .Ss \&r
1.22 kristaps 890: Fonts and styles (bold face, italics) reset to roman (default font).
1.44 kristaps 891: .Pp
892: See also
893: .Sx \&B ,
894: .Sx \&I ,
895: .Sx \&R ,
896: .Sx \&b ,
897: and
898: .Sx \&i .
1.39 kristaps 899: .Ss \&sp
1.44 kristaps 900: Insert vertical spaces into output with the following syntax:
901: .Bd -filled -offset indent
902: .Pf \. Sx \&sp
903: .Op Cm height
904: .Ed
905: .Pp
1.55 kristaps 906: Insert
1.44 kristaps 907: .Cm height
908: spaces, which must conform to
909: .Sx Scaling Widths .
910: If 0, this is equivalent to the
1.39 kristaps 911: .Sx \&br
1.68 kristaps 912: macro.
913: Defaults to 1, if unspecified.
1.44 kristaps 914: .Pp
915: See also
916: .Sx \&br .
1.58 kristaps 917: .\" .Ss \&Sp
918: .\" A synonym for
919: .\" .Sx \&sp
920: .\" .Cm 0.5v .
921: .\" .
922: .\" .Ss \&Vb
923: .\" A synonym for
924: .\" .Sx \&nf .
925: .\" Accepts an argument (the height of the formatted space) which is
926: .\" disregarded.
927: .\" .
928: .\" .Ss \&Ve
929: .\" A synonym for
930: .\" .Sx \&fi .
931: .\" .
1.18 kristaps 932: .Sh COMPATIBILITY
1.58 kristaps 933: This section documents areas of questionable portability between
934: implementations of the
935: .Nm
936: language.
1.51 kristaps 937: .Pp
938: .Bl -dash -compact
939: .It
1.58 kristaps 940: In quoted literals, GNU troff allowed pair-wise double-quotes to produce
1.68 kristaps 941: a standalone double-quote in formatted output.
942: It is not known whether this behaviour is exhibited by other formatters.
1.32 kristaps 943: .It
1.23 kristaps 944: The
1.51 kristaps 945: .Sx \&sp
1.68 kristaps 946: macro does not accept negative values in mandoc.
947: In GNU troff, this would result in strange behaviour.
1.59 kristaps 948: .It
949: The
950: .Sq \(aq
951: macro control character, in GNU troff (and prior troffs) suppresses a
952: newline before macro output; in mandoc, it is an alias for the standard
953: .Sq \&.
954: control character.
1.32 kristaps 955: .El
1.1 kristaps 956: .Sh SEE ALSO
1.32 kristaps 957: .Xr mandoc 1 ,
958: .Xr mandoc_char 7
1.1 kristaps 959: .Sh AUTHORS
960: The
1.32 kristaps 961: .Nm
1.23 kristaps 962: reference was written by
1.62 kristaps 963: .An Kristaps Dzonsons Aq kristaps@bsd.lv .
1.1 kristaps 964: .Sh CAVEATS
1.68 kristaps 965: Do not use this language.
966: Use
1.32 kristaps 967: .Xr mdoc 7 ,
1.1 kristaps 968: instead.
CVSweb