tail head cat sleep
QR code linking to this page

Manual Pages  — MANDOC_CHAR


mandoc_char – mandoc special characters



This page documents the roff(7) escape sequences accepted by mandoc(1) to represent special characters in mdoc(7) and man(7) documents.

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 -T arguments. In ASCII output, the rendering of some characters may be hard to interpret for the reader. Many are rendered as descriptive strings like "<integral>", "<degree>", or "<Gamma>", which may look ugly, and many are replaced by similar ASCII characters. In particular, accented characters are usually shown without the accent. For that reason, try to avoid using any of the special characters documented here except those discussed in the DESCRIPTION, unless they are essential for explaining the subject matter at hand, for example when documenting complicated mathematical functions.

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.

Dashes and Hyphens

In typography there are different types of dashes of various width: the hyphen (&#173;), the en-dash (-), the em-dash (&#151;), and the mathematical minus sign (-).

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:


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 -T utf8 and -T html. But currently, no practically relevant manual page formatter requires that subtlety, so in manual pages, it is sufficient to write plain '-' to represent hyphen, minus, and hyphen-minus.

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.


To separate words in normal text, for indenting and alignment in literal context, and when none of the following special cases apply, just use the normal space character (' ').

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 \ \&


On request and macro lines, the double-quote character ('dq') is handled specially to allow quoting. One way to prevent this special handling is by using the '\(dq' escape sequence.

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.


In output modes supporting such special output characters, for example -T pdf, and sometimes less consistently in -T utf8, some roff(7) formatters convert the following ASCII input characters to the following Unicode special output characters:

U+2018 left single quotation mark

U+2019 right single quotation mark

U+02DC small tilde

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:

U+0060 grave accent

U+0027 apostrophe

U+007E tilde

U+005E circumflex accent


The period ('amp;.') is handled specially at the beginning of an input line, where it introduces a roff(7) request or a macro, and when appearing alone as a macro argument in mdoc(7). In such situations, prepend a zero-width space ('\&.') to make it behave like normal text.

Do not use the '\.' escape sequence. It does not prevent special handling of the period.


To include a literal backslash ('\') into the output, use the ('\e') escape sequence.

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.


Special characters are encoded as '\X' (for a one-character escape), '\(XX' (two-character), and '\[N]' (N-character). For details, see the Special Characters subsection of the roff(7) manual.

Spaces, non-breaking unless stated otherwise:
Input Description

'\ amp;
unpaddable space'

paddable space

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

Input Rendered Description

&#175; bar

| box rule

_ underscore

_ underscore (width 0.5m)

&#150; overline

bb broken bar

/ forward slash

rs backward slash

Text markers:
Input Rendered Description

O circle

&#187; bullet

&#135; double dagger

&#134; dagger

lz lozenge

[] white square

ps paragraph

&#167; section

&lt;= left hand

=&gt; right hand

at at

sh hash (pound)

CR carriage return

OK check mark

CL club suit

P spade suit

HE heart suit

DI diamond suit

Legal symbols:
Input Rendered Description

&#169; copyright

&#174; registered

&#174; trademarked

Input Rendered Description

&#151; em-dash

- en-dash

&#173; hyphen

\ back-slash

. period

r! upside-down exclamation

r? upside-down question

Input Rendered Description

Bq right low double-quote

bq right low single-quote

&#147; left double-quote

&#148; right double-quote

oq left single-quote

cq right single-quote

aq apostrophe quote (ASCII character)

dq double quote (ASCII character)

Fo left guillemet

Fc right guillemet

fo left single guillemet

fc right single guillemet

Input Rendered Description

lB left bracket

rB right bracket

lC left brace

rC right brace

la left angle

ra right angle

| brace extension (special font)

[braceex] brace extension

[bracketlefttp] top-left hooked bracket

[bracketleftbt] bottom-left hooked bracket

[bracketleftex] left hooked bracket extension

[bracketrighttp] top-right hooked bracket

[bracketrightbt] bottom-right hooked bracket

[bracketrightex] right hooked bracket extension

( top-left hooked brace

[bracelefttp] top-left hooked brace

| mid-left hooked brace

[braceleftmid] mid-left hooked brace

( bottom-left hooked brace

[braceleftbt] bottom-left hooked brace

[braceleftex] left hooked brace extension

) top-left hooked brace

[bracerighttp] top-right hooked brace

| mid-right hooked brace

[bracerightmid] mid-right hooked brace

) bottom-right hooked brace

[bracerightbt] bottom-right hooked brace

[bracerightex] right hooked brace extension

[parenlefttp] top-left hooked parenthesis

[parenleftbt] bottom-left hooked parenthesis

[parenleftex] left hooked parenthesis extension

[parenrighttp] top-right hooked parenthesis

[parenrightbt] bottom-right hooked parenthesis

[parenrightex] right hooked parenthesis extension

Input Rendered Description

&lt;- left arrow

-&gt; right arrow

<> left-right arrow

v down arrow

up arrow

va up-down arrow

lA left double-arrow

rA right double-arrow

hA left-right double-arrow

uA up double-arrow

dA down double-arrow

vA up-down double-arrow

an horizontal arrow extension

Input Rendered Description

AN logical and

OR logical or

[tno] logical not (text font)

&#172; logical not (special font)

te existential quantifier

fa universal quantifier

st such that

tf therefore

3d therefore

| bitwise or

Input Rendered Description

- minus (text font)

- minus (special font)

+ plus (text font)

+ plus (special font)

-+ minus-plus

[t+-] plus-minus (text font)

&#177; plus-minus (special font)

pc center-dot

[tmu] multiply (text font)

&#181; multiply (special font)

c* circle-multiply

c+ circle-plus

[tdi] divide (text font)

&#247; divide (special font)

f/ fraction

* asterisk



&#171; much less

&#187; much greater

= equal

!= not equal

== equivalent

ne not equivalent

&#126; tilde operator

|= asymptotically equal

=~ approximately equal

~~ almost equal

~= almost equal

~ proportionate

&#216; empty set

e element

nm not element

( proper subset

nb not subset

) proper superset

nc not superset

(= reflexive subset

=) reflexive superset

^ intersection

U union

/_ angle

pp perpendicular


[integral] integral

[sum] summation

[product] product

[coproduct] coproduct

V gradient

square root

[sqrt] square root

| left-ceiling

| right-ceiling

| left-floor

| right-floor


Ah aleph

Im imaginary

&#174;e real

wp Weierstrass p

6 partial differential

-h Planck constant over 2π

[hbar] Planck constant over 2π

&#189; one-half

&#188; one-fourth

&#190; three-fourths

18 one-eighth

38 three-eighths

58 five-eighths

78 seven-eighths

1 superscript 1

2 superscript 2

3 superscript 3

Input Rendered Description

ff ff ligature

fi fi ligature

fl fl ligature

ffi ffi ligature

ffl ffl ligature

&#198; AE

&#230; ae


oe oe

ss German eszett

IJ IJ ligature

ij ij ligature

Input Rendered Description

a" Hungarian umlaut

a- macron

a. dotted

a^ circumflex

&#180; acute


&#96; grave


ab breve

ac cedilla

ad dieresis

ah caron

ao ring

a~ tilde

ho ogonek

ha hat (ASCII character)

ti tilde (ASCII character)

Accented letters:
Input Rendered Description

&#193; acute A

&#201; acute E

&#205; acute I

&#211; acute O

&#218; acute U

'Y acute Y

&#225; acute a

&#233; acute e

&#237; acute i

&#243; acute o

&#250; acute u

'y acute y

&#192; grave A

&#200; grave E

&#204; grave I

&#210; grave O

&#217; grave U

&#224; grave a

&#232; grave e

&#236; grave i

&#236; grave o

&#249; grave u

&#195; tilde A

&#209; tilde N

&#213; tilde O

&#227; tilde a

&#241; tilde n

&#245; tilde o

&#196; dieresis A

&#203; dieresis E

&#207; dieresis I

&#214; dieresis O

&#220; dieresis U

&#228; dieresis a

&#235; dieresis e

&#239; dieresis i

&#246; dieresis o

&#252; dieresis u

&#255; dieresis y

&#194; circumflex A

&#202; circumflex E

&#206; circumflex I

&#212; circumflex O

&#219; circumflex U

&#226; circumflex a

&#234; circumflex e

&#238; circumflex i

&#244; circumflex o

&#251; circumflex u

&#199; cedilla C

&#231; cedilla c

/L stroke L

/l stroke l

/O stroke O

/o stroke o

&#197; ring A

&#229; ring a

Special letters:
Input Rendered Description

&#208; Eth

d eth

TP Thorn

Tp thorn

.i dotless i

.j dotless j

Input Rendered Description

Do dollar

&#162; cent

Eu Euro symbol

eu Euro symbol

Ye yen

Po pound

Cs Scandinavian

Fn florin

Input Rendered Description

&#176; degree

%0 per-thousand


sd second

mc micro

Of Spanish female ordinal

Om Spanish masculine ordinal

Greek letters:
Input Rendered Description

Α Alpha

Β Beta

Γ Gamma


Ε Epsilon

Ζ Zeta

Η Eta

Θ Theta

Ι Iota

Κ Kappa

Λ Lambda

Μ Mu

Ν Nu

Ξ Xi

Ο Omicron

Π Pi

Ρ Rho

Σ Sigma

Τ Tau

Υ Upsilon

Φ Phi

Χ Chi

Ψ Psi


α alpha

&#223; beta

γ gamma

δ delta

ε epsilon

ζ zeta

η eta

θ theta

ι iota

κ kappa

λ lambda

µ mu

ν nu

ξ xi

ο omicron

π pi

ρ rho

σ sigma

τ tau

υ upsilon

φ phi

χ chi

ψ psi

ω omega

+h theta variant

+f phi variant

+p pi variant

+e epsilon variant

ς sigma terminal


Predefined strings are inherited from the macro packages of historical troff implementations. They are not recommended for use, as they differ across implementations. Manuals using these predefined strings are almost certainly not portable.

Their syntax is similar to special characters, using '\*X' (for a one-character escape), '\*(XX' (two-character), and '\*[N]' (N-character).
Input Rendered Description

| vertical bar

not equal



> greater-than

< less-than

&#177; plus-minus


π pi


(Am ampersand

R restricted mark

(Tm trade mark

q double-quote

&#148; right-double-quote

&#147; left-double-quote

( right-parenthesis

) left-parenthesis

&#147; left double-quote

&#148; right double-quote

up arrow

(va up-down arrow



&#180; acute

&#96; grave

(Px POSIX standard name

(Ai ANSI standard name


The escape sequences

    \[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.


For backward compatibility with existing manuals, mandoc(1) also supports the

    \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.


This section documents compatibility between mandoc and other troff implementations, at this time limited to GNU troff ("groff").

The \Naqaq escape sequence is limited to printable characters; in groff, it accepts arbitrary character numbers.
In -T ascii, the \(ss, \(nm, \(nb, \(nc, \(ib, \(ip, \(pp, \[sum], \[product], \[coproduct], \(gr, \(-h, and \(a. special characters render differently between mandoc and groff.
In -T html, the \(ti=, \(nb, and \(nc special characters render differently between mandoc and groff.
The -T ps and -T pdf modes format like -T ascii instead of rendering glyphs as in groff.
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(1), man(7), mdoc(7), roff(7)


The mandoc_char manual page was written by Kristaps Dzonsons <Mt kristaps@bsd.lv>.


The predefined string '\*(Ba' mimics the behaviour of the 'amp;|' character in mdoc(7); thus, if you wish to render a vertical bar with no side effects, use the '\(ba' escape.

MANDOC_CHAR (7) $Mdocdate: October 31 2020 $

tail head cat sleep
QR code linking to this page

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