=================================================================== RCS file: /cvs/mandoc/roff.7,v retrieving revision 1.46 retrieving revision 1.52 diff -u -p -r1.46 -r1.52 --- mandoc/roff.7 2013/12/26 02:43:18 1.46 +++ mandoc/roff.7 2014/04/05 20:34:57 1.52 @@ -1,7 +1,7 @@ -.\" $Id: roff.7,v 1.46 2013/12/26 02:43:18 schwarze Exp $ +.\" $Id: roff.7,v 1.52 2014/04/05 20:34:57 schwarze Exp $ .\" .\" Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons -.\" Copyright (c) 2010, 2011, 2013 Ingo Schwarze +.\" Copyright (c) 2010, 2011, 2013, 2014 Ingo Schwarze .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -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: December 26 2013 $ +.Dd $Mdocdate: April 5 2014 $ .Dt ROFF 7 .Os .Sh NAME @@ -427,6 +427,12 @@ The syntax of this request is the same as that of It is currently ignored by .Xr mandoc 1 , as are its children. +.Ss \&as +Append to a user-defined string. +The syntax of this request is the same as that of +.Sx \&ds . +If a user-defined string with the specified name does not yet exist, +it is set to the empty string before appending. .Ss \&cc Changes the control character. Its syntax is as follows: @@ -439,6 +445,12 @@ If is not specified, the control character is reset to .Sq \&. . Trailing characters are ignored. +.Ss \&ce +Center some lines. +This line-scoped request is intended to take one integer argument, +specifying how many lines to center. +Currently, it is ignored including its arguments, and the number +of arguments is not checked. .Ss \&de Define a .Nm @@ -647,6 +659,34 @@ This line-scoped request is intended to have one argum the font family to be selected. It is a groff extension, and currently, it is ignored including its arguments, and the number of arguments is not checked. +.Ss \&ft +Change the font. +Its syntax is as follows: +.Pp +.D1 Pf . Cm \&ft Op Ar font +.Pp +The following +.Ar font +arguments are supported: +.Bl -tag -width 4n -offset indent +.It Cm B , BI , 3 , 4 +switches to +.Sy bold +font +.It Cm I , 2 +switches to +.Em underlined +font +.It Cm R , CW , 1 +switches to normal font +.It Cm P No "or no argument" +switches back to the previous font +.El +.Pp +This request takes effect only locally, may be overridden by macros +and escape sequences, and is only supported in +.Xr man 7 +for now. .Ss \&hw Specify hyphenation points in words. This line-scoped request is currently ignored. @@ -665,10 +705,73 @@ Its syntax is equivalent to .Sx \&if . .Ss \&if Begins a conditional. -Right now, the conditional evaluates to true -if and only if it starts with the letter -.Sy n , -indicating processing in nroff style as opposed to troff style. +This request has the following syntax: +.Bd -literal -offset indent +\&.if COND BODY +.Ed +.Bd -literal -offset indent +\&.if COND \e{BODY +BODY...\e} +.Ed +.Bd -literal -offset indent +\&.if COND \e{\e +BODY... +\&.\e} +.Ed +.Pp +COND is a conditional statement. +Currently, +.Xr mandoc 1 +supports the following subset of roff conditionals: +.Bl -bullet +.It +If +.Sq \&! +is prefixed to COND, the condition is logically inverted. +.It +If the first character of COND is +.Sq n +.Pq nroff mode +or +.Sq o +.Pq odd page , +COND evaluates to true. +.It +If the first character of COND is +.Sq c +.Pq character available , +.Sq d +.Pq string defined , +.Sq e +.Pq even page , +.Sq r +.Pq register accessed , +or +.Sq t +.Pq troff mode , +COND evaluates to false. +.It +If COND starts with a digit, optionally prefixed by a minus sign, +it is evaluated as a numerical expression of the form +.Ar number operator number , +where +.Ar operator +is one of +.Sq < , +.Sq <= , +.Sq = , +.Sq >= , +or +.Sq > . +.It +Otherwise, the first character of COND is regarded as a delimiter +and COND evaluates to true if the string extending from its first +to its second occurrence is equal to the string extending from its +second to its third occurrence. +.It +If COND cannot be parsed, it evaluates to false. +.El +.Pp If a conditional is false, its children are not processed, but are syntactically interpreted to preserve the integrity of the input document. @@ -686,44 +789,12 @@ will continue to syntactically interpret to the block conditional. Sub-conditionals, in this case, obviously inherit the truth value of the parent. -This request has the following syntax: -.Bd -literal -offset indent -\&.if COND \e{\e -BODY... -\&.\e} -.Ed -.Bd -literal -offset indent -\&.if COND \e{ BODY -BODY... \e} -.Ed -.Bd -literal -offset indent -\&.if COND \e{ BODY -BODY... -\&.\e} -.Ed -.Bd -literal -offset indent -\&.if COND \e -BODY -.Ed .Pp -COND is a conditional statement. -roff allows for complicated conditionals; mandoc is much simpler. -At this time, mandoc supports only -.Sq n , -evaluating to true; -and -.Sq t , -.Sq e , -and -.Sq o , -evaluating to false. -All other invocations are read up to the next end of line or space and -evaluate as false. -.Pp If the BODY section is begun by an escaped brace .Sq \e{ , -scope continues until a closing-brace escape sequence -.Sq \.\e} . +scope continues until the end of the input line containing the +matching closing-brace escape sequence +.Sq \e} . If the BODY is not enclosed in braces, scope continues until the end of the line. If the COND is followed by a BODY on the same line, whether after a @@ -803,6 +874,23 @@ Otherwise, it only terminates the and arguments following it or the .Sq \&.. request are discarded. +.Ss \&ll +Change the output line length. +Its syntax is as follows: +.Pp +.D1 Pf . Cm \&ll Op Oo +|- Oc Ns Ar width +.Pp +If the +.Ar width +argument is omitted, the line length is reset to its previous value. +The default setting for terminal output is 78n. +If a sign is given, the line length is added to or subtracted from; +otherwise, it is set to the provided value. +Using this request in new manuals is discouraged for several reasons, +among others because it overrides the +.Xr mandoc 1 +.Fl O Cm width +command line option. .Ss \&ne Declare the need for the specified minimum vertical space before the next trap or the bottom of the page. @@ -810,12 +898,6 @@ This line-scoped request is currently ignored. .Ss \&nh Turn off automatic hyphenation mode. This line-scoped request is currently ignored. -.Ss \&rm -Remove a request, macro or string. -This request is intended to have one argument, -the name of the request, macro or string to be undefined. -Currently, it is ignored including its arguments, -and the number of arguments is not checked. .Ss \&nr Define or change a register. A register is an arbitrary string value that defines some sort of state, @@ -861,6 +943,16 @@ Change point size. This line-scoped request is intended to take one numerical argument. Currently, it is ignored including its arguments, and the number of arguments is not checked. +.Ss \&rm +Remove a request, macro or string. +Its syntax is as follows: +.Pp +.D1 Pf \. Cm \&rm Ar name +.Ss \&rr +Remove a register. +Its syntax is as follows: +.Pp +.D1 Pf \. Cm \&rr Ar name .Ss \&so Include a source file. Its syntax is as follows: