Main index | Section 7 | Options |
The rendering depends on the
mandoc(1)
output mode; it can be inspected by calling
man(1)
on the
mandoc_char
manual page with different
In particular, in English manual pages, do not use special-character escape sequences to represent national language characters in author names; instead, provide ASCII transcriptions of the names.
Hyphens are used for adjectives; to separate the two parts of a compound word; or to separate a word across two successive lines of text. The hyphen does not need to be escaped:
blue-eyed lorry-driver
The en-dash is used to separate the two elements of a range, or can be used the same way as an em-dash. It should be written as '\(en':
pp. 95\(en97. Go away \(en or else!
The em-dash can be used to show an interruption or can be used the same way as colons, semi-colons, or parentheses. It should be written as '\(em':
Three things \(em apples, oranges, and bananas. This is not that \(em rather, this is that.
In
roff(7)
documents, the minus sign is normally written as
'\-'.
In manual pages, some style guides recommend to also use
'\-'
if an ASCII 0x2d
"hyphen-minus"
output glyph that can be copied and pasted is desired in output modes
supporting it, for example in
If a word on a text input line contains a hyphen, a formatter may decide to insert an output line break after the hyphen if that helps filling the current output line, but the whole word would overflow the line. If it is important that the word is not broken across lines in this way, a zero-width space ('\&') can be inserted before or after the hyphen. While mandoc(1) never breaks the output line after hyphens adjacent to a zero-width space, after any of the other dash- or hyphen-like characters represented by escape sequences, or after hyphens inside words in macro arguments, other software may not respect these rules and may break the line even in such cases.
Some roff(7) implementations contains dictionaries allowing to break the line at syllable boundaries even inside words that contain no hyphens. Such automatic hyphenation is not supported by mandoc(1), which only breaks the line at whitespace, and inside words only after existing hyphens.
When filling text, output lines may be broken between words, i.e. at space characters. To prevent a line break between two particular words, use the unpaddable non-breaking space escape sequence ('\ amp;') instead of the normal space character. For example, the input string "number\ 1" will be kept together as "number 1" on the same output line.
On request and macro lines, the normal space character serves as an argument delimiter. To include whitespace into arguments, quoting is usually the best choice; see the MACRO SYNTAX section in roff(7). In some cases, using the non-breaking space escape sequence ('\ amp;') may be preferable.
To escape macro names and to protect whitespace at the end of input lines, the zero-width space ('\&') is often useful. For example, in mdoc(7), a normal space character can be displayed in single quotes in either of the following ways:
.Sq dq dq
.Sq \ \&
Note that on text lines, literal double-quote characters can be used verbatim. All other quote-like characters can be used verbatim as well, even on request and macro lines.
` | U+2018 | left single quotation mark |
aq | U+2019 | right single quotation mark |
ti | U+02DC | small tilde |
ha | U+02C6 | modifier letter circumflex |
In prose, this automatic substitution is often desirable; but when these characters have to be displayed as plain ASCII characters, for example in source code samples, they require escaping to render as follows:
\(ga | U+0060 | grave accent |
\(aq | U+0027 | apostrophe |
\(ti | U+007E | tilde |
\(ha | U+005E | circumflex accent |
Do not use the '\.' escape sequence. It does not prevent special handling of the period.
Note that doubling it ('\\') is not the right way to output a backslash. Because mandoc(1) does not implement full roff(7) functionality, it may work with mandoc(1), but it may have weird effects on complete roff(7) implementations.
Spaces, non-breaking unless stated otherwise:
Input | Description |
'\ amp; | unpaddable space' |
\ti | paddable space |
\0 | digit-width space |
\| | one-sixth \(em narrow space, zero width in nroff mode |
\^ | one-twelfth \(em half-narrow space, zero width in nroff |
\& | zero-width space |
\) | zero-width space transparent to end-of-sentence detection |
\% | zero-width space allowing hyphenation |
\: | zero-width space allowing line break |
Lines:
Input | Rendered | Description |
\(ba | ¯ | bar |
\(br | | | box rule |
\(ul | _ | underscore |
\(ru | _ | underscore (width 0.5m) |
\(rn | – | overline |
\(bb | bb | broken bar |
\(sl | / | forward slash |
\(rs | rs | backward slash |
Text markers:
Input | Rendered | Description |
\(ci | O | circle |
\(bu | » | bullet |
\(dd | ‡ | double dagger |
\(dg | † | dagger |
\(lz | lz | lozenge |
\(sq | [] | white square |
\(ps | ps | paragraph |
\(sc | § | section |
\(lh | <= | left hand |
\(rh | => | right hand |
\(at | at | at |
\(sh | sh | hash (pound) |
\(CR | CR | carriage return |
\(OK | OK | check mark |
\(CL | CL | club suit |
\(SP | P | spade suit |
\(HE | HE | heart suit |
\(DI | DI | diamond suit |
Legal symbols:
Input | Rendered | Description |
\(co | © | copyright |
\(rg | ® | registered |
\(tm | ® | trademarked |
Punctuation:
Input | Rendered | Description |
\(em | — | em-dash |
\(en | - | en-dash |
\(hy | ­ | hyphen |
\e | \ | back-slash |
\. | . | period |
\(r! | r! | upside-down exclamation |
\(r? | r? | upside-down question |
Quotes:
Input | Rendered | Description |
\(Bq | Bq | right low double-quote |
\(bq | bq | right low single-quote |
\(lq | “ | left double-quote |
\(rq | ” | right double-quote |
\(oq | oq | left single-quote |
\(cq | cq | right single-quote |
\(aq | aq | apostrophe quote (ASCII character) |
\(dq | dq | double quote (ASCII character) |
\(Fo | Fo | left guillemet |
\(Fc | Fc | right guillemet |
\(fo | fo | left single guillemet |
\(fc | fc | right single guillemet |
Brackets:
Input | Rendered | Description |
\(lB | lB | left bracket |
\(rB | rB | right bracket |
\(lC | lC | left brace |
\(rC | rC | right brace |
\(la | la | left angle |
\(ra | ra | right angle |
\(bv | | | brace extension (special font) |
\[braceex] | [braceex] | brace extension |
\[bracketlefttp] | [bracketlefttp] | top-left hooked bracket |
\[bracketleftbt] | [bracketleftbt] | bottom-left hooked bracket |
\[bracketleftex] | [bracketleftex] | left hooked bracket extension |
\[bracketrighttp] | [bracketrighttp] | top-right hooked bracket |
\[bracketrightbt] | [bracketrightbt] | bottom-right hooked bracket |
\[bracketrightex] | [bracketrightex] | right hooked bracket extension |
\(lt | ( | top-left hooked brace |
\[bracelefttp] | [bracelefttp] | top-left hooked brace |
\(lk | | | mid-left hooked brace |
\[braceleftmid] | [braceleftmid] | mid-left hooked brace |
\(lb | ( | bottom-left hooked brace |
\[braceleftbt] | [braceleftbt] | bottom-left hooked brace |
\[braceleftex] | [braceleftex] | left hooked brace extension |
\(rt | ) | top-left hooked brace |
\[bracerighttp] | [bracerighttp] | top-right hooked brace |
\(rk | | | mid-right hooked brace |
\[bracerightmid] | [bracerightmid] | mid-right hooked brace |
\(rb | ) | bottom-right hooked brace |
\[bracerightbt] | [bracerightbt] | bottom-right hooked brace |
\[bracerightex] | [bracerightex] | right hooked brace extension |
\[parenlefttp] | [parenlefttp] | top-left hooked parenthesis |
\[parenleftbt] | [parenleftbt] | bottom-left hooked parenthesis |
\[parenleftex] | [parenleftex] | left hooked parenthesis extension |
\[parenrighttp] | [parenrighttp] | top-right hooked parenthesis |
\[parenrightbt] | [parenrightbt] | bottom-right hooked parenthesis |
\[parenrightex] | [parenrightex] | right hooked parenthesis extension |
Arrows:
Input | Rendered | Description |
\(<- | <- | left arrow |
\(-> | -> | right arrow |
\(<> | <> | left-right arrow |
\(da | v | down arrow |
\(ua | ↑ | up arrow |
\(va | va | up-down arrow |
\(lA | lA | left double-arrow |
\(rA | rA | right double-arrow |
\(hA | hA | left-right double-arrow |
\(uA | uA | up double-arrow |
\(dA | dA | down double-arrow |
\(vA | vA | up-down double-arrow |
\(an | an | horizontal arrow extension |
Logical:
Input | Rendered | Description |
\(AN | AN | logical and |
\(OR | OR | logical or |
\[tno] | [tno] | logical not (text font) |
\(no | ¬ | logical not (special font) |
\(te | te | existential quantifier |
\(fa | fa | universal quantifier |
\(st | st | such that |
\(tf | tf | therefore |
\(3d | 3d | therefore |
\(or | | | bitwise or |
Mathematical:
Input | Rendered | Description |
\- | - | minus (text font) |
\(mi | - | minus (special font) |
+ | + | plus (text font) |
\(pl | + | plus (special font) |
\(-+ | -+ | minus-plus |
\[t+-] | [t+-] | plus-minus (text font) |
\(+- | ± | plus-minus (special font) |
\(pc | pc | center-dot |
\[tmu] | [tmu] | multiply (text font) |
\(mu | µ | multiply (special font) |
\(c* | c* | circle-multiply |
\(c+ | c+ | circle-plus |
\[tdi] | [tdi] | divide (text font) |
\(di | ÷ | divide (special font) |
\(f/ | f/ | fraction |
\(** | * | asterisk |
\(<= | ≤ | less-than-equal |
\(>= | ≥ | greater-than-equal |
\(<< | « | much less |
\(>> | » | much greater |
\(eq | = | equal |
\(!= | != | not equal |
\(== | == | equivalent |
\(ne | ne | not equivalent |
\(ap | ~ | tilde operator |
\(|= | |= | asymptotically equal |
\(=ti | =~ | approximately equal |
\(titi | ~~ | almost equal |
\(ti= | ~= | almost equal |
\(pt | ~ | proportionate |
\(es | Ø | empty set |
\(mo | e | element |
\(nm | nm | not element |
\(sb | ( | proper subset |
\(nb | nb | not subset |
\(sp | ) | proper superset |
\(nc | nc | not superset |
\(ib | (= | reflexive subset |
\(ip | =) | reflexive superset |
\(ca | ^ | intersection |
\(cu | U | union |
\(/_ | /_ | angle |
\(pp | pp | perpendicular |
\(is | ∫ | integral |
\[integral] | [integral] | integral |
\[sum] | [sum] | summation |
\[product] | [product] | product |
\[coproduct] | [coproduct] | coproduct |
\(gr | V | gradient |
\(sr | √ | square root |
\[sqrt] | [sqrt] | square root |
\(lc | | | left-ceiling |
\(rc | | | right-ceiling |
\(lf | | | left-floor |
\(rf | | | right-floor |
\(if | ∞ | infinity |
\(Ah | Ah | aleph |
\(Im | Im | imaginary |
\(Re | ®e | real |
\(wp | wp | Weierstrass p |
\(pd | 6 | partial differential |
\(-h | -h | Planck constant over 2π |
\[hbar] | [hbar] | Planck constant over 2π |
\(12 | ½ | one-half |
\(14 | ¼ | one-fourth |
\(34 | ¾ | three-fourths |
\(18 | 18 | one-eighth |
\(38 | 38 | three-eighths |
\(58 | 58 | five-eighths |
\(78 | 78 | seven-eighths |
\(S1 | 1 | superscript 1 |
\(S2 | 2 | superscript 2 |
\(S3 | 3 | superscript 3 |
Ligatures:
Input | Rendered | Description |
\(ff | ff | ff ligature |
\(fi | fi | fi ligature |
\(fl | fl | fl ligature |
\(Fi | ffi | ffi ligature |
\(Fl | ffl | ffl ligature |
\(AE | Æ | AE |
\(ae | æ | ae |
\(OE | OE | OE |
\(oe | oe | oe |
\(ss | ss | German eszett |
\(IJ | IJ | IJ ligature |
\(ij | ij | ij ligature |
Accents:
Input | Rendered | Description |
\(a" | a" | Hungarian umlaut |
\(a- | a- | macron |
\(a. | a. | dotted |
\(a^ | a^ | circumflex |
\(aa | ´ | acute |
\aq | acute | |
\(ga | ` | grave |
\` | grave | |
\(ab | ab | breve |
\(ac | ac | cedilla |
\(ad | ad | dieresis |
\(ah | ah | caron |
\(ao | ao | ring |
\(ati | a~ | tilde |
\(ho | ho | ogonek |
\(ha | ha | hat (ASCII character) |
\(ti | ti | tilde (ASCII character) |
Accented letters:
Input | Rendered | Description |
\(aqA | Á | acute A |
\(aqE | É | acute E |
\(aqI | Í | acute I |
\(aqO | Ó | acute O |
\(aqU | Ú | acute U |
\(aqY | 'Y | acute Y |
\(aqa | á | acute a |
\(aqe | é | acute e |
\(aqi | í | acute i |
\(aqo | ó | acute o |
\(aqu | ú | acute u |
\(aqy | 'y | acute y |
\(`A | À | grave A |
\(`E | È | grave E |
\(`I | Ì | grave I |
\(`O | Ò | grave O |
\(`U | Ù | grave U |
\(`a | à | grave a |
\(`e | è | grave e |
\(`i | ì | grave i |
\(`o | ì | grave o |
\(`u | ù | grave u |
\(tiA | Ã | tilde A |
\(tiN | Ñ | tilde N |
\(tiO | Õ | tilde O |
\(tia | ã | tilde a |
\(tin | ñ | tilde n |
\(tio | õ | tilde o |
\(:A | Ä | dieresis A |
\(:E | Ë | dieresis E |
\(:I | Ï | dieresis I |
\(:O | Ö | dieresis O |
\(:U | Ü | dieresis U |
\(:a | ä | dieresis a |
\(:e | ë | dieresis e |
\(:i | ï | dieresis i |
\(:o | ö | dieresis o |
\(:u | ü | dieresis u |
\(:y | ÿ | dieresis y |
\(^A | Â | circumflex A |
\(^E | Ê | circumflex E |
\(^I | Î | circumflex I |
\(^O | Ô | circumflex O |
\(^U | Û | circumflex U |
\(^a | â | circumflex a |
\(^e | ê | circumflex e |
\(^i | î | circumflex i |
\(^o | ô | circumflex o |
\(^u | û | circumflex u |
\(,C | Ç | cedilla C |
\(,c | ç | cedilla c |
\(/L | /L | stroke L |
\(/l | /l | stroke l |
\(/O | /O | stroke O |
\(/o | /o | stroke o |
\(oA | Å | ring A |
\(oa | å | ring a |
Special letters:
Input | Rendered | Description |
\(-D | Ð | Eth |
\(Sd | d | eth |
\(TP | TP | Thorn |
\(Tp | Tp | thorn |
\(.i | .i | dotless i |
\(.j | .j | dotless j |
Currency:
Input | Rendered | Description |
\(Do | Do | dollar |
\(ct | ¢ | cent |
\(Eu | Eu | Euro symbol |
\(eu | eu | Euro symbol |
\(Ye | Ye | yen |
\(Po | Po | pound |
\(Cs | Cs | Scandinavian |
\(Fn | Fn | florin |
Units:
Input | Rendered | Description |
\(de | ° | degree |
\(%0 | %0 | per-thousand |
\(fm | minute | |
\(sd | sd | second |
\(mc | mc | micro |
\(Of | Of | Spanish female ordinal |
\(Om | Om | Spanish masculine ordinal |
Greek letters:
Input | Rendered | Description |
\(*A | Α | Alpha |
\(*B | Β | Beta |
\(*G | Γ | Gamma |
\(*D | ∆ | Delta |
\(*E | Ε | Epsilon |
\(*Z | Ζ | Zeta |
\(*Y | Η | Eta |
\(*H | Θ | Theta |
\(*I | Ι | Iota |
\(*K | Κ | Kappa |
\(*L | Λ | Lambda |
\(*M | Μ | Mu |
\(*N | Ν | Nu |
\(*C | Ξ | Xi |
\(*O | Ο | Omicron |
\(*P | Π | Pi |
\(*R | Ρ | Rho |
\(*S | Σ | Sigma |
\(*T | Τ | Tau |
\(*U | Υ | Upsilon |
\(*F | Φ | Phi |
\(*X | Χ | Chi |
\(*Q | Ψ | Psi |
\(*W | Ω | Omega |
\(*a | α | alpha |
\(*b | ß | beta |
\(*g | γ | gamma |
\(*d | δ | delta |
\(*e | ε | epsilon |
\(*z | ζ | zeta |
\(*y | η | eta |
\(*h | θ | theta |
\(*i | ι | iota |
\(*k | κ | kappa |
\(*l | λ | lambda |
\(*m | µ | mu |
\(*n | ν | nu |
\(*c | ξ | xi |
\(*o | ο | omicron |
\(*p | π | pi |
\(*r | ρ | rho |
\(*s | σ | sigma |
\(*t | τ | tau |
\(*u | υ | upsilon |
\(*f | φ | phi |
\(*x | χ | chi |
\(*q | ψ | psi |
\(*w | ω | omega |
\(+h | +h | theta variant |
\(+f | +f | phi variant |
\(+p | +p | pi variant |
\(+e | +e | epsilon variant |
\(ts | ς | sigma terminal |
Their syntax is similar to special characters, using '\*X' (for a one-character escape), '\*(XX' (two-character), and '\*[N]' (N-character).
Input | Rendered | Description |
\*(Ba | | | vertical bar |
\*(Ne | ≠ | not equal |
\*(Ge | ≥ | greater-than-equal |
\*(Le | ≤ | less-than-equal |
\*(Gt | > | greater-than |
\*(Lt | < | less-than |
\*(Pm | ± | plus-minus |
\*(If | ∞ | infinity |
\*(Pi | π | pi |
\*(Na | NaN | NaN |
\*(Am | (Am | ampersand |
\*R | R | restricted mark |
\*(Tm | (Tm | trade mark |
\*q | q | double-quote |
\*(Rq | ” | right-double-quote |
\*(Lq | “ | left-double-quote |
\*(lp | ( | right-parenthesis |
\*(rp | ) | left-parenthesis |
\*(lq | “ | left double-quote |
\*(rq | ” | right double-quote |
\*(ua | ↑ | up arrow |
\*(va | (va | up-down arrow |
\*(<= | ≤ | less-than-equal |
\*(>= | ≥ | greater-than-equal |
\*(aa | ´ | acute |
\*(ga | ` | grave |
\*(Px | (Px | POSIX standard name |
\*(Ai | (Ai | ANSI standard name |
\[uXXXX] and \CaquXXXXaq
are interpreted as Unicode codepoints. The codepoint must be in the range above U+0080 and less than U+10FFFF. For compatibility, the hexadecimal digits 'A' to 'F' must be given as uppercase characters, and points must be zero-padded to four characters; if greater than four characters, no zero padding is allowed. Unicode surrogates are not allowed.
\Naqnumberaq and \[ charnumber]
escape sequences, inserting the character number from the current character set into the output. Of course, this is inherently non-portable and is already marked as deprecated in the Heirloom roff manual; on top of that, the second form is a GNU extension. For example, do not use \Naq34aq or \[char34], use \(dq, or even the plain 'dq' character where possible.
The \Naqaq escape sequence is limited to printable characters; in groff, it accepts arbitrary character numbers. | |
In
| |
In
| |
The
| |
The \[radicalex], \[sqrtex], and \(ru special characters have been omitted from mandoc either because they are poorly documented or they have no known representation. | |
MANDOC_CHAR (7) | $Mdocdate: October 31 2020 $ |
Main index | Section 7 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | Hang in there, people suffering from natural disasters and deadly diseases - we're putting ribbons on our cars as fast as we can | ” |
— Artur Bagyants |