version 1.92, 2017/06/14 22:51:25 |
version 1.104, 2018/08/24 23:12:33 |
|
|
.\" $Id$ |
.\" $Id$ |
.\" |
.\" |
.\" Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> |
.\" Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> |
.\" Copyright (c) 2010,2011,2013-2015,2017 Ingo Schwarze <schwarze@openbsd.org> |
.\" Copyright (c) 2010-2018 Ingo Schwarze <schwarze@openbsd.org> |
.\" |
.\" |
.\" Permission to use, copy, modify, and distribute this software for any |
.\" Permission to use, copy, modify, and distribute this software for any |
.\" purpose with or without fee is hereby granted, provided that the above |
.\" purpose with or without fee is hereby granted, provided that the above |
Line 86 character, and, in certain circumstances, the tab char |
|
Line 86 character, and, in certain circumstances, the tab char |
|
The backslash character |
The backslash character |
.Sq \e |
.Sq \e |
indicates the start of an escape sequence, used for example for |
indicates the start of an escape sequence, used for example for |
.Sx Comments , |
.Sx Comments |
.Sx Special Characters , |
|
.Sx Predefined Strings , |
|
and |
and |
user-defined strings defined using the |
.Sx Special Characters . |
.Sx ds |
|
request. |
|
For a listing of escape sequences, consult the |
For a listing of escape sequences, consult the |
.Sx ESCAPE SEQUENCE REFERENCE |
.Sx ESCAPE SEQUENCE REFERENCE |
below. |
below. |
Line 169 Text decoration is |
|
Line 165 Text decoration is |
|
recommended for |
recommended for |
.Xr mdoc 7 , |
.Xr mdoc 7 , |
which encourages semantic annotation. |
which encourages semantic annotation. |
.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 |
|
Predefined strings are not recommended for use, |
|
as they differ across implementations. |
|
Those supported by |
|
.Xr mandoc 1 |
|
are listed in |
|
.Xr mandoc_char 7 . |
|
Manuals using these predefined strings are almost certainly not portable. |
|
.Ss Whitespace |
.Ss Whitespace |
Whitespace consists of the space character. |
Whitespace consists of the space character. |
In text lines, whitespace is preserved within a line. |
In text lines, whitespace is preserved within a line. |
Line 206 Unescaped trailing spaces are stripped from text line |
|
Line 174 Unescaped trailing spaces are stripped from text line |
|
literal context. |
literal context. |
In general, trailing whitespace on any input line is discouraged for |
In general, trailing whitespace on any input line is discouraged for |
reasons of portability. |
reasons of portability. |
In the rare case that a blank character is needed at the end of an |
In the rare case that a space character is needed at the end of an |
input line, it may be forced by |
input line, it may be forced by |
.Sq \e\ \e& . |
.Sq \e\ \e& . |
.Pp |
.Pp |
|
|
.Pp |
.Pp |
in the input stream, and thus in the output: \fI\^XtFree\^\fP. |
in the input stream, and thus in the output: \fI\^XtFree\^\fP. |
Each occurrence of \e\e$* is replaced with all the arguments, |
Each occurrence of \e\e$* is replaced with all the arguments, |
joined together with single blank characters. |
joined together with single space characters. |
|
The variant \e\e$@ is similar, except that each argument is |
|
individually quoted. |
.Pp |
.Pp |
Since macros and user-defined strings share a common string table, |
Since macros and user-defined strings share a common string table, |
defining a macro |
defining a macro |
|
|
.Ar font |
.Ar font |
arguments are supported: |
arguments are supported: |
.Bl -tag -width 4n -offset indent |
.Bl -tag -width 4n -offset indent |
.It Cm B , BI , 3 , 4 |
.It Cm B , BI , CB , 3 , 4 |
switches to |
switches to |
.Sy bold |
.Sy bold |
font |
font |
.It Cm I , 2 |
.It Cm I , CI , 2 |
switches to |
switches to |
.Em underlined |
.Em underlined |
font |
font |
.It Cm R , CW , 1 |
.It Cm R , CR , CW , 1 |
switches to normal font |
switches to normal font |
.It Cm P No "or no argument" |
.It Cm P No "or no argument" |
switches back to the previous font |
switches back to the previous font |
|
|
or |
or |
.Sq o |
.Sq o |
.Pq odd page , |
.Pq odd page , |
it evaluates to true. |
it evaluates to true, and the |
|
.Ar body |
|
starts with the next character. |
.It |
.It |
If the first character of |
If the first character of |
.Ar condition |
.Ar condition |
is |
is |
.Sq c |
|
.Pq character available , |
|
.Sq e |
.Sq e |
.Pq even page , |
.Pq even page , |
.Sq t |
.Sq t |
|
|
or |
or |
.Sq v |
.Sq v |
.Pq vroff mode , |
.Pq vroff mode , |
it evaluates to false. |
it evaluates to false, and the |
|
.Ar body |
|
starts with the next character. |
.It |
.It |
If the first character of |
If the first character of |
.Ar condition |
.Ar condition |
is |
is |
|
.Sq c |
|
.Pq character available , |
|
it evaluates to true if the following character is an ASCII character |
|
or a valid character escape sequence, or to false otherwise. |
|
The |
|
.Ar body |
|
starts with the character following that next character. |
|
.It |
|
If the first character of |
|
.Ar condition |
|
is |
.Sq d , |
.Sq d , |
it evaluates to true if the rest of |
it evaluates to true if the rest of |
.Ar condition |
.Ar condition |
Line 1219 While evaluating the |
|
Line 1202 While evaluating the |
|
the unit suffixes described below |
the unit suffixes described below |
.Sx Scaling Widths |
.Sx Scaling Widths |
are ignored. |
are ignored. |
.It Ic \&it Ar expression macro |
.It Ic \&itc Ar expression macro |
Set an input line trap, not counting lines ending with \ec. |
Set an input line trap, not counting lines ending with \ec. |
Currently unsupported. |
Currently unsupported. |
.It Ic \&IX Ar class keystring |
.It Ic \&IX Ar class keystring |
Line 1346 Currently unsupported. |
|
Line 1329 Currently unsupported. |
|
Temporarily turn off line numbering. |
Temporarily turn off line numbering. |
Currently unsupported. |
Currently unsupported. |
.It Ic \&nop Ar body |
.It Ic \&nop Ar body |
Execute the rest of the input line as a request or macro line. |
Execute the rest of the input line as a request, macro, or text line, |
Currently unsupported. |
skipping the |
.It Ic \&nr Ar register Oo Cm + Ns | Ns Cm - Oc Ns Ar expression |
.Ic \&nop |
|
request and any space characters immediately following it. |
|
This is mostly used to indent text lines inside macro definitions. |
|
.It Ic \&nr Ar register Oo Cm + Ns | Ns Cm - Oc Ns Ar expression Op Ar stepsize |
Define or change a register. |
Define or change a register. |
A register is an arbitrary string value that defines some sort of state, |
A register is an arbitrary string value that defines some sort of state, |
which influences parsing and/or formatting. |
which influences parsing and/or formatting. |
|
|
If it is prefixed by a sign, the register will be |
If it is prefixed by a sign, the register will be |
incremented or decremented instead of assigned to. |
incremented or decremented instead of assigned to. |
.Pp |
.Pp |
|
The |
|
.Ar stepsize |
|
is used by the |
|
.Ic \en+ |
|
auto-increment feature. |
|
It remains unchanged when omitted while changing an existing register, |
|
and it defaults to 0 when defining a new register. |
|
.Pp |
The following |
The following |
.Ar register |
.Ar register |
is handled specially: |
is handled specially: |
Line 1471 This is a groff extension and currently ignored. |
|
Line 1465 This is a groff extension and currently ignored. |
|
.It Ic \&rchar Ar glyph ... |
.It Ic \&rchar Ar glyph ... |
Remove glyph definitions. |
Remove glyph definitions. |
Currently unsupported. |
Currently unsupported. |
.It Ic \&rd Op Ar prompt Op Ar agument ... |
.It Ic \&rd Op Ar prompt Op Ar argument ... |
Read from standard input. |
Read from standard input. |
Currently ignored. |
Currently ignored. |
.It Ic \&recursionlimit Ar maxrec maxtail |
.It Ic \&recursionlimit Ar maxrec maxtail |
Set the maximum stack depth for recursive macros. |
Set the maximum stack depth for recursive macros. |
This is a Heirloom extension and currently ignored. |
This is a Heirloom extension and currently ignored. |
.It Ic \&return Op Ar twice |
.It Ic \&return Op Ar twice |
Exit a macro and return to the caller. |
Exit the presently executed macro and return to the caller. |
Currently unsupported. |
The argument is currently ignored. |
.It Ic \&rfschar Ar font glyph ... |
.It Ic \&rfschar Ar font glyph ... |
Remove font-specific fallback glyph definitions. |
Remove font-specific fallback glyph definitions. |
Currently unsupported. |
Currently unsupported. |
Line 1528 This is a Heirloom extension and currently ignored. |
|
Line 1522 This is a Heirloom extension and currently ignored. |
|
Change the soft hyphen character. |
Change the soft hyphen character. |
Currently ignored. |
Currently ignored. |
.It Ic \&shift Op Ar number |
.It Ic \&shift Op Ar number |
Shift macro arguments. |
Shift macro arguments |
Currently unsupported. |
.Ar number |
|
times, by default once: \e\e$i becomes what \e\e$i+number was. |
|
Also decrement \en(.$ by |
|
.Ar number . |
.It Ic \&sizes Ar size ... |
.It Ic \&sizes Ar size ... |
Define permissible point sizes. |
Define permissible point sizes. |
This is a groff extension and currently ignored. |
This is a groff extension and currently ignored. |
Line 1718 This is a Heirloom extension and currently ignored. |
|
Line 1715 This is a Heirloom extension and currently ignored. |
|
Set a page location trap. |
Set a page location trap. |
Currently unsupported. |
Currently unsupported. |
.It Ic \&while Ar condition body |
.It Ic \&while Ar condition body |
Repeated execution while a condition is true. |
Repeated execution while a |
Currently unsupported. |
.Ar condition |
|
is true, with syntax similar to |
|
.Ic \&if . |
|
Currently implemented with two restrictions: cannot nest, |
|
and each loop must start and end in the same scope. |
.It Ic \&write Oo \(dq Oc Ns Ar string |
.It Ic \&write Oo \(dq Oc Ns Ar string |
Write to an open file. |
Write to an open file. |
Ignored because insecure. |
Ignored because insecure. |
Line 1840 is an unpaddable space-sized non-breaking space charac |
|
Line 1841 is an unpaddable space-sized non-breaking space charac |
|
.Ss \e\(dq |
.Ss \e\(dq |
The rest of the input line is treated as |
The rest of the input line is treated as |
.Sx Comments . |
.Sx Comments . |
|
.Ss \e# |
|
Line continuation with comment. |
|
Discard the rest of the physical input line and continue the logical |
|
input line on the next physical input line, joining the text on |
|
both lines together as if it were on a single input line. |
|
This is a groff extension. |
|
.Ss \e$ Ns Ar arg |
|
Macro argument expansion, see |
|
.Sx de . |
.Ss \e% |
.Ss \e% |
Hyphenation allowed at this point of the word; ignored by |
Hyphenation allowed at this point of the word; ignored by |
.Xr mandoc 1 . |
.Xr mandoc 1 . |
|
|
.Sx Special Characters |
.Sx Special Characters |
with two-letter names, see |
with two-letter names, see |
.Xr mandoc_char 7 . |
.Xr mandoc_char 7 . |
.Ss \e*[ Ns Ar name ] |
.Ss \e* Ns Bq Ar name |
Interpolate the string with the |
Interpolate the string with the |
.Ar name ; |
.Ar name . |
see |
|
.Sx Predefined Strings |
|
and |
|
.Sx ds . |
|
For short names, there are variants |
For short names, there are variants |
.No \e* Ns Ar c |
.No \e* Ns Ar c |
and |
and |
.No \e*( Ns Ar cc . |
.No \e*( Ns Ar cc . |
|
.Pp |
|
One string is predefined on the |
|
.Nm |
|
language level: \e*(.T expands to the name of the output device, |
|
for example ascii, utf8, ps, pdf, html, or markdown. |
|
.Pp |
|
Macro sets traditionally predefine additional strings which are not |
|
portable and differ across implementations. |
|
Those supported by |
|
.Xr mandoc 1 |
|
are listed in |
|
.Xr mandoc_char 7 . |
|
.Pp |
|
Strings can be defined, changed, and deleted with the |
|
.Ic \&ds , |
|
.Ic \&as , |
|
and |
|
.Ic \&rm |
|
requests. |
.Ss \e, |
.Ss \e, |
Left italic correction (groff extension); ignored by |
Left italic correction (groff extension); ignored by |
.Xr mandoc 1 . |
.Xr mandoc 1 . |
Line 1874 Special character |
|
Line 1899 Special character |
|
.Ss \e/ |
.Ss \e/ |
Right italic correction (groff extension); ignored by |
Right italic correction (groff extension); ignored by |
.Xr mandoc 1 . |
.Xr mandoc 1 . |
.Ss \e[ Ns Ar name ] |
.Ss \e Ns Bq Ar name |
.Sx Special Characters |
.Sx Special Characters |
with names of arbitrary length, see |
with names of arbitrary length, see |
.Xr mandoc_char 7 . |
.Xr mandoc_char 7 . |
Line 1930 Move down by half a line; ignored by |
|
Line 1955 Move down by half a line; ignored by |
|
.Xr mandoc 1 . |
.Xr mandoc 1 . |
.Ss \ee |
.Ss \ee |
Backslash special character. |
Backslash special character. |
.Ss \eF[ Ns Ar name ] |
.Ss \eF Ns Bq Ar name |
Switch font family (groff extension); ignored by |
Switch font family (groff extension); ignored by |
.Xr mandoc 1 . |
.Xr mandoc 1 . |
For short names, there are variants |
For short names, there are variants |
.No \eF Ns Ar c |
.No \eF Ns Ar c |
and |
and |
.No \eF( Ns Ar cc . |
.No \eF( Ns Ar cc . |
.Ss \ef[ Ns Ar name ] |
.Ss \ef Ns Bq Ar name |
Switch to the font |
Switch to the font |
.Ar name , |
.Ar name , |
see |
see |
Line 1946 For short names, there are variants |
|
Line 1971 For short names, there are variants |
|
.No \ef Ns Ar c |
.No \ef Ns Ar c |
and |
and |
.No \ef( Ns Ar cc . |
.No \ef( Ns Ar cc . |
.Ss \eg[ Ns Ar name ] |
.Ss \eg Ns Bq Ar name |
Interpolate the format of a number register; ignored by |
Interpolate the format of a number register; ignored by |
.Xr mandoc 1 . |
.Xr mandoc 1 . |
For short names, there are variants |
For short names, there are variants |
|
|
.Ss \eH\(aq Ns Oo +|- Oc Ns Ar number Ns \(aq |
.Ss \eH\(aq Ns Oo +|- Oc Ns Ar number Ns \(aq |
Set the height of the current font; ignored by |
Set the height of the current font; ignored by |
.Xr mandoc 1 . |
.Xr mandoc 1 . |
.Ss \eh\(aq Ns Ar width Ns \(aq |
.Ss \eh\(aq Ns Oo Cm \&| Oc Ns Ar width Ns \(aq |
Horizontal motion relative to the current position. |
Horizontal motion. |
|
If the vertical bar is given, the motion is relative to the current |
|
indentation. |
|
Otherwise, it is relative to the current position. |
The default scaling unit is |
The default scaling unit is |
.Cm m . |
.Cm m . |
.Ss \ek[ Ns Ar name ] |
.Ss \ek Ns Bq Ar name |
Mark horizontal input place in register; ignored by |
Mark horizontal input place in register; ignored by |
.Xr mandoc 1 . |
.Xr mandoc 1 . |
For short names, there are variants |
For short names, there are variants |
Line 1975 Draw a horizontal line of |
|
Line 2003 Draw a horizontal line of |
|
.Ar width |
.Ar width |
using the glyph |
using the glyph |
.Ar c . |
.Ar c . |
.Ss \eM[ Ns Ar name ] |
.Ss \eM Ns Bq Ar name |
Set fill (background) color (groff extension); ignored by |
Set fill (background) color (groff extension); ignored by |
.Xr mandoc 1 . |
.Xr mandoc 1 . |
For short names, there are variants |
For short names, there are variants |
.No \eM Ns Ar c |
.No \eM Ns Ar c |
and |
and |
.No \eM( Ns Ar cc . |
.No \eM( Ns Ar cc . |
.Ss \em[ Ns Ar name ] |
.Ss \em Ns Bq Ar name |
Set glyph drawing color (groff extension); ignored by |
Set glyph drawing color (groff extension); ignored by |
.Xr mandoc 1 . |
.Xr mandoc 1 . |
For short names, there are variants |
For short names, there are variants |
|
|
Character |
Character |
.Ar number |
.Ar number |
on the current font. |
on the current font. |
.Ss \en[ Ns Ar name ] |
.Ss \en Ns Oo +|- Oc Ns Bq Ar name |
Interpolate the number register |
Interpolate the number register |
.Ar name . |
.Ar name . |
For short names, there are variants |
For short names, there are variants |
.No \en Ns Ar c |
.No \en Ns Ar c |
and |
and |
.No \en( Ns Ar cc . |
.No \en( Ns Ar cc . |
|
If the optional sign is specified, |
|
the register is first incremented or decremented by the |
|
.Ar stepsize |
|
that was specified in the relevant |
|
.Ic \&nr |
|
request, and the changed value is interpolated. |
.Ss \eo\(aq Ns Ar string Ns \(aq |
.Ss \eo\(aq Ns Ar string Ns \(aq |
Overstrike, writing all the characters contained in the |
Overstrike, writing all the characters contained in the |
.Ar string |
.Ar string |
Line 2020 Change point size; ignored by |
|
Line 2054 Change point size; ignored by |
|
Alternative forms |
Alternative forms |
.No \es Ns Oo +|- Oc Ns Ar n , |
.No \es Ns Oo +|- Oc Ns Ar n , |
.No \es Ns Oo +|- Oc Ns \(aq Ns Ar number Ns \(aq , |
.No \es Ns Oo +|- Oc Ns \(aq Ns Ar number Ns \(aq , |
.No \es Ns [ Oo +|- Oc Ns Ar number ] , |
.No \es Ns Bq Oo +|- Oc Ns Ar number , |
and |
and |
.No \es Ns Oo +|- Oc Ns [ Ar number Ns ] |
.No \es Ns Oo +|- Oc Ns Bq Ar number |
are also parsed and ignored. |
are also parsed and ignored. |
.Ss \et |
.Ss \et |
Horizontal tab; ignored by |
Horizontal tab; ignored by |
Line 2030 Horizontal tab; ignored by |
|
Line 2064 Horizontal tab; ignored by |
|
.Ss \eu |
.Ss \eu |
Move up by half a line; ignored by |
Move up by half a line; ignored by |
.Xr mandoc 1 . |
.Xr mandoc 1 . |
.Ss \eV[ Ns Ar name ] |
.Ss \eV Ns Bq Ar name |
Interpolate an environment variable; ignored by |
Interpolate an environment variable; ignored by |
.Xr mandoc 1 . |
.Xr mandoc 1 . |
For short names, there are variants |
For short names, there are variants |
Line 2057 as device control function; ignored in nroff mode and |
|
Line 2091 as device control function; ignored in nroff mode and |
|
.Ss \ex\(aq Ns Ar number Ns \(aq |
.Ss \ex\(aq Ns Ar number Ns \(aq |
Extra line space function; ignored by |
Extra line space function; ignored by |
.Xr mandoc 1 . |
.Xr mandoc 1 . |
.Ss \eY[ Ns Ar name ] |
.Ss \eY Ns Bq Ar name |
Output a string as a device control function; ignored in nroff mode and by |
Output a string as a device control function; ignored in nroff mode and by |
.Xr mandoc 1 . |
.Xr mandoc 1 . |
For short names, there are variants |
For short names, there are variants |
Line 2119 macro control character does not suppress output line |
|
Line 2153 macro control character does not suppress output line |
|
.It |
.It |
Diversions are not implemented, |
Diversions are not implemented, |
and support for traps is very incomplete. |
and support for traps is very incomplete. |
.It |
|
While recursion is supported, |
|
.Sx \&while |
|
loops are not. |
|
.El |
.El |
.Pp |
.Pp |
The special semantics of the |
The special semantics of the |