diff options
-rw-r--r-- | share/man/man7/Makefile | 4 | ||||
-rw-r--r-- | share/man/man7/eqn.7 | 279 | ||||
-rw-r--r-- | share/man/man7/man.7 | 270 | ||||
-rw-r--r-- | share/man/man7/mandoc_char.7 | 10 | ||||
-rw-r--r-- | share/man/man7/mdoc.7 | 293 | ||||
-rw-r--r-- | share/man/man7/roff.7 | 41 | ||||
-rw-r--r-- | share/man/man7/tbl.7 | 26 |
7 files changed, 694 insertions, 229 deletions
diff --git a/share/man/man7/Makefile b/share/man/man7/Makefile index f90041e2036..fea8dfde683 100644 --- a/share/man/man7/Makefile +++ b/share/man/man7/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.19 2011/09/17 08:38:26 schwarze Exp $ +# $OpenBSD: Makefile,v 1.20 2011/09/18 10:38:57 schwarze Exp $ # $NetBSD: Makefile,v 1.6 1994/12/22 10:50:05 cgd Exp $ # missing: term.7 -MAN= ascii.7 environ.7 glob.7 hier.7 hostname.7 intro.7 kgdb.7 \ +MAN= ascii.7 eqn.7 environ.7 glob.7 hier.7 hostname.7 intro.7 kgdb.7 \ library-specs.7 mailaddr.7 \ man.7 mandoc_char.7 mdoc.7 mirroring-ports.7 \ operator.7 packages.7 packages-specs.7 ports.7 roff.7 \ diff --git a/share/man/man7/eqn.7 b/share/man/man7/eqn.7 new file mode 100644 index 00000000000..43309ef8f47 --- /dev/null +++ b/share/man/man7/eqn.7 @@ -0,0 +1,279 @@ +.\" $OpenBSD: eqn.7,v 1.1 2011/09/18 10:38:57 schwarze Exp $ +.\" +.\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: September 18 2011 $ +.Dt EQN 7 +.Os +.Sh NAME +.Nm eqn +.Nd eqn language reference for mandoc +.Sh DESCRIPTION +The +.Nm eqn +language is a equation-formatting language. +It is used within +.Xr mdoc 7 +and +.Xr man 7 +.Ux +manual pages. +It describes the +.Em structure +of an equation, not its mathematical meaning. +This manual describes the +.Nm +language accepted by the +.Xr mandoc 1 +utility, which correspond to the Second Edition eqn specification (see +.Sx SEE ALSO +for references). +.Pp +Equations within +.Xr mdoc 7 +or +.Xr man 7 +documents are enclosed by the standalone +.Sq \&.EQ +and +.Sq \&.EN +tags. +Equations are multi-line blocks consisting of formulas and control +statements. +.Sh EQUATION STRUCTURE +Each equation is bracketed by +.Sq \&.EQ +and +.Sq \&.EN +strings. +.Em Note : +these are not the same as +.Xr roff 7 +macros, and may only be invoked as +.Sq \&.EQ . +.Pp +The equation grammar is as follows, where quoted strings are +case-sensitive literals in the input: +.Bd -literal -offset indent +eqn : box | eqn box +box : text + | \*q{\*q eqn \*q}\*q + | \*qdefine\*q text text + | \*qndefine\*q text text + | \*qtdefine\*q text text + | \*qgfont\*q text + | \*qgsize\*q text + | \*qset\*q text text + | \*qundef\*q text + | box pos box + | box mark + | \*qmatrix\*q \*q{\*q [col \*q{\*q list \*q}\*q ]* + | pile \*q{\*q list \*q}\*q + | font box + | \*qsize\*q text box + | \*qleft\*q text eqn [\*qright\*q text] +col : \*qlcol\*q | \*qrcol\*q | \*qccol\*q | \*qcol\*q +text : [^space\e\*q]+ | \e\*q.*\e\*q +pile : \*qlpile\*q | \*qcpile\*q | \*qrpile\*q | \*qpile\*q +pos : \*qover\*q | \*qsup\*q | \*qsub\*q | \*qto\*q | \*qfrom\*q +mark : \*qdot\*q | \*qdotdot\*q | \*qhat\*q | \*qtilde\*q | \*qvec\*q + | \*qdyad\*q | \*qbar\*q | \*qunder\*q +font : \*qroman\*q | \*qitalic\*q | \*qbold\*q | \*qfat\*q +list : eqn + | list \*qabove\*q eqn +space : [\e^~ \et] +.Ed +.Pp +White-space consists of the space, tab, circumflex, and tilde +characters. +If within a quoted string, these space characters are retained. +Quoted strings are also not scanned for replacement definitions. +.Pp +The following text terms are translated into a rendered glyph, if +available: alpha, beta, chi, delta, epsilon, eta, gamma, iota, kappa, +lambda, mu, nu, omega, omicron, phi, pi, psi, rho, sigma, tau, theta, +upsilon, xi, zeta, DELTA, GAMMA, LAMBDA, OMEGA, PHI, PI, PSI, SIGMA, +THETA, UPSILON, XI, inter (intersection), union (union), prod (product), +int (integral), sum (summation), grad (gradient), del (vector +differential), times (multiply), cdot (centre-dot), nothing (zero-width +space), approx (approximately equals), prime (prime), half (one-half), +partial (partial differential), inf (infinity), >> (much greater), << +(much less), \-> (left arrow), <\- (right arrow), += (plus-minus), != +(not equal), == (equivalence), <= (less-than-equal), and >= +(more-than-equal). +.Pp +The following control statements are available: +.Bl -tag -width Ds +.It Cm define +Replace all occurrences of a key with a value. +Its syntax is as follows: +.Pp +.D1 define Ar key cvalc +.Pp +The first character of the value string, +.Ar c , +is used as the delimiter for the value +.Ar val . +This allows for arbitrary enclosure of terms (not just quotes), such as +.Pp +.D1 define Ar foo 'bar baz' +.D1 define Ar foo cbar bazc +.Pp +It is an error to have an empty +.Ar key or +.Ar val . +Note that a quoted +.Ar key +causes errors in some +.Nm +implementations and should not be considered portable. +It is not expanded for replacements. +Definitions may refer to other definitions; these are evaluated +recursively when text replacement occurs and not when the definition is +created. +.Pp +Definitions can create arbitrary strings, for example, the following is +a legal construction. +.Bd -literal -offset indent +define foo 'define' +foo bar 'baz' +.Ed +.Pp +Self-referencing definitions will raise an error. +The +.Cm ndefine +statement is a synonym for +.Cm define , +while +.Cm tdefine +is discarded. +.It Cm gfont +Set the default font of subsequent output. +Its syntax is as follows: +.Pp +.D1 gfont Ar font +.Pp +In mandoc, this value is discarded. +.It Cm gsize +Set the default size of subsequent output. +Its syntax is as follows: +.Pp +.D1 gsize Ar size +.Pp +The +.Ar size +value should be an integer. +.It Cm set +Set an equation mode. +In mandoc, both arguments are thrown away. +Its syntax is as follows: +.Pp +.D1 set Ar key val +.Pp +The +.Ar key +and +.Ar val +are not expanded for replacements. +This statement is a GNU extension. +.It Cm undef +Unset a previously-defined key. +Its syntax is as follows: +.Pp +.D1 define Ar key +.Pp +Once invoked, the definition for +.Ar key +is discarded. +The +.Ar key +is not expanded for replacements. +This statement is a GNU extension. +.El +.Sh COMPATIBILITY +This section documents the compatibility of mandoc +.Nm +and the troff +.Nm +implementation (including GNU troff). +.Pp +.Bl -dash -compact +.It +The text string +.Sq \e\*q +is interpreted as a literal quote in troff. +In mandoc, this is interpreted as a comment. +.It +In troff, The circumflex and tilde white-space symbols map to +fixed-width spaces. +In mandoc, these characters are synonyms for the space character. +.It +The troff implementation of +.Nm +allows for equation alignment with the +.Cm mark +and +.Cm lineup +tokens. +mandoc discards these tokens. +The +.Cm back Ar n , +.Cm fwd Ar n , +.Cm up Ar n , +and +.Cm down Ar n +commands are also ignored. +.El +.Sh SEE ALSO +.Xr mandoc 1 , +.Xr man 7 , +.Xr mandoc_char 7 , +.Xr mdoc 7 , +.Xr roff 7 +.Rs +.%A Brian W. Kernighan +.%A Lorinda L. Cherry +.%T System for Typesetting Mathematics +.%J Communications of the ACM +.%V 18 +.%P 151\(en157 +.%D March, 1975 +.Re +.Rs +.%A Brian W. Kernighan +.%A Lorinda L. Cherry +.%T Typesetting Mathematics, User's Guide +.%D 1976 +.Re +.Rs +.%A Brian W. Kernighan +.%A Lorinda L. Cherry +.%T Typesetting Mathematics, User's Guide (Second Edition) +.%D 1978 +.Re +.Sh HISTORY +The eqn utility, a preprocessor for troff, was originally written by +Brian W. Kernighan and Lorinda L. Cherry in 1975. +The GNU reimplementation of eqn, part of the GNU troff package, was +released in 1989 by James Clark. +The eqn component of +.Xr mandoc 1 +was added in 2011. +.Sh AUTHORS +This +.Nm +reference was written by +.An Kristaps Dzonsons , +.Mt kristaps@bsd.lv . diff --git a/share/man/man7/man.7 b/share/man/man7/man.7 index b2d921f4962..b4245f2bef3 100644 --- a/share/man/man7/man.7 +++ b/share/man/man7/man.7 @@ -1,4 +1,4 @@ -.\" $OpenBSD: man.7,v 1.21 2011/08/30 12:25:09 jmc Exp $ +.\" $OpenBSD: man.7,v 1.22 2011/09/18 10:38:57 schwarze Exp $ .\" .\" Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: August 30 2011 $ +.Dd $Mdocdate: September 18 2011 $ .Dt MAN 7 .Os .Sh NAME @@ -39,38 +39,51 @@ language, instead. .Pp A .Nm -document follows simple rules: lines beginning with the control +document follows simple rules: lines beginning with the control character .Sq \&. are parsed for macros. -Other lines are interpreted within the scope of -prior macros: +Lines not beginning with the control character are +interpreted within the scope of prior macros: .Bd -literal -offset indent \&.SH Macro lines change control state. -Other lines are interpreted within the current state. +Text lines are interpreted within the current state. .Ed -.Sh INPUT ENCODING +.Sh LANGUAGE SYNTAX .Nm documents may contain only graphable 7-bit ASCII characters, the space character, and the tab character. -.Pp -Blank lines are acceptable; where found, the output will assert a -vertical space. -.Pp -If the first character of a line is a space, that line is printed -with a leading newline. +The back-space character +.Sq \e +indicates the start of an escape sequence for +.Sx Comments , +.Sx Predefined Strings , +and +.Sx Special Characters . .Ss Comments -Text following a -.Sq \e\*q , -whether in a macro or free-form text line, is ignored to the end of +Text following an escaped double-quote +.Sq \e\(dq , +whether in a macro or text line, is ignored to the end of line. -A macro line with only a control character and comment escape, -.Sq \&.\e\*q , +A macro line beginning with a control character and comment escape +.Sq \&.\e\(dq is also ignored. -Macro lines with only a control character and optionally whitespace are +Furthermore, +macro lines with only a control character and optional trailing +whitespace are stripped from input. +.Pp +Examples: +.Bd -literal -offset indent -compact +\&.\e\(dq This is a comment line. +\&.\e\(dq The next line is ignored: +\&. +\&.Em Emphasis \e\(dq This is also a comment. +.Ed .Ss Special Characters -Special characters may occur in both macro and free-form lines. +Special characters are used to encode special glyphs and are rendered +differently across output media. +They may occur in both macro and text lines. Sequences begin with the escape character .Sq \e followed by either an open-parenthesis @@ -79,25 +92,25 @@ for two-character sequences; an open-bracket .Sq \&[ for n-character sequences (terminated at a close-bracket .Sq \&] ) ; -or a single one-character sequence. +or a single one character sequence. +.Pp +Examples: +.Bl -tag -width Ds -offset indent -compact +.It Li \e(em +Two-letter em dash escape. +.It Li \ee +One-letter backslash escape. +.El +.Pp See .Xr mandoc_char 7 for a complete list. -Examples include -.Sq \e(em -.Pq em-dash -and -.Sq \ee -.Pq back-slash . .Ss Text Decoration Terms may be text-decorated using the .Sq \ef -escape followed by an indicator: B (bold), I (italic), R (Roman), or P -(revert to previous mode): -.Pp -.D1 \efBbold\efR \efIitalic\efP -.Pp -A numerical representation 3, 2, or 1 (bold, italic, and Roman, +escape followed by an indicator: B (bold), I (italic), R (regular), or P +(revert to previous mode). +A numerical representation 3, 2, or 1 (bold, italic, and regular, respectively) may be used instead. A text decoration is only valid, if specified in free-form text, until the next macro invocation; if specified within a macro, it's only valid @@ -109,26 +122,96 @@ open and close a font scope with each argument. The .Sq \ef attribute is forgotten when entering or exiting a macro block. +.Pp +Examples: +.Bl -tag -width Ds -offset indent -compact +.It Li \efBbold\efR +Write in bold, then switch to regular font mode. +.It Li \efIitalic\efP +Write in italic, then return to previous font mode. +.El +.Ss Predefined Strings +Predefined strings, like +.Sx Special Characters , +mark special output glyphs. +Predefined strings are escaped with the slash-asterisk, +.Sq \e* : +single-character +.Sq \e*X , +two-character +.Sq \e*(XX , +and N-character +.Sq \e*[N] . +.Pp +Examples: +.Bl -tag -width Ds -offset indent -compact +.It Li \e*(Am +Two-letter ampersand predefined string. +.It Li \e*q +One-letter double-quote predefined string. +.El +.Pp +These strings are set using +.Xr roff 7 , +although +.Nm +consists of several pre-set escapes listed in +.Xr mandoc_char 7 . .Ss Whitespace Whitespace consists of the space character. -In free-form lines, whitespace is preserved within a line; unescaped -trailing spaces are stripped from input (unless in a literal context). -Blank free-form lines, which may include spaces, are permitted and -rendered as an empty line. -.Pp +In text lines, whitespace is preserved within a line. In macro lines, whitespace delimits arguments and is discarded. -If arguments are quoted, whitespace within the quotes is retained. -.Ss Scaling Widths -Many macros support scaled widths for their arguments, such as -stipulating a two-inch paragraph indentation with the following: -.Bd -literal -offset indent -\&.HP 2i -.Ed .Pp -The syntax for scaled widths is -.Sq Li [+-]?[0-9]*.[0-9]*[:unit:]? , +Unescaped trailing spaces are stripped from text line input unless in a +literal context. +In general, trailing whitespace on any input line is discouraged for +reasons of portability. +In the rare case that a blank character is needed at the end of an +input line, it may be forced by +.Sq \e\ \e& . +.Pp +In general, space characters can be rendered as literal +characters by using non-breaking space escapes or +.Sx Quotation . +If the first character of a text line is a space, that line is printed +with a leading newline. +.Ss Quotation +Macro arguments may be quoted with double-quotes to so that the +enclosed text is one literal term. +Quoted text, even if whitespace or if it would cause a macro invocation +when unquoted, is considered literal text. +.Pp +A quoted argument begins with a double-quote preceded by whitespace. +The next double-quote not pairwise adjacent to another double-quote +terminates the literal, regardless of surrounding whitespace. +.Pp +Examples: +.Bl -tag -width Ds -offset indent -compact +.It Li .BR a \(dqb c\(dq d +Group arguments +.Qq b c +into one un-bolded argument. +If unspecified, +.Qq a +and +.Qq c +will be in bold, +.Qq b +and +.Qq d +in regular font mode. +Furthermore, will be preserved between +.Qq b +and +.Qq c . +.El +.Ss Scaling Widths +Many macros support scaled widths for their arguments. +The syntax for a scaled width is +.Sq Li [+-]?[0-9]*.[0-9]*[:unit:] , where a decimal must be preceded or proceeded by at least one digit. Negative numbers, while accepted, are truncated to zero. +.Pp The following scaling units are accepted: .Pp .Bl -tag -width Ds -offset indent -compact @@ -168,6 +251,8 @@ Using anything other than or .Sq v is necessarily non-portable across output media. +See +.Sx COMPATIBILITY . .Pp If a scaling unit is not provided, the numerical value is interpreted under the default rules of @@ -175,15 +260,19 @@ under the default rules of for vertical spaces and .Sq u for horizontal ones. -.Em Note : -this differs from -.Xr mdoc 7 , -which, if a unit is not provided, will instead interpret the string as -literal text. +.Pp +Examples: +.Bl -tag -width Ds -offset indent -compact +.It \&.HP 2i +two-inch tagged list indentation +.Pq see Sx \&HP +.It \&.sp 2v +two vertical spaces +.Pq see Sx \&sp +.El .Ss Sentence Spacing -When composing a manual, make sure that sentences end at the end of -a line. -By doing so, front-ends will be able to apply the proper amount of +Sentences should terminate at the end of an input line. +By doing this, a formatter will be able to apply the proper amount of spacing after the end of sentence (unescaped) period, exclamation mark, or question mark followed by zero or more non-sentence closing delimiters @@ -193,6 +282,13 @@ delimiters .Sq \&' , .Sq \&" .Pc . +.Pp +Examples: +.Bd -literal -offset indent -compact +Do not end sentences mid-line like this. Instead, +end a sentence like this. +A new sentence gets a new line. +.Ed .Sh MANUAL STRUCTURE Each .Nm @@ -214,36 +310,36 @@ file for a utility \&.TH PROGNAME 1 2009-10-10 \&.SH NAME \efBprogname\efR \e(en a description goes here -\&.\e\*q .SH LIBRARY -\&.\e\*q For sections 2 & 3 only. -\&.\e\*q Not used in OpenBSD. +\&.\e\(dq .SH LIBRARY +\&.\e\(dq For sections 2 & 3 only. +\&.\e\(dq Not used in OpenBSD. \&.SH SYNOPSIS \efBprogname\efR [\efB\e-options\efR] arguments... \&.SH DESCRIPTION The \efBfoo\efR utility processes files... -\&.\e\*q .SH IMPLEMENTATION NOTES -\&.\e\*q Not used in OpenBSD. -\&.\e\*q .SH RETURN VALUES -\&.\e\*q For sections 2, 3, & 9 only. -\&.\e\*q .SH ENVIRONMENT -\&.\e\*q For sections 1, 6, 7, & 8 only. -\&.\e\*q .SH FILES -\&.\e\*q .SH EXIT STATUS -\&.\e\*q For sections 1, 6, & 8 only. -\&.\e\*q .SH EXAMPLES -\&.\e\*q .SH DIAGNOSTICS -\&.\e\*q For sections 1, 4, 6, 7, & 8 only. -\&.\e\*q .SH ERRORS -\&.\e\*q For sections 2, 3, & 9 only. -\&.\e\*q .SH SEE ALSO -\&.\e\*q .BR foo ( 1 ) -\&.\e\*q .SH STANDARDS -\&.\e\*q .SH HISTORY -\&.\e\*q .SH AUTHORS -\&.\e\*q .SH CAVEATS -\&.\e\*q .SH BUGS -\&.\e\*q .SH SECURITY CONSIDERATIONS -\&.\e\*q Not used in OpenBSD. +\&.\e\(dq .SH IMPLEMENTATION NOTES +\&.\e\(dq Not used in OpenBSD. +\&.\e\(dq .SH RETURN VALUES +\&.\e\(dq For sections 2, 3, & 9 only. +\&.\e\(dq .SH ENVIRONMENT +\&.\e\(dq For sections 1, 6, 7, & 8 only. +\&.\e\(dq .SH FILES +\&.\e\(dq .SH EXIT STATUS +\&.\e\(dq For sections 1, 6, & 8 only. +\&.\e\(dq .SH EXAMPLES +\&.\e\(dq .SH DIAGNOSTICS +\&.\e\(dq For sections 1, 4, 6, 7, & 8 only. +\&.\e\(dq .SH ERRORS +\&.\e\(dq For sections 2, 3, & 9 only. +\&.\e\(dq .SH SEE ALSO +\&.\e\(dq .BR foo ( 1 ) +\&.\e\(dq .SH STANDARDS +\&.\e\(dq .SH HISTORY +\&.\e\(dq .SH AUTHORS +\&.\e\(dq .SH CAVEATS +\&.\e\(dq .SH BUGS +\&.\e\(dq .SH SECURITY CONSIDERATIONS +\&.\e\(dq Not used in OpenBSD. .Ed .Pp The sections in a @@ -866,6 +962,14 @@ language. .Pp .Bl -dash -compact .It +Do not depend on +.Sx \&SH +or +.Sx \&SS +to close out a literal context opened with +.Sx \&nf . +This behaviour may not be portable. +.It In quoted literals, GNU troff allowed pair-wise double-quotes to produce a standalone double-quote in formatted output. It is not known whether this behaviour is exhibited by other formatters. @@ -910,6 +1014,7 @@ In GNU troff, this would result in strange behaviour. .Sh SEE ALSO .Xr man 1 , .Xr mandoc 1 , +.Xr eqn 7 , .Xr mandoc_char 7 , .Xr mdoc 7 , .Xr roff 7 , @@ -929,7 +1034,8 @@ utility written by Kristaps Dzonsons appeared in This .Nm reference was written by -.An Kristaps Dzonsons Aq kristaps@bsd.lv . +.An Kristaps Dzonsons , +.Mt kristaps@bsd.lv . .Sh CAVEATS Do not use this language. Use diff --git a/share/man/man7/mandoc_char.7 b/share/man/man7/mandoc_char.7 index b9c885dff91..84cd3a8168a 100644 --- a/share/man/man7/mandoc_char.7 +++ b/share/man/man7/mandoc_char.7 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mandoc_char.7,v 1.11 2011/08/30 12:25:09 jmc Exp $ +.\" $OpenBSD: mandoc_char.7,v 1.12 2011/09/18 10:38:57 schwarze Exp $ .\" .\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@bsd.lv> .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: August 30 2011 $ +.Dd $Mdocdate: September 18 2011 $ .Dt MANDOC_CHAR 7 .Os .Sh NAME @@ -288,6 +288,9 @@ Mathematical: .It \e(Re Ta \(Re Ta real .It \e(pd Ta \(pd Ta partial differential .It \e(-h Ta \(-h Ta Planck constant over 2\(*p +.It \e[12] Ta \[12] Ta one-half +.It \e[14] Ta \[14] Ta one-fourth +.It \e[34] Ta \[34] Ta three-fourths .El .Pp Ligatures: @@ -586,7 +589,8 @@ known representation. The .Nm manual page was written by -.An Kristaps Dzonsons Aq kristaps@bsd.lv . +.An Kristaps Dzonsons , +.Mt kristaps@bsd.lv . .Sh CAVEATS The .Sq \e*(Ba diff --git a/share/man/man7/mdoc.7 b/share/man/man7/mdoc.7 index 563414cf3f0..959a654db13 100644 --- a/share/man/man7/mdoc.7 +++ b/share/man/man7/mdoc.7 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mdoc.7,v 1.84 2011/09/17 21:09:54 schwarze Exp $ +.\" $OpenBSD: mdoc.7,v 1.85 2011/09/18 10:38:57 schwarze Exp $ .\" .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: September 17 2011 $ +.Dd $Mdocdate: September 18 2011 $ .Dt MDOC 7 .Os .Sh NAME @@ -30,11 +30,13 @@ language is used to format manuals. This reference document describes its syntax, structure, and usage. -The reference implementation is +The reference implementation for +.Nm +formatting is .Xr mandoc 1 ; the .Sx COMPATIBILITY -section describes compatibility with other troff \-mdoc implementations. +section describes compatibility with other implementations. .Pp An .Nm @@ -42,7 +44,7 @@ document follows simple rules: lines beginning with the control character .Sq \&. are parsed for macros. -Text lines, those not beginning with the control character, are +Lines not beginning with the control character are interpreted within the scope of prior macros: .Bd -literal -offset indent \&.Sh Macro lines change control state. @@ -52,21 +54,37 @@ Text lines are interpreted within the current state. .Nm documents may contain only graphable 7-bit ASCII characters, the space character, and, in certain circumstances, the tab character. -.Pp -If the first character of a text line is a space, that line is printed -with a leading newline. +The back-space character +.Sq \e +indicates the start of an escape sequence for +.Sx Comments , +.Sx Predefined Strings , +and +.Sx Special Characters . .Ss Comments -Text following a -.Sq \e\*q , +Text following an escaped double-quote +.Sq \e\(dq , whether in a macro or text line, is ignored to the end of line. -A macro line with only a control character and comment escape, -.Sq \&.\e\*q , +A macro line beginning with a control character and comment escape +.Sq \&.\e\(dq is also ignored. -Macro lines with only a control character and optional whitespace are +Furthermore, +macro lines with only a control character and optional trailing +whitespace are stripped from input. +.Pp +Examples: +.Bd -literal -offset indent -compact +\&.\e\(dq This is a comment line. +\&.\e\(dq The next line is ignored: +\&. +\&.Em Emphasis \e\(dq This is also a comment. +.Ed .Ss Special Characters -Special characters may occur in both macro and text lines. +Special characters are used to encode special glyphs and are rendered +differently across output media. +They may occur in both macro and text lines. Sequences begin with the escape character .Sq \e followed by either an open-parenthesis @@ -76,24 +94,24 @@ for two-character sequences; an open-bracket for n-character sequences (terminated at a close-bracket .Sq \&] ) ; or a single one character sequence. +.Pp +Examples: +.Bl -tag -width Ds -offset indent -compact +.It Li \e(em +Two-letter em dash escape. +.It Li \ee +One-letter backslash escape. +.El +.Pp See .Xr mandoc_char 7 for a complete list. -Examples include -.Sq \e(em -.Pq em-dash -and -.Sq \ee -.Pq back-slash . .Ss Text Decoration Terms may be text-decorated using the .Sq \ef -escape followed by an indicator: B (bold), I (italic), R (Roman), or P -(revert to previous mode): -.Pp -.Dl \efBbold\efR \efIitalic\efP -.Pp -A numerical representation 3, 2, or 1 (bold, italic, and Roman, +escape followed by an indicator: B (bold), I (italic), R (regular), or P +(revert to previous mode). +A numerical representation 3, 2, or 1 (bold, italic, and regular, respectively) may be used instead. If a macro opens a font scope after calling .Sq \ef , @@ -105,19 +123,23 @@ mode will be restored upon exiting the .Sx \&Bf scope. .Pp -Note this form is +Examples: +.Bl -tag -width Ds -offset indent -compact +.It Li \efBbold\efR +Write in bold, then switch to regular font mode. +.It Li \efIitalic\efP +Write in italic, then return to previous font mode. +.El +.Pp +Text decoration is .Em not recommended for .Nm , which encourages semantic annotation. .Ss Predefined Strings -Historically, -troff -also defined a set of package-specific -.Dq predefined strings , -which, like +Predefined strings, like .Sx Special Characters , -mark special output characters and strings by way of input codes. +mark special output glyphs. Predefined strings are escaped with the slash-asterisk, .Sq \e* : single-character @@ -126,74 +148,78 @@ two-character .Sq \e*(XX , and N-character .Sq \e*[N] . -See -.Xr mandoc_char 7 -for a complete list. -Examples include -.Sq \e*(Am -.Pq ampersand -and -.Sq \e*(Ba -.Pq vertical bar . +.Pp +Examples: +.Bl -tag -width Ds -offset indent -compact +.It Li \e*(Am +Two-letter ampersand predefined string. +.It Li \e*q +One-letter double-quote predefined string. +.El +.Pp +These strings are set using +.Xr roff 7 , +although +.Nm +consists of several pre-set escapes listed in +.Xr mandoc_char 7 . .Ss Whitespace Whitespace consists of the space character. -In text lines, whitespace is preserved within a line; unescaped -trailing spaces are stripped from input (unless in a literal context). -Blank text lines, which may include whitespace, are only permitted -within literal contexts. +In text lines, whitespace is preserved within a line. +In macro lines, whitespace delimits arguments and is discarded. .Pp -In general, trailing whitespace on input lines is discouraged -for reasons of clarity and portability. +Unescaped trailing spaces are stripped from text line input unless in a +literal context. +In general, trailing whitespace on any input line is discouraged for +reasons of portability. In the rare case that a blank character is needed at the end of an input line, it may be forced by .Sq \e\ \e& . .Pp -In macro lines, whitespace delimits arguments and is discarded. -.Ss Quotation -Macro arguments may be quoted with double-quotes; in this case, -whitespace within the quotes is retained as part of the argument. -For example, -.Pp -.D1 Pf \. \&Fn strlen "\(dqconst char *s\(dq" +In general, space characters can be rendered as literal +characters by using non-breaking space escapes or +.Sx Quotation . .Pp -renders as -.Sq Fn strlen "const char *s" , -while -.Pp -.D1 Pf \. \&Fn strlen "const char *s" -.Pp -would produce -.Sq Fn strlen const char *s . +Blank text lines, which may include whitespace, are only permitted +within literal contexts. +If the first character of a text line is a space, that line is printed +with a leading newline. +.Ss Quotation +Macro arguments may be quoted with double-quotes to so that the +enclosed text is one literal term. +Quoted text, even if whitespace or if it would cause a macro invocation +when unquoted, is considered literal text. .Pp A quoted argument begins with a double-quote preceded by whitespace. The next double-quote not pairwise adjacent to another double-quote terminates the literal, regardless of surrounding whitespace. .Pp -In unquoted arguments, space characters can alternatively be included -by preceding them with a backslash -.Pq Sq \e\~ , -but quoting is usually better for clarity. -.Pp -Note that any quoted text, even if it would cause a macro invocation -when unquoted, is considered literal text. -Thus, the following produces -.Sq Op "Fl a" : -.Bd -literal -offset indent -\&.Op "Fl a" -.Ed -.Pp -In text lines, quotes are regarded as opaque text. +Examples: +.Bl -tag -width Ds -offset indent -compact +.It Li .Fn strlen \(dqconst char *s\(dq +Group arguments +.Qq const char *s +into one function argument. +If unspecified, +.Qq const , +.Qq char , +and +.Qq *s +would be considered separate arguments. +.Pq See Sx \&Fn . +.It Li .Op \(dqFl a\(dq +Consider +.Qq \&Fl a +as literal text instead of a flag macro. +.Pq Aee Sx \&Op , \&Fl . +.El .Ss Scaling Widths -Many macros support scaled widths for their arguments, such as -stipulating a two-inch list indentation with the following: -.Bd -literal -offset indent -\&.Bl -tag -width 2i -.Ed -.Pp -The syntax for scaled widths is +Many macros support scaled widths for their arguments. +The syntax for a scaled width is .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] , where a decimal must be preceded or proceeded by at least one digit. Negative numbers, while accepted, are truncated to zero. +.Pp The following scaling units are accepted: .Pp .Bl -tag -width Ds -offset indent -compact @@ -235,10 +261,19 @@ or is necessarily non-portable across output media. See .Sx COMPATIBILITY . +.Pp +Examples: +.Bl -tag -width Ds -offset indent -compact +.It Li \&.Bl -tag -width 2i +two-inch tagged list indentation +.Pq see Sx \&Bl +.It Li \&.sp 2v +two vertical spaces +.Pq see Sx \&sp +.El .Ss Sentence Spacing -When composing a manual, make sure that sentences end at the end of -a line. -By doing so, front-ends will be able to apply the proper amount of +Sentences should terminate at the end of an input line. +By doing this, a formatter will be able to apply the proper amount of spacing after the end of sentence (unescaped) period, exclamation mark, or question mark followed by zero or more non-sentence closing delimiters @@ -251,10 +286,14 @@ delimiters .Pp The proper spacing is also intelligently preserved if a sentence ends at the boundary of a macro line. -For example: .Pp -.Dl \&.Xr mandoc 1 \&. -.Dl \&.Fl T \&Ns \&Cm ascii \&. +Examples: +.Bd -literal -offset indent -compact +Do not end sentences mid-line like this. Instead, +end a sentence like this. +A macro would end like this: +\&.Xr mandoc 1 \&. +.Ed .Sh MANUAL STRUCTURE A well-formed .Nm @@ -292,9 +331,9 @@ file for a utility \&.Sh NAME \&.Nm progname \&.Nd one line about what it does -\&.\e\*q .Sh LIBRARY -\&.\e\*q For sections 2, 3, & 9 only. -\&.\e\*q Not used in OpenBSD. +\&.\e\(dq .Sh LIBRARY +\&.\e\(dq For sections 2, 3, & 9 only. +\&.\e\(dq Not used in OpenBSD. \&.Sh SYNOPSIS \&.Nm progname \&.Op Fl options @@ -303,29 +342,29 @@ file for a utility The \&.Nm utility processes files ... -\&.\e\*q .Sh IMPLEMENTATION NOTES -\&.\e\*q Not used in OpenBSD. -\&.\e\*q .Sh RETURN VALUES -\&.\e\*q For sections 2, 3, & 9 only. -\&.\e\*q .Sh ENVIRONMENT -\&.\e\*q For sections 1, 6, 7, & 8 only. -\&.\e\*q .Sh FILES -\&.\e\*q .Sh EXIT STATUS -\&.\e\*q For sections 1, 6, & 8 only. -\&.\e\*q .Sh EXAMPLES -\&.\e\*q .Sh DIAGNOSTICS -\&.\e\*q For sections 1, 4, 6, 7, & 8 only. -\&.\e\*q .Sh ERRORS -\&.\e\*q For sections 2, 3, & 9 only. -\&.\e\*q .Sh SEE ALSO -\&.\e\*q .Xr foobar 1 -\&.\e\*q .Sh STANDARDS -\&.\e\*q .Sh HISTORY -\&.\e\*q .Sh AUTHORS -\&.\e\*q .Sh CAVEATS -\&.\e\*q .Sh BUGS -\&.\e\*q .Sh SECURITY CONSIDERATIONS -\&.\e\*q Not used in OpenBSD. +\&.\e\(dq .Sh IMPLEMENTATION NOTES +\&.\e\(dq Not used in OpenBSD. +\&.\e\(dq .Sh RETURN VALUES +\&.\e\(dq For sections 2, 3, & 9 only. +\&.\e\(dq .Sh ENVIRONMENT +\&.\e\(dq For sections 1, 6, 7, & 8 only. +\&.\e\(dq .Sh FILES +\&.\e\(dq .Sh EXIT STATUS +\&.\e\(dq For sections 1, 6, & 8 only. +\&.\e\(dq .Sh EXAMPLES +\&.\e\(dq .Sh DIAGNOSTICS +\&.\e\(dq For sections 1, 4, 6, 7, & 8 only. +\&.\e\(dq .Sh ERRORS +\&.\e\(dq For sections 2, 3, & 9 only. +\&.\e\(dq .Sh SEE ALSO +\&.\e\(dq .Xr foobar 1 +\&.\e\(dq .Sh STANDARDS +\&.\e\(dq .Sh HISTORY +\&.\e\(dq .Sh AUTHORS +\&.\e\(dq .Sh CAVEATS +\&.\e\(dq .Sh BUGS +\&.\e\(dq .Sh SECURITY CONSIDERATIONS +\&.\e\(dq Not used in OpenBSD. .Ed .Pp The sections in an @@ -406,8 +445,8 @@ macros should follow C header-file conventions. .Pp And for the third, configurations (section 4): .Bd -literal -offset indent -\&.Cd \*qit* at isa? port 0x2e\*q -\&.Cd \*qit* at isa? port 0x4e\*q +\&.Cd \(dqit* at isa? port 0x2e\(dq +\&.Cd \(dqit* at isa? port 0x4e\(dq .Ed .Pp Manuals not in these sections generally don't need a @@ -971,7 +1010,7 @@ Deprecated macros are not included in the overview, but can be found in the alphabetical reference below. .Ss Document preamble and NAME section macros .Bl -column "Brq, Bro, Brc" description -.It Sx \&Dd Ta document date: Cm $Mdocdate: September 17 2011 $ | Ar month day , year +.It Sx \&Dd Ta document date: Cm $Mdocdate: September 18 2011 $ | Ar month day , year .It Sx \&Dt Ta document title: Ar TITLE section Op Ar volume | arch .It Sx \&Os Ta operating system version: Op Ar system Op Ar version .It Sx \&Nm Ta document name (one argument) @@ -2180,8 +2219,8 @@ section, this macro starts a new output line, and a blank line is automatically inserted between function definitions. .Pp Examples: -.Dl \&.Fn \*qint funcname\*q \*qint arg0\*q \*qint arg1\*q -.Dl \&.Fn funcname \*qint arg0\*q +.Dl \&.Fn \(dqint funcname\(dq \(dqint arg0\(dq \(dqint arg1\(dq +.Dl \&.Fn funcname \(dqint arg0\(dq .Dl \&.Fn funcname arg0 .Pp .Bd -literal -offset indent -compact @@ -2386,7 +2425,7 @@ line itself; on following lines, only the .Sx \&Ta macro can be used to delimit cells, and .Sx \&Ta -is only recognized as a macro when called by other macros, +is only recognised as a macro when called by other macros, not as the first macro on a line. .Pp Note that quoted strings may span tab-delimited cells on an @@ -2446,7 +2485,7 @@ Its syntax is as follows: .D1 Pf \. Sx \&Lk Ar uri Op Ar name .Pp Examples: -.Dl \&.Lk http://bsd.lv \*qThe BSD.lv Project\*q +.Dl \&.Lk http://bsd.lv \(dqThe BSD.lv Project\(dq .Dl \&.Lk http://bsd.lv .Pp See also @@ -3174,7 +3213,7 @@ Newer groff and mandoc print and the arguments. .It .Sx \&Bl Fl column -does not recognize trailing punctuation characters when they immediately +does not recognise trailing punctuation characters when they immediately precede tabulator characters, but treats them as normal text and outputs a space before them. .It @@ -3286,7 +3325,7 @@ The following features are unimplemented in mandoc: .Fl offset Ar center and .Fl offset Ar right . -Groff does not implement centered and flush-right rendering either, +Groff does not implement centred and flush-right rendering either, but produces large indentations. .It The @@ -3322,6 +3361,7 @@ This is not supported by mandoc. .Sh SEE ALSO .Xr man 1 , .Xr mandoc 1 , +.Xr eqn 7 , .Xr man 7 , .Xr mandoc_char 7 , .Xr roff 7 , @@ -3341,4 +3381,5 @@ utility written by Kristaps Dzonsons appeared in The .Nm reference was written by -.An Kristaps Dzonsons Aq kristaps@bsd.lv . +.An Kristaps Dzonsons , +.Mt kristaps@bsd.lv . diff --git a/share/man/man7/roff.7 b/share/man/man7/roff.7 index 5a11ec361bc..c793db5e745 100644 --- a/share/man/man7/roff.7 +++ b/share/man/man7/roff.7 @@ -1,4 +1,4 @@ -.\" $OpenBSD: roff.7,v 1.12 2011/06/07 23:40:10 schwarze Exp $ +.\" $OpenBSD: roff.7,v 1.13 2011/09/18 10:38:57 schwarze Exp $ .\" .\" Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: June 7 2011 $ +.Dd $Mdocdate: September 18 2011 $ .Dt ROFF 7 .Os .Sh NAME @@ -90,7 +90,7 @@ When called, they follow the same syntax as requests, except that macro arguments may optionally be quoted by enclosing them in double quote characters .Pq Sq \(dq . -To be recognized as the beginning of a quoted argument, the opening +To be recognised as the beginning of a quoted argument, the opening quote character must be preceded by a space character. .Pp A quoted argument may contain whitespace, and pairs of double quote @@ -118,7 +118,7 @@ but quoting is usually better for clarity. The .Xr mandoc 1 .Nm -parser recognizes the following requests. +parser recognises the following requests. Note that the .Nm language defines many more requests not implemented in @@ -126,7 +126,7 @@ language defines many more requests not implemented in .Ss \&ad Set line adjustment mode. This line-scoped request is intended to have one argument to select -normal, left, right, or center adjustment for subsequent text. +normal, left, right, or centre adjustment for subsequent text. Currently, it is ignored including its arguments, and the number of arguments is not checked. .Ss \&am @@ -344,6 +344,15 @@ then false is assumed. The syntax of this request is similar to .Sx \&if except that the conditional is missing. +.Ss \&EN +End an equation block. +See +.Sx \&EQ . +.Ss \&EQ +Begin an equation block. +See +.Xr eqn 7 +for a description of the equation language. .Ss \&ft Change the font. Its syntax is as follows: @@ -632,6 +641,19 @@ refers to groff version 1.15. .Pp .Bl -dash -compact .It +In mandoc, the +.Sx \&EQ , +.Sx \&TE , +.Sx \&TS , +and +.Sx \&T& , +macros are considered regular macros. +In all other +.Nm +implementations, these are special macros that must be specified without +spacing between the control character (which must be a period) and the +macro name. +.It The .Cm nS register is only compatible with OpenBSD's groff-1.15. @@ -649,6 +671,7 @@ using the next-line syntax. .El .Sh SEE ALSO .Xr mandoc 1 , +.Xr eqn 7 , .Xr man 7 , .Xr mandoc_char 7 , .Xr mdoc 7 , @@ -683,9 +706,11 @@ Joseph F. Ossanna rewrote it in PDP-11 assembly in 1973, and Brian W. Kernighan rewrote it in C in 1975. .Sh AUTHORS .An -nosplit -This partial +This .Nm reference was written by -.An Kristaps Dzonsons Aq kristaps@bsd.lv +.An Kristaps Dzonsons , +.Mt kristaps@bsd.lv ; and -.An Ingo Schwarze Aq schwarze@openbsd.org . +.An Ingo Schwarze , +.Mt schwarze@openbsd.org . diff --git a/share/man/man7/tbl.7 b/share/man/man7/tbl.7 index d74a79b6a2c..a3a60b627a6 100644 --- a/share/man/man7/tbl.7 +++ b/share/man/man7/tbl.7 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tbl.7,v 1.3 2011/02/07 00:02:50 schwarze Exp $ +.\" $OpenBSD: tbl.7,v 1.4 2011/09/18 10:38:57 schwarze Exp $ .\" .\" Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: February 7 2011 $ +.Dd $Mdocdate: September 18 2011 $ .Dt TBL 7 .Os .Sh NAME @@ -49,7 +49,7 @@ macro tags, whose precise syntax is documented in Tables consist of a series of options on a single line, followed by the table layout, followed by data. .Pp -For example, the following creates a boxed table with digits centered in +For example, the following creates a boxed table with digits centred in the cells. .Bd -literal -offset indent \&.TS @@ -249,12 +249,21 @@ The following case-insensitive modifier keys are available: .Cm e , .Cm t , .Cm d , -.Cm f , .Cm b , .Cm i , -.Cm b , +.Cm r , and -.Cm i . +.Cm f +.Po +followed by +.Cm b , +.Cm i , +.Cm r , +.Cm 3 , +.Cm 2 , +or +.Cm 1 +.Pc . All of these are ignored by .Xr mandoc 1 . .Pp @@ -325,7 +334,8 @@ This formed the basis of the implementation that is part of the .Xr mandoc 1 utility. .Sh AUTHORS -This partial +This .Nm reference was written by -.An Kristaps Dzonsons Aq kristaps@bsd.lv . +.An Kristaps Dzonsons , +.Mt kristaps@bsd.lv . |