Annotation of mandoc/man.7, Revision 1.134
1.134 ! schwarze 1: .\" $Id: man.7,v 1.133 2017/05/05 02:31:35 schwarze Exp $
1.1 kristaps 2: .\"
1.115 schwarze 3: .\" Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
1.129 schwarze 4: .\" Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org>
1.122 schwarze 5: .\" Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org>
1.1 kristaps 6: .\"
7: .\" Permission to use, copy, modify, and distribute this software for any
1.10 kristaps 8: .\" purpose with or without fee is hereby granted, provided that the above
9: .\" copyright notice and this permission notice appear in all copies.
10: .\"
11: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15: .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16: .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17: .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1.1 kristaps 18: .\"
1.134 ! schwarze 19: .Dd $Mdocdate: May 5 2017 $
1.9 kristaps 20: .Dt MAN 7
1.1 kristaps 21: .Os
22: .Sh NAME
1.32 kristaps 23: .Nm man
1.111 schwarze 24: .Nd legacy formatting language for manual pages
1.1 kristaps 25: .Sh DESCRIPTION
1.111 schwarze 26: Traditionally, the
1.32 kristaps 27: .Nm man
1.111 schwarze 28: language has been used to write
1.32 kristaps 29: .Ux
1.111 schwarze 30: manuals for the
31: .Xr man 1
32: utility.
33: It supports limited control of presentational details like fonts,
34: indentation and spacing.
35: This reference document describes the structure of manual pages
36: and the syntax and usage of the man language.
1.32 kristaps 37: .Pp
38: .Bf -emphasis
1.20 kristaps 39: Do not use
1.32 kristaps 40: .Nm
1.111 schwarze 41: to write your manuals:
1.32 kristaps 42: .Ef
1.111 schwarze 43: It lacks support for semantic markup.
1.19 kristaps 44: Use the
1.32 kristaps 45: .Xr mdoc 7
1.1 kristaps 46: language, instead.
1.32 kristaps 47: .Pp
1.111 schwarze 48: In a
1.32 kristaps 49: .Nm
1.111 schwarze 50: document, lines beginning with the control character
1.32 kristaps 51: .Sq \&.
1.111 schwarze 52: are called
53: .Dq macro lines .
54: The first word is the macro name.
55: It usually consists of two capital letters.
56: For a list of available macros, see
57: .Sx MACRO OVERVIEW .
58: The words following the macro name are arguments to the macro.
59: .Pp
60: Lines not beginning with the control character are called
61: .Dq text lines .
62: They provide free-form text to be printed; the formatting of the text
63: depends on the respective processing context:
1.32 kristaps 64: .Bd -literal -offset indent
1.1 kristaps 65: \&.SH Macro lines change control state.
1.106 kristaps 66: Text lines are interpreted within the current state.
1.32 kristaps 67: .Ed
1.103 kristaps 68: .Pp
1.111 schwarze 69: Many aspects of the basic syntax of the
1.103 kristaps 70: .Nm
1.111 schwarze 71: language are based on the
72: .Xr roff 7
73: language; see the
74: .Em LANGUAGE SYNTAX
1.106 kristaps 75: and
1.111 schwarze 76: .Em MACRO SYNTAX
77: sections in the
78: .Xr roff 7
79: manual for details, in particular regarding
80: comments, escape sequences, whitespace, and quoting.
1.22 kristaps 81: .Sh MANUAL STRUCTURE
1.16 kristaps 82: Each
1.32 kristaps 83: .Nm
1.80 kristaps 84: document must contain the
1.39 kristaps 85: .Sx \&TH
1.68 kristaps 86: macro describing the document's section and title.
1.80 kristaps 87: It may occur anywhere in the document, although conventionally it
1.68 kristaps 88: appears as the first macro.
1.32 kristaps 89: .Pp
1.22 kristaps 90: Beyond
1.39 kristaps 91: .Sx \&TH ,
1.111 schwarze 92: at least one macro or text line must appear in the document.
1.100 kristaps 93: .Pp
94: The following is a well-formed skeleton
95: .Nm
96: file for a utility
97: .Qq progname :
1.32 kristaps 98: .Bd -literal -offset indent
1.100 kristaps 99: \&.TH PROGNAME 1 2009-10-10
1.22 kristaps 100: \&.SH NAME
1.124 schwarze 101: \efBprogname\efR \e(en one line about what it does
1.106 kristaps 102: \&.\e\(dq .SH LIBRARY
1.124 schwarze 103: \&.\e\(dq For sections 2, 3, and 9 only.
1.106 kristaps 104: \&.\e\(dq Not used in OpenBSD.
1.22 kristaps 105: \&.SH SYNOPSIS
1.124 schwarze 106: \efBprogname\efR [\efB\e-options\efR] \efIfile ...\efR
1.22 kristaps 107: \&.SH DESCRIPTION
1.124 schwarze 108: The \efBfoo\efR utility processes files ...
1.126 schwarze 109: \&.\e\(dq .Sh CONTEXT
110: \&.\e\(dq For section 9 functions only.
1.106 kristaps 111: \&.\e\(dq .SH IMPLEMENTATION NOTES
112: \&.\e\(dq Not used in OpenBSD.
113: \&.\e\(dq .SH RETURN VALUES
1.124 schwarze 114: \&.\e\(dq For sections 2, 3, and 9 function return values only.
1.106 kristaps 115: \&.\e\(dq .SH ENVIRONMENT
1.124 schwarze 116: \&.\e\(dq For sections 1, 6, 7, and 8 only.
1.106 kristaps 117: \&.\e\(dq .SH FILES
118: \&.\e\(dq .SH EXIT STATUS
1.124 schwarze 119: \&.\e\(dq For sections 1, 6, and 8 only.
1.106 kristaps 120: \&.\e\(dq .SH EXAMPLES
121: \&.\e\(dq .SH DIAGNOSTICS
1.124 schwarze 122: \&.\e\(dq For sections 1, 4, 6, 7, 8, and 9 printf/stderr messages only.
1.106 kristaps 123: \&.\e\(dq .SH ERRORS
1.124 schwarze 124: \&.\e\(dq For sections 2, 3, 4, and 9 errno settings only.
1.106 kristaps 125: \&.\e\(dq .SH SEE ALSO
1.124 schwarze 126: \&.\e\(dq .BR foobar ( 1 )
1.106 kristaps 127: \&.\e\(dq .SH STANDARDS
128: \&.\e\(dq .SH HISTORY
129: \&.\e\(dq .SH AUTHORS
130: \&.\e\(dq .SH CAVEATS
131: \&.\e\(dq .SH BUGS
132: \&.\e\(dq .SH SECURITY CONSIDERATIONS
133: \&.\e\(dq Not used in OpenBSD.
1.32 kristaps 134: .Ed
1.41 kristaps 135: .Pp
136: The sections in a
137: .Nm
1.68 kristaps 138: document are conventionally ordered as they appear above.
139: Sections should be composed as follows:
1.42 kristaps 140: .Bl -ohang -offset indent
141: .It Em NAME
1.68 kristaps 142: The name(s) and a short description of the documented material.
143: The syntax for this is generally as follows:
1.41 kristaps 144: .Pp
145: .D1 \efBname\efR \e(en description
1.42 kristaps 146: .It Em LIBRARY
1.41 kristaps 147: The name of the library containing the documented material, which is
1.68 kristaps 148: assumed to be a function in a section 2 or 3 manual.
149: For functions in the C library, this may be as follows:
1.41 kristaps 150: .Pp
151: .D1 Standard C Library (libc, -lc)
1.42 kristaps 152: .It Em SYNOPSIS
1.41 kristaps 153: Documents the utility invocation syntax, function call syntax, or device
1.55 kristaps 154: configuration.
1.41 kristaps 155: .Pp
156: For the first, utilities (sections 1, 6, and 8), this is
157: generally structured as follows:
158: .Pp
159: .D1 \efBname\efR [-\efBab\efR] [-\efBc\efR\efIarg\efR] \efBpath\efR...
160: .Pp
161: For the second, function calls (sections 2, 3, 9):
162: .Pp
1.44 kristaps 163: .D1 \&.B char *name(char *\efIarg\efR);
1.41 kristaps 164: .Pp
165: And for the third, configurations (section 4):
166: .Pp
1.44 kristaps 167: .D1 \&.B name* at cardbus ? function ?
1.41 kristaps 168: .Pp
1.55 kristaps 169: Manuals not in these sections generally don't need a
1.42 kristaps 170: .Em SYNOPSIS .
171: .It Em DESCRIPTION
1.55 kristaps 172: This expands upon the brief, one-line description in
1.42 kristaps 173: .Em NAME .
174: It usually contains a break-down of the options (if documenting a
175: command).
1.126 schwarze 176: .It Em CONTEXT
177: This section lists the contexts in which functions can be called in section 9.
178: The contexts are autoconf, process, or interrupt.
1.42 kristaps 179: .It Em IMPLEMENTATION NOTES
1.68 kristaps 180: Implementation-specific notes should be kept here.
181: This is useful when implementing standard functions that may have side
182: effects or notable algorithmic implications.
1.42 kristaps 183: .It Em RETURN VALUES
1.80 kristaps 184: This section documents the return values of functions in sections 2, 3, and 9.
1.42 kristaps 185: .It Em ENVIRONMENT
186: Documents any usages of environment variables, e.g.,
187: .Xr environ 7 .
188: .It Em FILES
1.68 kristaps 189: Documents files used.
1.78 schwarze 190: It's helpful to document both the file name and a short description of how
1.68 kristaps 191: the file is used (created, modified, etc.).
1.67 kristaps 192: .It Em EXIT STATUS
1.80 kristaps 193: This section documents the command exit status for
194: section 1, 6, and 8 utilities.
1.68 kristaps 195: Historically, this information was described in
1.67 kristaps 196: .Em DIAGNOSTICS ,
197: a practise that is now discouraged.
1.42 kristaps 198: .It Em EXAMPLES
1.68 kristaps 199: Example usages.
200: This often contains snippets of well-formed,
201: well-tested invocations.
1.80 kristaps 202: Make sure that examples work properly!
1.42 kristaps 203: .It Em DIAGNOSTICS
1.68 kristaps 204: Documents error conditions.
1.124 schwarze 205: In section 4 and 9 manuals, these are usually messages
206: printed by the kernel to the console and to the kernel log.
207: In section 1, 6, 7, and 8, these are usually messages
208: printed by userland programs to the standard error output.
209: .Pp
1.42 kristaps 210: Historically, this section was used in place of
211: .Em EXIT STATUS
212: for manuals in sections 1, 6, and 8; however, this practise is
213: discouraged.
214: .It Em ERRORS
1.124 schwarze 215: Documents
216: .Xr errno 2
217: settings in sections 2, 3, 4, and 9.
1.42 kristaps 218: .It Em SEE ALSO
1.68 kristaps 219: References other manuals with related topics.
220: This section should exist for most manuals.
1.44 kristaps 221: .Pp
222: .D1 \&.BR bar \&( 1 \&),
223: .Pp
224: Cross-references should conventionally be ordered
1.42 kristaps 225: first by section, then alphabetically.
226: .It Em STANDARDS
227: References any standards implemented or used, such as
228: .Pp
229: .D1 IEEE Std 1003.2 (\e(lqPOSIX.2\e(rq)
230: .Pp
231: If not adhering to any standards, the
232: .Em HISTORY
233: section should be used.
234: .It Em HISTORY
1.81 schwarze 235: A brief history of the subject, including where support first appeared.
1.42 kristaps 236: .It Em AUTHORS
1.81 schwarze 237: Credits to the person or persons who wrote the code and/or documentation.
1.78 schwarze 238: Authors should generally be noted by both name and email address.
1.42 kristaps 239: .It Em CAVEATS
1.78 schwarze 240: Common misuses and misunderstandings should be explained
1.42 kristaps 241: in this section.
242: .It Em BUGS
1.80 kristaps 243: Known bugs, limitations, and work-arounds should be described
1.78 schwarze 244: in this section.
1.42 kristaps 245: .It Em SECURITY CONSIDERATIONS
246: Documents any security precautions that operators should consider.
1.41 kristaps 247: .El
1.110 schwarze 248: .Sh MACRO OVERVIEW
249: This overview is sorted such that macros of similar purpose are listed
250: together, to help find the best macro for any given purpose.
251: Deprecated macros are not included in the overview, but can be found
252: in the alphabetical reference below.
253: .Ss Page header and footer meta-data
254: .Bl -column "PP, LP, P" description
255: .It Sx TH Ta set the title: Ar title section date Op Ar source Op Ar volume
256: .It Sx AT Ta display AT&T UNIX version in the page footer (<= 1 argument)
257: .It Sx UC Ta display BSD version in the page footer (<= 1 argument)
258: .El
259: .Ss Sections and paragraphs
260: .Bl -column "PP, LP, P" description
261: .It Sx SH Ta section header (one line)
262: .It Sx SS Ta subsection header (one line)
263: .It Sx PP , LP , P Ta start an undecorated paragraph (no arguments)
264: .It Sx RS , RE Ta reset the left margin: Op Ar width
265: .It Sx IP Ta indented paragraph: Op Ar head Op Ar width
266: .It Sx TP Ta tagged paragraph: Op Ar width
267: .It Sx HP Ta hanged paragraph: Op Ar width
1.118 schwarze 268: .It Sx PD Ta set vertical paragraph distance: Op Ar height
1.110 schwarze 269: .It Sx fi , nf Ta fill mode and no-fill mode (no arguments)
270: .It Sx in Ta additional indent: Op Ar width
271: .El
272: .Ss Physical markup
273: .Bl -column "PP, LP, P" description
274: .It Sx B Ta boldface font
275: .It Sx I Ta italic font
276: .It Sx R Ta roman (default) font
277: .It Sx SB Ta small boldface font
278: .It Sx SM Ta small roman font
279: .It Sx BI Ta alternate between boldface and italic fonts
280: .It Sx BR Ta alternate between boldface and roman fonts
281: .It Sx IB Ta alternate between italic and boldface fonts
282: .It Sx IR Ta alternate between italic and roman fonts
283: .It Sx RB Ta alternate between roman and boldface fonts
284: .It Sx RI Ta alternate between roman and italic fonts
285: .El
1.111 schwarze 286: .Sh MACRO REFERENCE
1.22 kristaps 287: This section is a canonical reference to all macros, arranged
1.68 kristaps 288: alphabetically.
289: For the scoping of individual macros, see
1.32 kristaps 290: .Sx MACRO SYNTAX .
1.72 joerg 291: .Ss \&AT
292: Sets the volume for the footer for compatibility with man pages from
1.123 schwarze 293: .At
1.72 joerg 294: releases.
295: The optional arguments specify which release it is from.
1.39 kristaps 296: .Ss \&B
1.22 kristaps 297: Text is rendered in bold face.
1.44 kristaps 298: .Pp
299: See also
1.92 kristaps 300: .Sx \&I
1.44 kristaps 301: and
1.92 kristaps 302: .Sx \&R .
1.39 kristaps 303: .Ss \&BI
1.68 kristaps 304: Text is rendered alternately in bold face and italic.
305: Thus,
1.32 kristaps 306: .Sq .BI this word and that
1.22 kristaps 307: causes
1.32 kristaps 308: .Sq this
1.22 kristaps 309: and
1.32 kristaps 310: .Sq and
1.55 kristaps 311: to render in bold face, while
1.32 kristaps 312: .Sq word
1.22 kristaps 313: and
1.32 kristaps 314: .Sq that
1.68 kristaps 315: render in italics.
316: Whitespace between arguments is omitted in output.
1.44 kristaps 317: .Pp
318: Examples:
1.46 kristaps 319: .Pp
1.93 kristaps 320: .Dl \&.BI bold italic bold italic
1.44 kristaps 321: .Pp
322: The output of this example will be emboldened
323: .Dq bold
324: and italicised
325: .Dq italic ,
326: with spaces stripped between arguments.
327: .Pp
328: See also
329: .Sx \&IB ,
330: .Sx \&BR ,
331: .Sx \&RB ,
332: .Sx \&RI ,
333: and
334: .Sx \&IR .
1.39 kristaps 335: .Ss \&BR
1.22 kristaps 336: Text is rendered alternately in bold face and roman (the default font).
337: Whitespace between arguments is omitted in output.
1.44 kristaps 338: .Pp
339: See
340: .Sx \&BI
341: for an equivalent example.
342: .Pp
343: See also
344: .Sx \&BI ,
345: .Sx \&IB ,
346: .Sx \&RB ,
347: .Sx \&RI ,
348: and
349: .Sx \&IR .
1.39 kristaps 350: .Ss \&DT
1.68 kristaps 351: Has no effect.
352: Included for compatibility.
1.116 schwarze 353: .Ss \&EE
354: This is a non-standard GNU extension, included only for compatibility.
355: In
356: .Xr mandoc 1 ,
357: it does the same as
358: .Sx \&fi .
359: .Ss \&EX
360: This is a non-standard GNU extension, included only for compatibility.
361: In
362: .Xr mandoc 1 ,
363: it does the same as
364: .Sx \&nf .
1.39 kristaps 365: .Ss \&HP
1.23 kristaps 366: Begin a paragraph whose initial output line is left-justified, but
1.27 kristaps 367: subsequent output lines are indented, with the following syntax:
1.44 kristaps 368: .Bd -filled -offset indent
369: .Pf \. Sx \&HP
1.130 schwarze 370: .Op Ar width
1.32 kristaps 371: .Ed
1.44 kristaps 372: .Pp
373: The
1.130 schwarze 374: .Ar width
1.117 schwarze 375: argument is a
376: .Xr roff 7
377: scaling width.
1.44 kristaps 378: If specified, it's saved for later paragraph left-margins; if unspecified, the
379: saved or default width is used.
380: .Pp
381: See also
1.45 kristaps 382: .Sx \&IP ,
383: .Sx \&LP ,
384: .Sx \&P ,
385: .Sx \&PP ,
1.44 kristaps 386: and
1.45 kristaps 387: .Sx \&TP .
1.39 kristaps 388: .Ss \&I
1.22 kristaps 389: Text is rendered in italics.
1.44 kristaps 390: .Pp
391: See also
1.92 kristaps 392: .Sx \&B
1.44 kristaps 393: and
1.92 kristaps 394: .Sx \&R .
1.39 kristaps 395: .Ss \&IB
1.80 kristaps 396: Text is rendered alternately in italics and bold face.
397: Whitespace between arguments is omitted in output.
1.44 kristaps 398: .Pp
399: See
400: .Sx \&BI
401: for an equivalent example.
402: .Pp
403: See also
404: .Sx \&BI ,
405: .Sx \&BR ,
406: .Sx \&RB ,
407: .Sx \&RI ,
408: and
409: .Sx \&IR .
1.39 kristaps 410: .Ss \&IP
1.44 kristaps 411: Begin an indented paragraph with the following syntax:
412: .Bd -filled -offset indent
413: .Pf \. Sx \&IP
1.130 schwarze 414: .Op Ar head Op Ar width
1.32 kristaps 415: .Ed
1.44 kristaps 416: .Pp
417: The
1.130 schwarze 418: .Ar width
1.117 schwarze 419: argument is a
420: .Xr roff 7
421: scaling width defining the left margin.
1.44 kristaps 422: It's saved for later paragraph left-margins; if unspecified, the saved or
423: default width is used.
424: .Pp
425: The
1.130 schwarze 426: .Ar head
1.68 kristaps 427: argument is used as a leading term, flushed to the left margin.
428: This is useful for bulleted paragraphs and so on.
1.44 kristaps 429: .Pp
430: See also
1.45 kristaps 431: .Sx \&HP ,
432: .Sx \&LP ,
433: .Sx \&P ,
434: .Sx \&PP ,
1.44 kristaps 435: and
1.45 kristaps 436: .Sx \&TP .
1.39 kristaps 437: .Ss \&IR
1.22 kristaps 438: Text is rendered alternately in italics and roman (the default font).
439: Whitespace between arguments is omitted in output.
1.44 kristaps 440: .Pp
441: See
442: .Sx \&BI
443: for an equivalent example.
444: .Pp
445: See also
446: .Sx \&BI ,
447: .Sx \&IB ,
448: .Sx \&BR ,
449: .Sx \&RB ,
450: and
451: .Sx \&RI .
1.39 kristaps 452: .Ss \&LP
1.68 kristaps 453: Begin an undecorated paragraph.
454: The scope of a paragraph is closed by a subsequent paragraph,
455: sub-section, section, or end of file.
1.78 schwarze 456: The saved paragraph left-margin width is reset to the default.
1.44 kristaps 457: .Pp
458: See also
1.45 kristaps 459: .Sx \&HP ,
460: .Sx \&IP ,
461: .Sx \&P ,
462: .Sx \&PP ,
1.44 kristaps 463: and
1.45 kristaps 464: .Sx \&TP .
1.113 kristaps 465: .Ss \&OP
466: Optional command-line argument.
1.114 schwarze 467: This is a non-standard GNU extension, included only for compatibility.
468: It has the following syntax:
1.113 kristaps 469: .Bd -filled -offset indent
470: .Pf \. Sx \&OP
1.130 schwarze 471: .Ar key Op Ar value
1.113 kristaps 472: .Ed
473: .Pp
474: The
1.130 schwarze 475: .Ar key
1.113 kristaps 476: is usually a command-line flag and
1.130 schwarze 477: .Ar value
1.113 kristaps 478: its argument.
1.39 kristaps 479: .Ss \&P
480: Synonym for
481: .Sx \&LP .
1.44 kristaps 482: .Pp
483: See also
1.45 kristaps 484: .Sx \&HP ,
485: .Sx \&IP ,
486: .Sx \&LP ,
487: .Sx \&PP ,
1.118 schwarze 488: and
489: .Sx \&TP .
490: .Ss \&PD
491: Specify the vertical space to be inserted before each new paragraph.
492: .br
493: The syntax is as follows:
494: .Bd -filled -offset indent
495: .Pf \. Sx \&PD
1.130 schwarze 496: .Op Ar height
1.118 schwarze 497: .Ed
498: .Pp
499: The
1.130 schwarze 500: .Ar height
1.118 schwarze 501: argument is a
502: .Xr roff 7
503: scaling width.
504: It defaults to
505: .Cm 1v .
506: If the unit is omitted,
507: .Cm v
508: is assumed.
509: .Pp
510: This macro affects the spacing before any subsequent instances of
511: .Sx \&HP ,
512: .Sx \&IP ,
513: .Sx \&LP ,
514: .Sx \&P ,
515: .Sx \&PP ,
516: .Sx \&SH ,
517: .Sx \&SS ,
1.44 kristaps 518: and
1.45 kristaps 519: .Sx \&TP .
1.39 kristaps 520: .Ss \&PP
521: Synonym for
522: .Sx \&LP .
1.44 kristaps 523: .Pp
524: See also
1.45 kristaps 525: .Sx \&HP ,
526: .Sx \&IP ,
527: .Sx \&LP ,
528: .Sx \&P ,
1.44 kristaps 529: and
1.45 kristaps 530: .Sx \&TP .
1.39 kristaps 531: .Ss \&R
1.22 kristaps 532: Text is rendered in roman (the default font).
1.44 kristaps 533: .Pp
534: See also
1.92 kristaps 535: .Sx \&I
1.44 kristaps 536: and
1.92 kristaps 537: .Sx \&B .
1.39 kristaps 538: .Ss \&RB
1.22 kristaps 539: Text is rendered alternately in roman (the default font) and bold face.
540: Whitespace between arguments is omitted in output.
1.44 kristaps 541: .Pp
542: See
543: .Sx \&BI
544: for an equivalent example.
545: .Pp
546: See also
547: .Sx \&BI ,
548: .Sx \&IB ,
549: .Sx \&BR ,
550: .Sx \&RI ,
551: and
552: .Sx \&IR .
1.39 kristaps 553: .Ss \&RE
1.30 kristaps 554: Explicitly close out the scope of a prior
1.39 kristaps 555: .Sx \&RS .
1.129 schwarze 556: The default left margin is restored to the state before that
1.102 kristaps 557: .Sx \&RS
558: invocation.
1.129 schwarze 559: .Pp
560: The syntax is as follows:
561: .Bd -filled -offset indent
562: .Pf \. Sx \&RE
563: .Op Ar level
564: .Ed
565: .Pp
566: Without an argument, the most recent
567: .Sx \&RS
568: block is closed out.
569: If
570: .Ar level
571: is 1, all open
572: .Sx \&RS
573: blocks are closed out.
574: Otherwise,
575: .Ar level No \(mi 1
576: nested
577: .Sx \&RS
578: blocks remain open.
1.39 kristaps 579: .Ss \&RI
1.22 kristaps 580: Text is rendered alternately in roman (the default font) and italics.
581: Whitespace between arguments is omitted in output.
1.44 kristaps 582: .Pp
583: See
584: .Sx \&BI
585: for an equivalent example.
586: .Pp
587: See also
588: .Sx \&BI ,
589: .Sx \&IB ,
590: .Sx \&BR ,
591: .Sx \&RB ,
592: and
593: .Sx \&IR .
1.39 kristaps 594: .Ss \&RS
1.102 kristaps 595: Temporarily reset the default left margin.
1.44 kristaps 596: This has the following syntax:
597: .Bd -filled -offset indent
1.102 kristaps 598: .Pf \. Sx \&RS
1.130 schwarze 599: .Op Ar width
1.32 kristaps 600: .Ed
1.44 kristaps 601: .Pp
602: The
1.130 schwarze 603: .Ar width
1.117 schwarze 604: argument is a
605: .Xr roff 7
606: scaling width.
1.55 kristaps 607: If not specified, the saved or default width is used.
1.102 kristaps 608: .Pp
609: See also
610: .Sx \&RE .
1.39 kristaps 611: .Ss \&SB
1.22 kristaps 612: Text is rendered in small size (one point smaller than the default font)
613: bold face.
1.39 kristaps 614: .Ss \&SH
1.68 kristaps 615: Begin a section.
616: The scope of a section is only closed by another section or the end of
617: file.
1.78 schwarze 618: The paragraph left-margin width is reset to the default.
1.39 kristaps 619: .Ss \&SM
1.22 kristaps 620: Text is rendered in small size (one point smaller than the default
621: font).
1.39 kristaps 622: .Ss \&SS
1.68 kristaps 623: Begin a sub-section.
624: The scope of a sub-section is closed by a subsequent sub-section,
625: section, or end of file.
1.78 schwarze 626: The paragraph left-margin width is reset to the default.
1.39 kristaps 627: .Ss \&TH
1.128 schwarze 628: Sets the title of the manual page for use in the page header
629: and footer with the following syntax:
1.44 kristaps 630: .Bd -filled -offset indent
631: .Pf \. Sx \&TH
1.99 schwarze 632: .Ar title section date
633: .Op Ar source Op Ar volume
1.44 kristaps 634: .Ed
1.43 kristaps 635: .Pp
1.99 schwarze 636: Conventionally, the document
637: .Ar title
638: is given in all caps.
639: The recommended
640: .Ar date
641: format is
642: .Sy YYYY-MM-DD
643: as specified in the ISO-8601 standard;
644: if the argument does not conform, it is printed verbatim.
645: If the
646: .Ar date
647: is empty or not specified, the current date is used.
648: The optional
649: .Ar source
1.68 kristaps 650: string specifies the organisation providing the utility.
1.128 schwarze 651: When unspecified,
652: .Xr mandoc 1
653: uses its
654: .Fl Ios
655: argument.
1.68 kristaps 656: The
1.99 schwarze 657: .Ar volume
1.43 kristaps 658: string replaces the default rendered volume, which is dictated by the
659: manual section.
660: .Pp
661: Examples:
1.46 kristaps 662: .Pp
1.93 kristaps 663: .Dl \&.TH CVS 5 "1992-02-12" GNU
1.39 kristaps 664: .Ss \&TP
1.25 kristaps 665: Begin a paragraph where the head, if exceeding the indentation width, is
1.24 kristaps 666: followed by a newline; if not, the body follows on the same line after a
1.68 kristaps 667: buffer to the indentation width.
668: Subsequent output lines are indented.
1.44 kristaps 669: The syntax is as follows:
670: .Bd -filled -offset indent
671: .Pf \. Sx \&TP
1.130 schwarze 672: .Op Ar width
1.32 kristaps 673: .Ed
674: .Pp
1.44 kristaps 675: The
1.130 schwarze 676: .Ar width
1.117 schwarze 677: argument is a
678: .Xr roff 7
679: scaling width.
1.44 kristaps 680: If specified, it's saved for later paragraph left-margins; if
1.27 kristaps 681: unspecified, the saved or default width is used.
1.44 kristaps 682: .Pp
683: See also
1.45 kristaps 684: .Sx \&HP ,
685: .Sx \&IP ,
686: .Sx \&LP ,
687: .Sx \&P ,
1.44 kristaps 688: and
1.45 kristaps 689: .Sx \&PP .
1.72 joerg 690: .Ss \&UC
691: Sets the volume for the footer for compatibility with man pages from
1.120 schwarze 692: .Bx
693: releases.
1.72 joerg 694: The optional first argument specifies which release it is from.
1.121 schwarze 695: .Ss \&UE
696: End a uniform resource identifier block.
697: This is a non-standard GNU extension, included only for compatibility.
698: See
699: .Sx \&UE .
700: .Ss \&UR
701: Begin a uniform resource identifier block.
702: This is a non-standard GNU extension, included only for compatibility.
703: It has the following syntax:
704: .Bd -literal -offset indent
705: .Pf \. Sx \&UR Ar uri
706: link description to be shown
707: .Pf \. Sx UE
708: .Ed
1.39 kristaps 709: .Ss \&fi
1.22 kristaps 710: End literal mode begun by
1.39 kristaps 711: .Sx \&nf .
1.79 kristaps 712: .Ss \&in
713: Indent relative to the current indentation:
714: .Pp
1.130 schwarze 715: .D1 Pf \. Sx \&in Op Ar width
1.79 kristaps 716: .Pp
717: If
1.130 schwarze 718: .Ar width
1.79 kristaps 719: is signed, the new offset is relative.
720: Otherwise, it is absolute.
721: This value is reset upon the next paragraph, section, or sub-section.
1.39 kristaps 722: .Ss \&nf
1.22 kristaps 723: Begin literal mode: all subsequent free-form lines have their end of
1.68 kristaps 724: line boundaries preserved.
725: May be ended by
1.39 kristaps 726: .Sx \&fi .
1.101 kristaps 727: Literal mode is implicitly ended by
728: .Sx \&SH
729: or
730: .Sx \&SS .
1.111 schwarze 731: .Sh MACRO SYNTAX
732: The
733: .Nm
734: macros are classified by scope: line scope or block scope.
735: Line macros are only scoped to the current line (and, in some
736: situations, the subsequent line).
737: Block macros are scoped to the current line and subsequent lines until
738: closed by another block macro.
739: .Ss Line Macros
740: Line macros are generally scoped to the current line, with the body
741: consisting of zero or more arguments.
742: If a macro is scoped to the next line and the line arguments are empty,
743: the next line, which must be text, is used instead.
744: Thus:
745: .Bd -literal -offset indent
746: \&.I
747: foo
748: .Ed
749: .Pp
750: is equivalent to
751: .Sq \&.I foo .
752: If next-line macros are invoked consecutively, only the last is used.
753: If a next-line macro is followed by a non-next-line macro, an error is
1.134 ! schwarze 754: raised.
1.111 schwarze 755: .Pp
756: The syntax is as follows:
757: .Bd -literal -offset indent
758: \&.YO \(lBbody...\(rB
759: \(lBbody...\(rB
760: .Ed
761: .Bl -column "MacroX" "ArgumentsX" "ScopeXXXXX" "CompatX" -offset indent
762: .It Em Macro Ta Em Arguments Ta Em Scope Ta Em Notes
763: .It Sx \&AT Ta <=1 Ta current Ta \&
764: .It Sx \&B Ta n Ta next-line Ta \&
765: .It Sx \&BI Ta n Ta current Ta \&
766: .It Sx \&BR Ta n Ta current Ta \&
767: .It Sx \&DT Ta 0 Ta current Ta \&
1.121 schwarze 768: .It Sx \&EE Ta 0 Ta current Ta compat
769: .It Sx \&EX Ta 0 Ta current Ta compat
1.111 schwarze 770: .It Sx \&I Ta n Ta next-line Ta \&
771: .It Sx \&IB Ta n Ta current Ta \&
772: .It Sx \&IR Ta n Ta current Ta \&
1.113 kristaps 773: .It Sx \&OP Ta 0, 1 Ta current Ta compat
1.121 schwarze 774: .It Sx \&PD Ta 1 Ta current Ta \&
1.111 schwarze 775: .It Sx \&R Ta n Ta next-line Ta \&
776: .It Sx \&RB Ta n Ta current Ta \&
777: .It Sx \&RI Ta n Ta current Ta \&
778: .It Sx \&SB Ta n Ta next-line Ta \&
779: .It Sx \&SM Ta n Ta next-line Ta \&
780: .It Sx \&TH Ta >1, <6 Ta current Ta \&
781: .It Sx \&UC Ta <=1 Ta current Ta \&
782: .It Sx \&fi Ta 0 Ta current Ta compat
783: .It Sx \&in Ta 1 Ta current Ta compat
784: .It Sx \&nf Ta 0 Ta current Ta compat
785: .El
786: .Pp
787: Macros marked as
788: .Qq compat
789: are included for compatibility with the significant corpus of existing
790: manuals that mix dialects of roff.
791: These macros should not be used for portable
792: .Nm
793: manuals.
794: .Ss Block Macros
795: Block macros comprise a head and body.
796: As with in-line macros, the head is scoped to the current line and, in
797: one circumstance, the next line (the next-line stipulations as in
798: .Sx Line Macros
799: apply here as well).
800: .Pp
801: The syntax is as follows:
802: .Bd -literal -offset indent
803: \&.YO \(lBhead...\(rB
804: \(lBhead...\(rB
805: \(lBbody...\(rB
806: .Ed
807: .Pp
808: The closure of body scope may be to the section, where a macro is closed
809: by
810: .Sx \&SH ;
811: sub-section, closed by a section or
812: .Sx \&SS ;
813: part, closed by a section, sub-section, or
814: .Sx \&RE ;
815: or paragraph, closed by a section, sub-section, part,
816: .Sx \&HP ,
817: .Sx \&IP ,
818: .Sx \&LP ,
819: .Sx \&P ,
820: .Sx \&PP ,
821: or
822: .Sx \&TP .
823: No closure refers to an explicit block closing macro.
824: .Pp
825: As a rule, block macros may not be nested; thus, calling a block macro
826: while another block macro scope is open, and the open scope is not
827: implicitly closed, is syntactically incorrect.
828: .Bl -column "MacroX" "ArgumentsX" "Head ScopeX" "sub-sectionX" "compatX" -offset indent
829: .It Em Macro Ta Em Arguments Ta Em Head Scope Ta Em Body Scope Ta Em Notes
830: .It Sx \&HP Ta <2 Ta current Ta paragraph Ta \&
831: .It Sx \&IP Ta <3 Ta current Ta paragraph Ta \&
832: .It Sx \&LP Ta 0 Ta current Ta paragraph Ta \&
833: .It Sx \&P Ta 0 Ta current Ta paragraph Ta \&
834: .It Sx \&PP Ta 0 Ta current Ta paragraph Ta \&
835: .It Sx \&RE Ta 0 Ta current Ta none Ta compat
836: .It Sx \&RS Ta 1 Ta current Ta part Ta compat
837: .It Sx \&SH Ta >0 Ta next-line Ta section Ta \&
838: .It Sx \&SS Ta >0 Ta next-line Ta sub-section Ta \&
839: .It Sx \&TP Ta n Ta next-line Ta paragraph Ta \&
1.121 schwarze 840: .It Sx \&UE Ta 0 Ta current Ta none Ta compat
841: .It Sx \&UR Ta 1 Ta current Ta part Ta compat
1.111 schwarze 842: .El
843: .Pp
844: Macros marked
845: .Qq compat
846: are as mentioned in
847: .Sx Line Macros .
848: .Pp
849: If a block macro is next-line scoped, it may only be followed by in-line
850: macros for decorating text.
851: .Ss Font handling
852: In
853: .Nm
854: documents, both
855: .Sx Physical markup
856: macros and
857: .Xr roff 7
858: .Ql \ef
859: font escape sequences can be used to choose fonts.
860: In text lines, the effect of manual font selection by escape sequences
861: only lasts until the next macro invocation; in macro lines, it only lasts
862: until the end of the macro scope.
863: Note that macros like
864: .Sx \&BR
865: open and close a font scope for each argument.
1.1 kristaps 866: .Sh SEE ALSO
1.89 schwarze 867: .Xr man 1 ,
1.32 kristaps 868: .Xr mandoc 1 ,
1.98 kristaps 869: .Xr eqn 7 ,
1.89 schwarze 870: .Xr mandoc_char 7 ,
1.94 kristaps 871: .Xr mdoc 7 ,
872: .Xr roff 7 ,
873: .Xr tbl 7
1.78 schwarze 874: .Sh HISTORY
875: The
876: .Nm
877: language first appeared as a macro package for the roff typesetting
878: system in
879: .At v7 .
880: It was later rewritten by James Clark as a macro package for groff.
1.113 kristaps 881: Eric S. Raymond wrote the extended
882: .Nm
883: macros for groff in 2007.
1.78 schwarze 884: The stand-alone implementation that is part of the
885: .Xr mandoc 1
886: utility written by Kristaps Dzonsons appeared in
1.80 kristaps 887: .Ox 4.6 .
1.1 kristaps 888: .Sh AUTHORS
1.78 schwarze 889: This
1.32 kristaps 890: .Nm
1.23 kristaps 891: reference was written by
1.119 schwarze 892: .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
1.1 kristaps 893: .Sh CAVEATS
1.68 kristaps 894: Do not use this language.
895: Use
1.32 kristaps 896: .Xr mdoc 7 ,
1.1 kristaps 897: instead.
CVSweb