groff

package: groff-base

title: groff(7)

text:
# groff(7)

## NAME
groff - a short reference for the GNU roff language

## DESCRIPTION
The name groff stands for GNU roff and is the free implementation of the roff type-setting system. See roff(7) for a survey and the background of the groff system.

This document gives only short descriptions of the predefined roff language elements as used in groff. Both the classical features and the groff extensions are provided.

Historically, the roff language was called troff. groff is compatible with the classical system and provides proper extensions. So in GNU, the terms roff, troff, and groff language could be used as synonyms. However troff slightly tends to refer more to the classical aspects, whereas groff emphasizes the GNU extensions, and roff is the general term for the language.

This file is only a short version of the complete documentation that is found in the groff info(1) file, which contains more detailed, actual, and concise information.

The general syntax for writing groff documents is relatively easy, but writing extensions to the roff language can be a bit harder.

The roff language is line-oriented. There are only two kinds of lines, control lines and text lines. The control lines start with a control character, by default a period “.” or a single quote “'”; all other lines are text lines.

Control lines represent commands, optionally with arguments. They have the following syntax. The leading control character can be followed by a command name; arguments, if any, are separated by spaces (but not tab characters) from the command name and among themselves, for example,

.command_name arg1 arg2

For indentation, any number of space or tab characters can be inserted between the leading control character and the command name, but the control character must be on the first position of the line.

Text lines represent the parts that is printed. They can be modified by escape sequences, which are recognized by a leading backslash ‘\’. These are in-line or even in-word formatting elements or functions. Some of these take arguments separated by single quotes “'”, others are regulated by a length encoding introduced by an open parenthesis ‘(’ or enclosed in brackets ‘[’ and ‘]’.

The roff language provides flexible instruments for writing language extension, such as macros. When interpreting macro definitions, the roff system enters a special operating mode, called the copy mode.

The copy mode behaviour can be quite tricky, but there are some rules that ensure a safe usage.

1.

Printable backslashes must be denoted as \e. To be more precise, \e represents the current escape character. To get a backslash glyph, use \(rs or \[rs].

2.

Double all backslashes.

3.

Begin all text lines with the special non-spacing character \&.

This does not produce the most efficient code, but it should work as a first measure. For better strategies, see the groff info file and groff_tmac(5).

Reading roff source files is easier, just reduce all double backslashes to a single one in all macro definitions.

## GROFF ELEMENTS
The roff language elements add formatting information to a text file. The fundamental elements are predefined commands and variables that make roff a full-blown programming language.

There are two kinds of roff commands, possibly with arguments. Requests are written on a line of their own starting with a dot ‘.’ or a “'”, whereas Escape sequences are in-line functions and in-word formatting elements starting with a backslash ‘\’.

The user can define her own formatting commands using the de request. These commands are called macros, but they are used exactly like requests. Macro packages are pre-defined sets of macros written in the groff language. A user's possibilities to create escape sequences herself is very limited, only special characters can be mapped.

The groff language provides several kinds of variables with different interfaces. There are pre-defined variables, but the user can define her own variables as well.

String variables store character sequences. They are set with the ds request and retrieved by the \* escape sequences. Strings can have variables.

Register variables can store numerical values, numbers with a scale unit, and occasionally string-like objects. They are set with the nr request and retrieved by the \n escape sequences.

Environments allow the user to temporarily store global formatting parameters like line length, font size, etc. for later reuse. This is done by the ev request.

Fonts are identified either by a name or by an internal number. The current font is chosen by the ft request or by the \f escape sequences. Each device has special fonts, but the following fonts are available for all devices. R is the standard font Roman. B is its bold counterpart. The italic font is called I and is available everywhere, but on text devices it is displayed as an underlined Roman font. For the graphical output devices, there exist constant-width pendants of these fonts, CR, CI, and CB. On text devices, all glyphs have a constant width anyway.

Glyphs are visual representation forms of characters. In groff, the distinction between those two elements is not always obvious (and a full discussion is beyond the scope of this man page). A first approximation is that glyphs have a specific size and colour and are taken from a specific font; they can't be modified any more – characters are the input, and glyphs are the output. As soon as an output line has been generated, it no longer contains characters but glyphs. In this man page, we use either ‘glyph’ or ‘character’, whatever is more appropriate.

Moreover, there are some advanced roff elements. A diversion stores (formatted) information into a macro for later usage. A trap is a positional condition like a certain number of lines from page top or in a diversion or in the input. Some action can be prescribed to be run automatically when the condition is met.

More detailed information and examples can be found in the groff info file.

## CONTROL CHARACTERS
There is a small set of characters that have a special controlling task in certain conditions.

.

A dot is only special at the beginning of a line or after the condition in the requests if, ie, el, and while. There it is the control character that introduces a request (or macro). By using the cc request, the control character can be set to a different character, making the dot ‘.’ a non-special character.

In all other positions, it just means a dot character. In text paragraphs, it is advantageous to start each sentence at a line of its own.

'

The single quote has two controlling tasks. At the beginning of a line and in the conditional requests it is the non-breaking control character. That means that it introduces a request like the dot, but with the additional property that this request doesn't cause a linebreak. By using the c2 request, the non-break control character can be set to a different character.

As a second task, it is the most commonly used argument separator in some functional escape sequences (but any pair of characters not part of the argument do work). In all other positions, it denotes the single quote or apostrophe character. Groff provides a printable representation with the \(cq escape sequence.

"

The double quote is used to enclose arguments in macros (but not in requests and strings). In the ds and as requests, a leading double quote in the argument is stripped off, making everything else afterwards the string to be defined (enabling leading whitespace). The escaped double quote \" introduces a comment. Otherwise, it is not special. Groff provides a printable representation with the \(dq escape sequence.

\

The backslash usually introduces an escape sequence (this can be changed with the ec request). A printed version of the escape character is the \e escape; a backslash glyph can be obtained by \(rs.

(

The open parenthesis is only special in escape sequences when introducing an escape name or argument consisting of exactly two characters. In groff, this behaviour can be replaced by the [] construct.

[

The opening bracket is only special in groff escape sequences; there it is used to introduce a long escape name or long escape argument. Otherwise, it is non-special, e.g. in macro calls.

]

The closing bracket is only special in groff escape sequences; there it terminates a long escape name or long escape argument. Otherwise, it is non-special.

space

Space characters are only functional characters. They separate the arguments in requests, macros, and strings, and the words in text lines. They are subject to groff's horizontal spacing calculations. To get a defined space width, escape sequences like ‘\ ’ (this is the escape character followed by a space), \|, \^, or \h should be used.

newline

In text paragraphs, newlines mostly behave like space characters. Continuation lines can be specified by an escaped newline, i.e., by specifying a backslash ‘\’ as the last character of a line.

tab

If a tab character occurs during text the interpreter makes a horizontal jump to the next pre-defined tab position. There is a sophisticated interface for handling tab positions.

## NUMERICAL EXPRESSIONS
A numerical value is a signed or unsigned integer or float with or without an appended scaling indicator. A scaling indicator is a one-character abbreviation for a unit of measurement. A number followed by a scaling indicator signifies a size value. By default, numerical values do not have a scaling indicator, i.e., they are normal numbers.

The roff language defines the following scaling indicators.

c

Centimeter

i

Inch

P

Pica = 1/6 inch

p

Point = 1/72 inch

m

Em = the font size in points (approx. width of letter ‘m’)

M

100th of an Em

n

En = Em/2

u

Basic unit for actual output device

v

Vertical line space in basic units scaled point = 1/sizescale of a point (defined in font DESC file)

f

Scale by 65536.

Numerical expressions are combinations of the numerical values defined above with the following arithmetical operators already defined in classical troff.

+

Addition

-

Subtraction

*

Multiplication

/

Division

%

Modulo

=

Equals

==

Equals

<

Less than

>

Greater than

<=

Less or equal

>=

Greater or equal

&

Logical and

:

Logical or

!

Logical not

(

Grouping of expressions

)

Close current grouping

Moreover, groff added the following operators for numerical expressions:

e1>?e2

The maximum of e1 and e2.

e1<?e2

The minimum of e1 and e2.

(c;e)

Evaluate e using c as the default scaling indicator.

For details see the groff info file.

## CONDITIONS
Conditions occur in tests raised by the if, ie, and the while requests. The following table characterizes the different types of conditions.

N

A numerical expression N yields true if its value is greater than 0.

!N

True if the value of N is 0 (see below).

's1's2'

True if string s1 is identical to string s2.

!'s1's2'

True if string s1 is not identical to string s2 (see below).

cch

True if there is a glyph ch available.

dname

True if there is a string, macro, diversion, or request called name.

e

Current page number is even.

o

Current page number is odd.

mname

True if there is a color called name.

n

Formatter is nroff.

rreg

True if there is a register named reg.

t

Formatter is troff.

Ffont

True if there exists a font named font.

Sstyle

True if a style named style has been registered.

Note that the ! operator may only appear at the beginning of an expression, and negates the entire expression. This maintains bug-compatibility with AT&T troff.

## REQUESTS
This section provides a short reference for the predefined requests. In groff, request, macro, and string names can be arbitrarily long. No bracketing or marking of long names is needed.

Most requests take one or more arguments. The arguments are separated by space characters (no tabs!); there is no inherent limit for their length or number.

Some requests have optional arguments with a different behaviour. Not all of these details are outlined here. Refer to the groff info file and groff_diff(7) for all details.

In the following request specifications, most argument names were chosen to be descriptive. Only the following denotations need clarification.

c

denotes a single character.

font

a font either specified as a font name or a font number.

anything

all characters up to the end of the line or within \{ and \}.

n

is a numerical expression that evaluates to an integer value.

N

is an arbitrary numerical expression, signed or unsigned.

±N

has three meanings depending on its sign, described below.

If an expression defined as ±N starts with a ‘+’ sign the resulting value of the expression is added to an already existing value inherent to the related request, e.g. adding to a number register. If the expression starts with a ‘-’ the value of the expression is subtracted from the request value.

Without a sign, N replaces the existing value directly. To assign a negative number either prepend 0 or enclose the negative number in parentheses.

### Request Short Reference
.

Empty line, ignored. Useful for structuring documents.

.\" anything

Complete line is a comment.

.ab string

Print string on standard error, exit program.

.ad

Begin line adjustment for output lines in current adjust mode.

.ad c

Start line adjustment in mode c (c=l,r,c,b,n).

.af register c

Assign format c to register (c=l,i,I,a,A).

.aln alias register

Create alias name for register.

.als alias object

Create alias name for request, string, macro, or diversion object.

.am macro

Append to macro until .. is encountered.

.am macro end

Append to macro until .end is called.

.am1 macro

Same as .am but with compatibility mode switched off during macro expansion.

.am1 macro end

Same as .am but with compatibility mode switched off during macro expansion.

.ami macro

Append to a macro whose name is contained in the string register macro until .. is encountered.

.ami macro end

Append to a macro indirectly. macro and end are string registers whose contents are interpolated for the macro name and the end macro, respectively.

.ami1 macro

Same as .ami but with compatibility mode switched off during macro expansion.

.ami1 macro end

Same as .ami but with compatibility mode switched off during macro expansion.

.as stringvar anything

Append anything to stringvar.

.as1 stringvar anything

Same as .as but with compatibility mode switched off during string expansion.

.asciify diversion

Unformat ASCII characters, spaces, and some escape sequences in diversion.

.backtrace

Print a backtrace of the input on stderr.

.bd font N

Embolden font by N-1 units.

.bd S font N

Embolden Special Font S when current font is font.

.blm

Unset the blank line macro.

.blm macro

Set the blank line macro to macro.

.box

End current diversion.

.box macro

Divert to macro, omitting a partially filled line.

.boxa

End current diversion.

.boxa macro

Divert and append to macro, omitting a partially filled line.

.bp

Eject current page and begin new page.

.bp ±N

Eject current page; next page number ±N.

.br

Line break.

.brp

Break and spread output line. Same as \p.

.break

Break out of a while loop.

.c2

Reset no-break control character to “'”.

.c2 c

Set no-break control character to c.

.cc

Reset control character to ‘.’.

.cc c

Set control character to c.

.ce

Center the next input line.

.ce N

Center following N input lines.

.cf filename

Copy contents of file filename unprocessed to stdout or to the diversion.

.cflags mode c1 c2 ...

Treat characters c1, c2, ... according to mode number.

.ch trap N

Change trap location to N.

.char c anything

Define entity c as string anything.

.chop object

Chop the last character off macro, string, or diversion object.

.class name c1 c2 ...

Assign a set of characters, character ranges, or classes c1, c2, ... to name.

.close stream

Close the stream.

.color

Enable colors.

.color N

If N is zero disable colors, otherwise enable them.

.composite from to

Map glyph name from to glyph name to while constructing a composite glyph name.

.continue

Finish the current iteration of a while loop.

.cp

Enable compatibility mode.

.cp N

If N is zero disable compatibility mode, otherwise enable it.

.cs font N M

Set constant character width mode for font to N/36 ems with em M.

.cu N

Continuous underline in nroff, like .ul in troff.

.da

End current diversion.

.da macro

Divert and append to macro.

.de macro

Define or redefine macro until .. is encountered.

.de macro end

Define or redefine macro until .end is called.

.de1 macro

Same as .de but with compatibility mode switched off during macro expansion.

.de1 macro end

Same as .de but with compatibility mode switched off during macro expansion.

.defcolor color scheme component

Define or redefine a color with name color. scheme can be rgb, cym, cymk, gray, or grey. component can be single components specified as fractions in the range 0 to 1 (default scaling indicator f), as a string of two-digit hexadecimal color components with a leading #, or as a string of four-digit hexadecimal components with two leading #. The color default can't be redefined.

.dei macro

Define or redefine a macro whose name is contained in the string register macro until .. is encountered.

.dei macro end

Define or redefine a macro indirectly. macro and end are string registers whose contents are interpolated for the macro name and the end macro, respectively.

.dei1 macro

Same as .dei but with compatibility mode switched off during macro expansion.

.dei1 macro end

Same as .dei but with compatibility mode switched off during macro expansion.

.device anything

Write anything to the intermediate output as a device control function.

.devicem name

Write contents of macro or string name uninterpreted to the intermediate output as a device control function.

.di

End current diversion.

.di macro

Divert to macro.

.do name

Interpret .name with compatibility mode disabled.

.ds stringvar anything

Set stringvar to anything.

.ds1 stringvar anything

Same as .ds but with compatibility mode switched off during string expansion.

.dt N trap

Set diversion trap to position N (default scaling indicator v).

.ec

Reset escape character to ‘\’.

.ec c

Set escape character to c.

.ecr

Restore escape character saved with .ecs.

.ecs

Save current escape character.

.el anything

Else part for if-else (ie) request.

.em macro

The macro is run after the end of input.

.eo

Turn off escape character mechanism.

.ev

Switch to previous environment and pop it off the stack.

.ev env

Push down environment number or name env to the stack and switch to it.

.evc env

Copy the contents of environment env to the current environment. No pushing or popping.

.ex

Exit from roff processing.

.fam

Return to previous font family.

.fam name

Set the current font family to name.

.fc

Disable field mechanism.

.fc a

Set field delimiter to a and pad glyph to space.

.fc a b

Set field delimiter to a and pad glyph to b.

.fchar c anything

Define fallback character (or glyph) c as string anything.

.fcolor

Set fill color to previous fill color.

.fcolor c

Set fill color to c.

.fi

Fill output lines.

.fl

Flush output buffer.

.fp n font

Mount font on position n.

.fp n internal external

Mount font with long external name to short internal name on position n.

.fschar f c anything

Define fallback character (or glyph) c for font f as string anything.

.fspecial font

Reset list of special fonts for font to be empty.

.fspecial font s1 s2 ...

When the current font is font, then the fonts s1, s2, ... are special.

.ft

Return to previous font. Same as \f[] or \fP.

.ft font

Change to font name or number font; same as \f[font] escape sequence.

.ftr font1 font2

Translate font1 to font2.

.fzoom font

Don't magnify font.

.fzoom font zoom

Set zoom factor for font (in multiples of 1/1000th).

.gcolor

Set glyph color to previous glyph color.

.gcolor c

Set glyph color to c.

.hc

Remove additional hyphenation indicator character.

.hc c

Set up additional hyphenation indicator character c.

.hcode c1 code1 c2 code2 ...

Set the hyphenation code of character c1 to code1, that of c2 to code2, etc.

.hla lang

Set the current hyphenation language to lang.

.hlm n

Set the maximum number of consecutive hyphenated lines to n.

.hpf file

Read hyphenation patterns from file.

.hpfa file

Append hyphenation patterns from file.

.hpfcode a b c d ...

Set input mapping for .hpf.

.hw words

List of words with exceptional hyphenation.

.hy N

Switch to hyphenation mode N.

.hym n

Set the hyphenation margin to n (default scaling indicator m).

.hys n

Set the hyphenation space to n.

.ie cond anything

If cond then anything else goto .el.

.if cond anything

If cond then anything; otherwise do nothing.

.ig

Ignore text until .. is encountered.

.ig end

Ignore text until .end is called.

.in

Change to previous indentation value.

.in ±N

Change indentation according to ±N (default scaling indicator m).

.it N trap

Set an input-line count trap for the next N lines.

.itc N trap

Same as .it but count lines interrupted with \c as one line.

.kern

Enable pairwise kerning.

.kern n

If n is zero, disable pairwise kerning, otherwise enable it.

.lc

Remove leader repetition glyph.

.lc c

Set leader repetition glyph to c.

.length register anything

Write the length of the string anything to register.

.linetabs

Enable line-tabs mode (i.e., calculate tab positions relative to output line).

.linetabs n

If n is zero, disable line-tabs mode, otherwise enable it.

.lf N

Set input line number to N.

.lf N file

Set input line number to N and filename to file.

.lg N

Ligature mode on if N>0.

.ll

Change to previous line length.

.ll ±N

Set line length according to ±N (default length 6.5i, default scaling indicator m).

.lsm

Unset the leading spaces macro.

.lsm macro

Set the leading spaces macro to macro.

.ls

Change to the previous value of additional intra-line skip.

.ls N

Set additional intra-line skip value to N, i.e., N-1 blank lines are inserted after each text output line.

.lt ±N

Length of title (default scaling indicator m).

.mc

Margin glyph off.

.mc c

Print glyph c after each text line at actual distance from right margin.

.mc c N

Set margin glyph to c and distance to N from right margin (default scaling indicator m).

.mk register

Mark current vertical position in register.

.mso file

The same as .so except that file is searched in the tmac directories.

.na

No output-line adjusting.

.ne

Need a one-line vertical space.

.ne N

Need N vertical space (default scaling indicator v).

.nf

No filling or adjusting of output-lines.

.nh

No hyphenation.

.nm

Number mode off.

.nm ±N [M [S [I]]]

In line number mode, set number, multiple, spacing, and indentation.

.nn

Do not number next line.

.nn N

Do not number next N lines.

.nop anything

Always process anything.

.nr register ±N [M]

Define or modify register using ±N with auto-increment M.

.nroff

Make the built-in conditions n true and t false.

.ns

Turn on no-space mode.

.nx

Immediately jump to end of current file.

.nx filename

Immediately continue processing with file file.

.open stream filename

Open filename for writing and associate the stream named stream with it.

.opena stream filename

Like .open but append to it.

.os

Output vertical distance that was saved by the sv request.

.output string

Emit string directly to intermediate output, allowing leading whitespace if string starts with " (which is stripped off).

.pc

Reset page number character to ‘%’.

.pc c

Page number character.

.pev

Print the current environment and each defined environment state to stderr.

.pi program

Pipe output to program (nroff only).

.pl

Set page length to default 11i. The current page length is stored in register .p.

.pl ±N

Change page length to ±N (default scaling indicator v).

.pm

Print macro names and sizes (number of blocks of 128 bytes).

.pm t

Print only total of sizes of macros (number of 128 bytes blocks).

.pn ±N

Next page number N.

.pnr

Print the names and contents of all currently defined number registers on stderr.

.po

Change to previous page offset. The current page offset is available in register .o.

.po ±N

Page offset N.

.ps

Return to previous point size.

.ps ±N

Point size; same as \s[±N].

.psbb filename

Get the bounding box of a PostScript image filename.

.pso command

This behaves like the so request except that input comes from the standard output of command.

.ptr

Print the names and positions of all traps (not including input line traps and diversion traps) on stderr.

.pvs

Change to previous post-vertical line spacing.

.pvs ±N

Change post-vertical line spacing according to ±N (default scaling indicator p).

.rchar c1 c2 ...

Remove the definitions of entities c1, c2, ...

.rd prompt

Read insertion.

.return

Return from a macro.

.return anything

Return twice, namely from the macro at the current level and from the macro one level higher.

.rfschar f c1 c2 ...

Remove the definitions of entities c1, c2, ... for font f.

.rj n

Right justify the next n input lines.

.rm name

Remove request, macro, or string name.

.rn old new

Rename request, macro, or string old to new.

.rnn reg1 reg2

Rename register reg1 to reg2.

.rr register

Remove register.

.rs

Restore spacing; turn no-space mode off.

.rt ±N

Return (upward only) to marked vertical place (default scaling indicator v).

.schar c anything

Define global fallback character (or glyph) c as string anything.

.shc

Reset soft hyphen glyph to \(hy.

.shc c

Set the soft hyphen glyph to c.

.shift n

In a macro, shift the arguments by n positions.

.sizes s1 s2 ... sn [0]

Set available font sizes similar to the sizes command in a DESC file.

.so filename

Include source file.

.sp

Skip one line vertically.

.sp N

Space vertical distance N up or down according to sign of N (default scaling indicator v).

.special

Reset global list of special fonts to be empty.

.special s1 s2 ...

Fonts s1, s2, etc. are special and are searched for glyphs not in the current font.

.spreadwarn

Toggle the spread warning on and off without changing its value.

.spreadwarn limit

Emit a warning if each space in an output line is widened by limit or more (default scaling indicator m).

.ss N

Set space glyph size to N/12 of the space width in the current font.

.ss N M

Set space glyph size to N/12 and sentence space size set to M/12 of the space width in the current font.

.sty n style

Associate style with font position n.

.substring xx n1 n2

Replace the string named xx with the substring defined by the indices n1 and n2.

.sv

Save 1 v of vertical space.

.sv N

Save the vertical distance N for later output with os request (default scaling indicator v).

.sy command-line

Execute program command-line.

.ta T N

Set tabs after every position that is a multiple of N (default scaling indicator m).

.ta n1 n2 ... nn T r1 r2 ... rn

Set tabs at positions n1, n2, ..., nn, then set tabs at nn+r1, nn+r2, ..., nn+rn, then at nn+rn+r1, nn+rn+r2, ..., nn+rn+rn, and so on.

.tc

Remove tab repetition glyph.

.tc c

Set tab repetition glyph to c.

.ti ±N

Temporary indent next line (default scaling indicator m).

.tkf font s1 n1 s2 n2

Enable track kerning for font.

.tl ’left’center’right’

Three-part title.

.tm anything

Print anything on stdout.

.tm1 anything

Print anything on stdout, allowing leading whitespace if anything starts with " (which is stripped off).

.tmc anything

Similar to .tm1 without emitting a final newline.

.tr abcd...

Translate a to b, c to d, etc. on output.

.trf filename

Transparently output the contents of file filename.

.trin abcd...

This is the same as the tr request except that the asciify request uses the character code (if any) before the character translation.

.trnt abcd...

This is the same as the tr request except that the translations do not apply to text that is transparently throughput into a diversion with \!.

.troff

Make the built-in conditions t true and n false.

.uf font

Set underline font to font (to be switched to by .ul).

.ul N

Underline (italicize in troff) N input lines.

.unformat diversion

Unformat space characters and tabs in diversion, preserving font information.

.vpt n

Enable vertical position traps if n is non-zero, disable them otherwise.

.vs

Change to previous vertical base line spacing.

.vs ±N

Set vertical base line spacing to ±N (default scaling indicator p).

.warn n

Set warnings code to n.

.warnscale si

Set scaling indicator used in warnings to si.

.wh N

Remove (first) trap at position N.

.wh N trap

Set location trap; negative means from page bottom.

.while cond anything

While condition cond is true, accept anything as input.

.write stream anything

Write anything to the stream named stream.

.writec stream anything

Similar to .write without emitting a final newline.

.writem stream xx

Write contents of macro or string xx to the stream named stream.

Besides these standard groff requests, there might be further macro calls. They can originate from a macro package (see roff(7) for an overview) or from a preprocessor.

Preprocessor macros are easy to be recognized. They enclose their code into a pair of characteristic macros.

preprocessor

start macro

end macro

chem

.cstart

.cend

eqn

.EQ

.EN

gideal

.IS

.IE

grap

.G1

.G2

grn

.GS

.GE

.IF

pic

.PS

.PE

refer

.R1

.R2

soelim

none

none

tbl

.TS

.TE

glilypond

.lilypond start

.lilypond stop

gperl

.Perl start

.Perl stop

gpinyin

.pinyin start

.pinyin stop

Note that the ‘ideal’ preprocessor is not available in groff yet.

## ESCAPE SEQUENCES
Escape sequences are in-line language elements usually introduced by a backslash ‘\’ and followed by an escape name and sometimes by a required argument. Input processing is continued directly after the escaped character or the argument (without an intervening separation character). So there must be a way to determine the end of the escape name and the end of the argument.

This is done by enclosing names (escape name and arguments consisting of a variable name) by a pair of brackets [name] and constant arguments (number expressions and characters) by apostrophes (ASCII 0x27) like ’constant’.

There are abbreviations for short names. Two-character escape names can be specified by an opening parenthesis like \(xy or \*(xy without a closing counterpart. And all one-character names different from the special characters ‘[’ and ‘(’ can even be specified without a marker, for example \nc or \$c.

Constant arguments of length 1 can omit the marker apostrophes, too, but there is no two-character analogue.

While one-character escape sequences are mainly used for in-line functions and system related tasks, the two-letter names following the \( construct are glyphs predefined by the roff system; these are called ‘Special Characters’ in the classical documentation. Escapes sequences of the form \[name] denote glyphs too.

### Single-Character Escapes
\"

Start of a comment. Everything up to the end of the line is ignored.

\#

Everything up to and including the next newline is ignored. This is interpreted in copy mode. This is like \" except that the terminating newline is ignored as well.

\*s

The string stored in the string variable with one-character name s.

\*(st

The string stored in the string variable with two-character name st.

\*[string]

The string stored in the string variable with name string (with arbitrary length).

\*[stringvar arg1 arg2 ...]

The string stored in the string variable with arbitrarily long name stringvar, taking arg1, arg2, ... as arguments.

\$0

The name by which the current macro was invoked. The als request can make a macro have more than one name.

\$x

Macro or string argument with one-digit number x in the range 1 to 9.

\$(xy

Macro or string argument with two-digit number xy (larger than zero).

\$[nexp]

Macro or string argument with number nexp, where nexp is a numerical expression evaluating to an integer ≥1.

\$*

In a macro or string, the concatenation of all the arguments separated by spaces.

\$@

In a macro or string, the concatenation of all the arguments with each surrounded by double quotes, and separated by spaces.

\$^

In a macro, the representation of all parameters as if they were an argument to the ds request.

\\

reduces to a single backslash; useful to delay its interpretation as escape character in copy mode. For a printable backslash, use \e, or even better \[rs], to be independent from the current escape character.

\´

The acute accent ´; same as \(aa. Unescaped: apostrophe, right quotation mark, single quote (ASCII 0x27).

\`

The grave accent `; same as \(ga. Unescaped: left quote, backquote (ASCII 0x60).

\-

The - (minus) sign in the current font.

\_

The same as \(ul, the underline character.

\.

The same as a dot (‘.’). Necessary in nested macro definitions so that ‘\\..’ expands to ‘..’.

\%

Default optional hyphenation character.

\!

Transparent line indicator.

\?anything?

In a diversion, this transparently embeds anything in the diversion. anything is read in copy mode. See also the escape sequences \! and \?.

\space

Unpaddable space size space glyph (no line break).

\0

Digit-width space.

\|

1/6 em narrow space glyph; zero width in nroff.

\^

1/12 em half-narrow space glyph; zero width in nroff.

\&

Non-printable, zero-width glyph.

\)

Like \& except that it behaves like a glyph declared with the cflags request to be transparent for the purposes of end-of-sentence recognition.

\/

Increases the width of the preceding glyph so that the spacing between that glyph and the following glyph is correct if the following glyph is a roman glyph.

\,

Modifies the spacing of the following glyph so that the spacing between that glyph and the preceding glyph is correct if the preceding glyph is a roman glyph.

\~

Unbreakable space that stretches like a normal inter-word space when a line is adjusted.

\:

Inserts a zero-width break point (similar to \% but without a soft hyphen character).

\newline

Ignored newline, for continuation lines.

\{

Begin conditional input.

\}

End conditional input.

\(sc

A glyph with two-character name sc; see section Special Characters.

\[name]

A glyph with name name (of arbitrary length).

\[comp1 comp2 ...]

A composite glyph with components comp1, comp2, ...

\a

Non-interpreted leader character.

\A’anything’

If anything is acceptable as a name of a string, macro, diversion, register, environment or font it expands to 1, and to 0 otherwise.

\b’abc...’

Bracket building function.

\B’anything’

If anything is acceptable as a valid numeric expression it expands to 1, and to 0 otherwise.

\c

Interrupt text processing.

\C’glyph’

The glyph called glyph; same as \[glyph], but compatible to other roff versions.

\d

Forward (down) 1/2 em (1/2 line in nroff).

\D’charseq’

Draw a graphical element defined by the characters in charseq; see the groff info file for details.

\e

Printable version of the current escape character.

\E

Equivalent to an escape character, but is not interpreted in copy mode.

\fF

Change to font with one-character name or one-digit number F.

\fP

Switch back to previous font.

\f(fo

Change to font with two-character name or two-digit number fo.

\f[font]

Change to font with arbitrarily long name or number expression font.

\f[]

Switch back to previous font.

\Ff

Change to font family with one-character name f.

\F(fm

Change to font family with two-character name fm.

\F[fam]

Change to font family with arbitrarily long name fam.

\F[]

Switch back to previous font family.

\gr

Return format of register with one-character name r suitable for af request.

\g(rg

Return format of register with two-character name rg suitable for af request.

\g[reg]

Return format of register with arbitrarily long name reg suitable for af request.

\h’N’

Local horizontal motion; move right N (left if negative).

\H’N’

Set height of current font to N.

\kr

Mark horizontal input place in one-character register r.

\k(rg

Mark horizontal input place in two-character register rg.

\k[reg]

Mark horizontal input place in register with arbitrarily long name reg.

\l’Nc’

Horizontal line drawing function (optionally using character c).

\L’Nc’

Vertical line drawing function (optionally using character c).

\mc

Change to color with one-character name c.

\m(cl

Change to color with two-character name cl.

\m[color]

Change to color with arbitrarily long name color.

\m[]

Switch back to previous color.

\Mc

Change filling color for closed drawn objects to color with one-character name c.

\M(cl

Change filling color for closed drawn objects to color with two-character name cl.

\M[color]

Change filling color for closed drawn objects to color with arbitrarily long name color.

\M[]

Switch to previous fill color.

\nr

The numerical value stored in the register variable with the one-character name r.

\n(re

The numerical value stored in the register variable with the two-character name re.

\n[reg]

The numerical value stored in the register variable with arbitrarily long name reg.

\N’n’

Typeset the glyph with index n in the current font. No special fonts are searched. Useful for adding (named) entities to a document using the char request and friends.

\o’abc...’

Overstrike glyphs a, b, c, etc.

\O0

Disable glyph output. Mainly for internal use.

\O1

Enable glyph output. Mainly for internal use.

\p

Break and spread output line.

\r

Reverse 1 em vertical motion (reverse line in nroff).

\R’name ±n’

The same as .nr name ±n.

\s±N

Set/increase/decrease the point size to/by N scaled points; N is a one-digit number in the range 1 to 9. Same as ps request.

\s(±N

\s±(N

Set/increase/decrease the point size to/by N scaled points; N is a two-digit number ≥1. Same as ps request.

\s[±N]

\s±[N]

\s’±N’

\s±’N’

Set/increase/decrease the point size to/by N scaled points. Same as ps request.

\S’N’

Slant output by N degrees.

\t

Non-interpreted horizontal tab.

\u

Reverse (up) 1/2 em vertical motion (1/2 line in nroff).

\v’N’

Local vertical motion; move down N (up if negative).

\Ve

The contents of the environment variable with one-character name e.

\V(ev

The contents of the environment variable with two-character name ev.

\V[env]

The contents of the environment variable with arbitrarily long name env.

\w’string’

The width of the glyph sequence string.

\x’N’

Extra line-space function (negative before, positive after).

\X’string’

Output string as device control function.

\Yn

Output string variable or macro with one-character name n uninterpreted as device control function.

\Y(nm

Output string variable or macro with two-character name nm uninterpreted as device control function.

\Y[name]

Output string variable or macro with arbitrarily long name name uninterpreted as device control function.

\zc

Print c with zero width (without spacing).

\Z’anything’

Print anything and then restore the horizontal and vertical position; anything may not contain tabs or leaders.

The escape sequences \e, \., \", \$, \*, \a, \n, \t, \g, and \newline are interpreted in copy mode.

Escape sequences starting with \( or \[ do not represent single character escape sequences, but introduce escape names with two or more characters.

If a backslash is followed by a character that does not constitute a defined escape sequence, the backslash is silently ignored and the character maps to itself.

### Special Characters
[Note: ‘Special Characters’ is a misnomer; those entities are (output) glyphs, not (input) characters.]

Common special characters are predefined by escape sequences of the form \(xy with characters x and y. In groff, it is also possible to use the writing \[xy] as well.

Some of these special characters exist in the usual font while most of them are only available in the special font. Below you can see a small selection of the most important glyphs; a complete list can be found in groff_char(7).

\(Do

Dollar $

\(Eu

Euro €

\(Po

British pound sterling £

\(aq

Apostrophe quote '

\(bu

Bullet sign •

\(co

Copyright ©

\(cq

Single closing quote (right) ’

\(ct

Cent ¢

\(dd

Double dagger ‡

\(de

Degree °

\(dg

Dagger †

\(dq

Double quote (ASCII 34) "

\(em

Em-dash —

\(en

En-dash –

\(hy

Hyphen ‐

\(lq

Double quote left “

\(oq

Single opening quote (left) ‘

\(rg

Registered sign ®

\(rq

Double quote right ”

\(rs

Printable backslash character \

\(sc

Section sign §

\(tm

Trademark symbol ™

\(ul

Underline character _

\(==

Identical ≡

\(>=

Larger or equal ≥

\(<=

Less or equal ≤

\(!=

Not equal ≠

\(->

Right arrow →

\(<-

Left arrow ←

\(+-

Plus-minus sign ±

### Unicode Characters
There is the extended escape u that allows to include all available Unicode characters into some roff file.

\[uxxxx]

u is the escape name. xxxx is a hexadecimal number of 4 hex digits, such as 0041 for the letter A, see \[u0041].

\[uyyyyy]

u is the escape name. yyyyy is a hexadecimal number of 5 hex digits, such as 2FA1A for a Chinese looking character for CJK Compatibility Ideographs Supplement, see \[u2FA1A].

Both hexadecimal collections mean the corresponding Unicode code for a character.

\[uhex1_hex2]

\[uhex1_hex2_hex3]

hex1, hex2, and hex3 are all Unicode hexadecimal codes (4 or 5 hex digits) that are used for overstriking, e.g. \[u0041_0301] is A acute Á.

The availability of the Unicode characters depends on the used font. For text mode, the device -Tutf8 is quite complete, for troff modes it might happen that some or many characters will not be displayed. Please check your fonts.

### Strings
Strings are defined by the ds request and can be retrieved by the \* escape sequence.

Strings share their name space with macros. So strings and macros without arguments are roughly equivalent; it is possible to call a string like a macro and vice-versa, but this often leads to unpredictable results. The following string is the only one predefined in groff.

\*[.T]

The name of the current output device as specified by the -T command line option.

## REGISTERS
Registers are variables that store a value. In groff, most registers store numerical values (see section NUMERICAL EXPRESSIONS above), but some can also hold a string value.

Each register is given a name. Arbitrary registers can be defined and set with the nr request.

The value stored in a register can be retrieved by the escape sequences introduced by \n.

Most useful are predefined registers. In the following the notation name is used to refer to register name to make clear that we speak about registers. Please keep in mind that the \n[] decoration is not part of the register name.

### Read-only Registers
The following registers have predefined values that should not be modified by the user (usually, registers starting with a dot are read-only). Mostly, they provide information on the current settings or store results from request calls.

\n[$$]

The process ID of troff.

\n[.$]

Number of arguments in the current macro or string.

\n[.a]

Post-line extra line-space most recently utilized using \x.

\n[.A]

Set to 1 in troff if option -A is used; always 1 in nroff.

\n[.b]

The emboldening offset while .bd is active.

\n[.br]

Within a macro, set to 1 if macro called with the ‘normal’ control character, and to 0 otherwise.

\n[.c]

Current input line number.

\n[.C]

1 if compatibility mode is in effect, 0 otherwise.

\n[.cdp]

The depth of the last glyph added to the current environment. It is positive if the glyph extends below the baseline.

\n[.ce]

The number of lines remaining to be centered, as set by the ce request.

\n[.cht]

The height of the last glyph added to the current environment. It is positive if the glyph extends above the baseline.

\n[.color]

1 if colors are enabled, 0 otherwise.

\n[.csk]

The skew of the last glyph added to the current environment. The skew of a glyph is how far to the right of the center of a glyph the center of an accent over that glyph should be placed.

\n[.d]

Current vertical place in current diversion; equal to register nl.

\n[.ev]

The name or number of the current environment (string-valued).

\n[.f]

Current font number.

\n[.F]

The name of the current input file (string-valued).

\n[.fam]

The current font family (string-valued).

\n[.fn]

The current (internal) real font name (string-valued).

\n[.fp]

The number of the next free font position.

\n[.g]

Always 1 in GNU troff. Macros should use it to test if running under groff.

\n[.h]

Text base-line high-water mark on current page or diversion.

\n[.H]

Available horizontal resolution in basic units.

\n[.height]

The current font height as set with \H.

\n[.hla]

The current hyphenation language as set by the hla request.

\n[.hlc]

The number of immediately preceding consecutive hyphenated lines.

\n[.hlm]

The maximum allowed number of consecutive hyphenated lines, as set by the hlm request.

\n[.hy]

The current hyphenation flags (as set by the hy request).

\n[.hym]

The current hyphenation margin (as set by the hym request).

\n[.hys]

The current hyphenation space (as set by the hys request).

\n[.i]

Current indentation.

\n[.in]

The indentation that applies to the current output line.

\n[.int]

Positive if last output line contains \c.

\n[.j]

The current adjustment mode. It can be stored and used to set adjustment. (n = 1, b = 1, l = 0, r = 5, c = 3).

\n[.k]

The current horizontal output position (relative to the current indentation).

\n[.kern]

1 if pairwise kerning is enabled, 0 otherwise.

\n[.l]

Current line length.

\n[.L]

The current line spacing setting as set by .ls.

\n[.lg]

The current ligature mode (as set by the lg request).

\n[.linetabs]

The current line-tabs mode (as set by the linetabs request).

\n[.ll]

The line length that applies to the current output line.

\n[.lt]

The title length (as set by the lt request).

\n[.m]

The current drawing color (string-valued).

\n[.M]

The current background color (string-valued).

\n[.n]

Length of text portion on previous output line.

\n[.ne]

The amount of space that was needed in the last ne request that caused a trap to be sprung. Useful in conjunction with register .trunc.

\n[.ns]

1 if in no-space mode, 0 otherwise.

\n[.o]

Current page offset.

\n[.O]

The suppression nesting level (see \O).

\n[.p]

Current page length.

\n[.P]

1 if the current page is being printed, 0 otherwise (as determined by the -o command line option).

\n[.pe]

1 during page ejection, 0 otherwise.

\n[.pn]

The number of the next page: either the value set by a pn request, or the number of the current page plus 1.

\n[.ps]

The current point size in scaled points.

\n[.psr]

The last-requested point size in scaled points.

\n[.pvs]

The current post-vertical line spacing.

\n[.R]

The number of unused number registers. Always 10000 in GNU troff.

\n[.rj]

The number of lines to be right-justified as set by the rj request.

\n[.s]

Current point size as a decimal fraction.

\n[.slant]

The slant of the current font as set with \S.

\n[.sr]

The last requested point size in points as a decimal fraction (string-valued).

\n[.ss]

The value of the parameters set by the first argument of the ss request.

\n[.sss]

The value of the parameters set by the second argument of the ss request.

\n[.sty]

The current font style (string-valued).

\n[.t]

Vertical distance to the next trap.

\n[.T]

Set to 1 if option -T is used.

\n[.tabs]

A string representation of the current tab settings suitable for use as an argument to the ta request.

\n[.trunc]

The amount of vertical space truncated by the most recently sprung vertical position trap, or, if the trap was sprung by a ne request, minus the amount of vertical motion produced by .ne. Useful in conjunction with the register .ne.

\n[.u]

Equal to 1 in fill mode and 0 in no-fill mode.

\n[.U]

Equal to 1 in safer mode and 0 in unsafe mode.

\n[.v]

Current vertical line spacing.

\n[.V]

Available vertical resolution in basic units.

\n[.vpt]

1 if vertical position traps are enabled, 0 otherwise.

\n[.w]

Width of previous glyph.

\n[.warn]

The sum of the number codes of the currently enabled warnings.

\n[.x]

The major version number.

\n[.y]

The minor version number.

\n[.Y]

The revision number of groff.

\n[.z]

Name of current diversion.

\n[.zoom]

Zoom factor for current font (in multiples of 1/1000th; zero if no magnification).

### Writable Registers
The following registers can be read and written by the user. They have predefined default values, but these can be modified for customizing a document.

\n[%]

Current page number.

\n[c.]

Current input line number.

\n[ct]

Character type (set by width function \w).

\n[dl]

Maximal width of last completed diversion.

\n[dn]

Height of last completed diversion.

\n[dw]

Current day of week (1–7).

\n[dy]

Current day of month (1–31).

\n[hours]

The number of hours past midnight. Initialized at start-up.

\n[hp]

Current horizontal position at input line.

\n[llx]

Lower left x-coordinate (in PostScript units) of a given PostScript image (set by .psbb).

\n[lly]

Lower left y-coordinate (in PostScript units) of a given PostScript image (set by .psbb).

\n[ln]

Output line number.

\n[lsn]

The number of leading spaces of an input line.

\n[lss]

The horizontal space corresponding to the leading spaces of an input line.

\n[minutes]

The number of minutes after the hour. Initialized at start-up.

\n[mo]

Current month (1–12).

\n[nl]

Vertical position of last printed text base-line.

\n[opmaxx]

\n[opmaxy]

\n[opminx]

\n[opminy]

These four registers mark the top left and bottom right hand corners of a box which encompasses all written glyphs. They are reset to -1 by \O0 or \O1.

\n[rsb]

Like register sb, but takes account of the heights and depths of glyphs.

\n[rst]

Like register st, but takes account of the heights and depths of glyphs.

\n[sb]

Depth of string below base line (generated by width function \w).

\n[seconds]

The number of seconds after the minute. Initialized at start-up.

\n[skw]

Right skip width from the center of the last glyph in the \w argument.

\n[slimit]

If greater than 0, the maximum number of objects on the input stack. If ≤0 there is no limit, i.e., recursion can continue until virtual memory is exhausted.

\n[ssc]

The amount of horizontal space (possibly negative) that should be added to the last glyph before a subscript (generated by width function \w).

\n[st]

Height of string above base line (generated by width function \w).

\n[systat]

The return value of the system() function executed by the last sy request.

\n[urx]

Upper right x-coordinate (in PostScript units) of a given PostScript image (set by .psbb).

\n[ury]

Upper right y-coordinate (in PostScript units) of a given PostScript image (set by .psbb).

\n[year]

The current year (year 2000 compliant).

\n[yr]

Current year minus 1900. For Y2K compliance use register year instead.

## UNDERLINING
In the RUNOFF language, the underlining was quite easy. But in roff this is much more difficult.

### Underlining with .ul
There exists a groff request .ul (see above) that can underline the next or further source lines in nroff, but in troff it produces only a font change into italic. So this request is not really useful.

### Underlining with .UL from ms
In the ‘ms’ macro package in tmac/s.tmac groff_ms(7), there is the macro .UL. But this works only in troff, not in nroff.

### Underlining macro definitions
So one can use the italic nroff idea from .ul and the troff definition in ms for writing a useful new macro, something like

```
.de UNDERLINE
. ie n \\$1\f[I]\\$2\f[P]\\$3
. el \\$1\Z'\\$2'\v'.25m'\D'l \w'\\$2'u 0'\v'-.25m'\[rs]\$3
..
```

If doclifter (1) makes trouble, change the macro name UNDERLINE into some 2-letter word, like Ul. Moreover change the font writing from \f[P] to \fP.

### Underlining without macro definitions
If one does not want to use macro definitions, e.g. when doclifter gets lost, use the following:

```
.ds u1 before
.ds u2 in
.ds u3 after
.ie n \*[u1]\f[I]\*[u2]\f[P]\*[u3]
.el \*[u1]\Z'\*[u2]'\v'.25m'\D'l \w'\*[u2]'u 0'\v'-.25m'\*[u3]
```

Due to doclifter, it might be necessary to change the variable writing \[xy] and \*[xy] into the strange ancient writing \*(xy and \(xy, and so on. Then these lines could look like

```
.ds u1 before
.ds u2 in
.ds u3 after
.ie n \*[u1]\fI\*(u2\fP\*(u3
.el \*(u1\Z'\*(u2'\v'.25m'\D'l \w'\*(u2'u 0'\v'-.25m'\*(u3
```

The result looks like

before in after

### Underlining with Overstriking \z and \(ul
There is another possibility for underlining by using overstriking with \zc (print c with zero width without spacing) and \(ul (underline character). This produces the underlining of 1 character, both in nroff and in troff.

For example the underlining of a character say t looks like \z\[ul]t or \z\(ult

Longer words look then a bit strange, but a useful mode is to write each character into a whole own line. To underlines the 3 character part "tar" of the word "start":

```
before s\
\z\[ul]t\
\z\[ul]a\
\z\[ul]r\
t after
```

or

```
before s\
\z\(ult\
\z\(ula\
\z\(ulr\
t after
```

The result looks like

before start after

## COMPATIBILITY
The differences of the groff language in comparison to classical troff as defined by [CSTR #54] are documented in groff_diff(7).

The groff system provides a compatibility mode, see groff(1) on how to invoke this.

## BUGS
Report bugs to the groff bug mailing list. Include a complete, self-contained example that will allow the bug to be reproduced, and say which version of groff you are using.

## SEE ALSO
The main source of information for the groff language is the groff info(1) file. Besides the gory details, it contains many examples.

groff(1)

the usage of the groff program and pointers to the documentation and availability of the groff system.

groff_diff(7)

the differences of the groff language as compared to classical roff. This is the authoritative document for the predefined language elements that are specific to groff.

groff_char(7)

the predefined groff special characters (glyphs).

groff_font(5)

the specification of fonts and the DESC file.

roff(7)

the history of roff, the common parts shared by all roff systems, and pointers to further documentation.

[CSTR #54]

Nroff/Troff User's Manual by Ossanna & Kernighan — the bible for classical troff.

## COPYING
This file is part of groff, the GNU roff type-setting system.

Copyright © 2000-2014 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Front-Cover Texts, and with no Back-Cover Texts.

A copy of the Free Documentation License is included as a file called FDL in the main directory of the groff source package. It is also available in the internet at http://www.gnu.org/copyleft/fdl.html.

## AUTHORS
This documentation was written by Bernd Warken and is appended and maintained by Werner Lemberg.


ditroff

package: groff-extra

title: ditroff(7)

summary: classical device independent roff

text:
# ditroff(7)

## NAME
ditroff - classical device independent roff

## DESCRIPTION
The name ditroff once marked a development level of the troff text processing system. In actual roff(7) systems, the name troff is used as a synonym for ditroff.

The first roff system was written by Joe Ossanna around 1973. It supported only two output devices, the nroff program produced text oriented tty output, while the troff program generated graphical output for exactly one output device, the Wang Graphic Systems CAT typesetter.

In 1979, Brian Kernighan rewrote troff to support more devices by creating an intermediate output format for troff that can be fed into postprocessor programs which actually do the printout on the device. Kernighan's version marks what is known as classical troff today. In order to distinguish it from Ossanna's original mono-device version, it was called ditroff (device independent troff) on some systems, though this naming isn't mentioned in the classical documentation.

Today, any existing roff system is based on Kernighan's multi-device troff. The distinction between troff and ditroff isn't necessary any longer, for each modern troff provides already the complete functionality of ditroff. On most systems, the name troff is used to denote ditroff.

The easiest way to use ditroff is the GNU roff system, groff. The groff(1) program is a wrapper around (di)troff that automatically handles postprocessing.

## SEE ALSO
[CSTR #54]

The 1992 revision of the Nroff/Troff User's Manual by J. F. Ossanna and Brian Kernighan, see Bell Labs CSTR #54.

[CSTR #97]

A Typesetter-independent TROFF by Brian Kernighan is the original documentation of the first multi-device troff (ditroff), see Bell Labs CSTR #97.

roff(7)

This document gives details on the history and concepts of roff.

troff(1)

The actual implementation of ditroff.

groff(1)

The GNU roff program and pointers to all documentation around groff.

groff_out(5)

The groff version of the intermediate output language, the basis for multi-devicing.

## COPYING
Copyright © 2001-2014 Free Software Foundation, Inc.

This file is part of groff, the GNU roff type-setting system.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Front-Cover Texts, and with no Back-Cover Texts.

A copy of the Free Documentation License is included as a file called FDL in the main directory of the groff source package, it is also available on-line at the GNU copyleft site.

## AUTHORS
It was written by Bernd Warken and is maintained by Werner Lemberg.


title: groff_char(7)

summary: groff glyph names

text:
# groff_char(7)

## NAME
groff_char - groff glyph names

## DESCRIPTION
This manual page lists the standard groff glyph names and the default input mapping, latin1. The glyphs in this document look different depending on which output device was chosen (with option -T for the man(1) program or the roff formatter). Glyphs not available for the device that is being used to print or view this manual page are marked with ‘(N/A)’; the device currently used is ‘html’.

In the actual version, groff provides only 8-bit characters for direct input and named entities for further glyphs. On ASCII platforms, input character codes in the range 0 to 127 (decimal) represent the usual 7-bit ASCII characters, while codes between 127 and 255 are interpreted as the corresponding characters in the latin1 (ISO-8859-1) code set by default. This mapping is contained in the file latin1.tmac and can be changed by loading a different input encoding. Note that some of the input characters are reserved by groff, either for internal use or for special input purposes. On EBCDIC platforms, only code page cp1047 is supported (which contains the same characters as latin1; the input encoding file is called cp1047.tmac). Again, some input characters are reserved for internal and special purposes.

All roff systems provide the concept of named glyphs. In traditional roff systems, only names of length 2 were used, while groff also provides support for longer names. It is strongly suggested that only named glyphs are used for all character representations outside of the printable 7-bit ASCII range.

Some of the predefined groff escape sequences (with names of length 1) also produce single glyphs; these exist for historical reasons or are printable versions of syntactical characters. They include ‘\\’, ‘\´’, ‘\`’, ‘\-’, ‘\.’, and ‘\e’; see groff(7).

In groff, all of these different types of characters and glyphs can be tested positively with the ‘.if c’ conditional.

## REFERENCE
In this section, the glyphs in groff are specified in tabular form. The meaning of the columns is as follows.

Output

shows how the glyph is printed for the current device; although this can have quite a different shape on other devices, it always represents the same glyph.

Input

specifies how the glyph is input either directly by a key on the keyboard, or by a groff escape sequence.

Code

applies to glyphs which can be input with a single character, and gives the ISO latin1 decimal code of that input character. Note that this code is equivalent to the lowest 256 Unicode characters, including 7-bit ASCII in the range 0 to 127.

PostScript

gives the usual PostScript name of the glyph.

Unicode

is the glyph name used in composite glyph names. The names in the Unicode column look like u0021 or u0041_0300. In groff, the corresponding Unicode characters can be constructed by adding a backslash and a pair of square brackets, for example \[u0021] or \[u0041_0300].

### 7-bit Character Codes 32–126
These are the basic glyphs having 7-bit ASCII code values assigned. They are identical to the printable characters of the character standards ISO-8859-1 (latin1) and Unicode (range Basic Latin). The glyph names used in composite glyph names are ‘u0020’ up to ‘u007E’.

Note that input characters in the range 0-31 and character 127 are not printable characters. Most of them are invalid input characters for groff anyway, and the valid ones have special meaning. For EBCDIC, the printable characters are in the range 66-255.

48-57

Decimal digits 0 to 9 (print as themselves).

65-90

Upper case letters A-Z (print as themselves).

97-122

Lower case letters a–z (print as themselves).

Most of the remaining characters not in the just described ranges print as themselves; the only exceptions are the following characters:

`

the ISO latin1 ‘Grave Accent’ (code 96) prints as ‘, a left single quotation mark; the original character can be obtained with ‘\`’.

'

the ISO latin1 ‘Apostrophe’ (code 39) prints as ', a right single quotation mark; the original character can be obtained with ‘\(aq’.

-

the ISO latin1 ‘Hyphen, Minus Sign’ (code 45) prints as a hyphen; a minus sign can be obtained with ‘\-’.

~

the ISO latin1 ‘Tilde’ (code 126) is reduced in size to be usable as a diacritic; a larger glyph can be obtained with ‘\(ti’.

^

the ISO latin1 ‘Circumflex Accent’ (code 94) is reduced in size to be usable as a diacritic; a larger glyph can be obtained with ‘\(ha’.

Output

Input

Code

PostScript

Unicode

Notes

!

!

33

exclam

u0021

exclamation mark (bang)

"

"

34

quotedbl

u0022

double quote

\#

\#

35

numbersign

u0023

number sign

$

$

36

dollar

u0024

currency dollar sign

%

%

37

percent

u0025

percent

&

&

38

ampersand

u0026

ampersand

'

'

39

quoteright

u0027

right quote

(

(

40

parenleft

u0028

parentheses left

)

)

41

parenright

u0029

parentheses right

*

*

42

asterisk

u002A

asterisk

+

+

43

plus

u002B

plus

,

,

44

comma

u002C

comma

-

-

45

hyphen

u2010

hyphen

.

.

46

period

u002E

period, dot

/

/

47

slash

u002F

slash

:

:

58

colon

u003A

colon

;

;

59

semicolon

u003B

semicolon

<

<

60

less

u003C

less than

=

=

61

equal

u003D

equal

>

>

62

greater

u003E

greater than

?

?

63

question

u003F

question mark

@

@

64

at

u0040

at

[

[

91

bracketleft

u005B

square bracket left

\

\

92

backslash

u005C

backslash

]

]

93

bracketright

u005D

square bracket right

^

^

94

circumflex

u005E

circumflex accent

_

_

95

underscore

u005F

underscore

`

`

96

quoteleft

u0060

quote left

{

{

123

braceleft

u007B

curly brace left

|

|

124

bar

u007C

bar

}

}

125

braceright

u007D

curly brace right

~

~

126

tilde

u007E

tilde accent

### 8-bit Character Codes 160 to 255
They are interpreted as printable characters according to the latin1 (ISO-8859-1) code set, being identical to the Unicode range Latin-1 Supplement.

Input characters in range 128-159 (on non-EBCDIC hosts) are not printable characters.

160

the ISO latin1 no-break space is mapped to ‘\~’, the stretchable space character.

173

the soft hyphen control character. groff never uses this character for output (thus it is omitted in the table below); the input character 173 is mapped onto ‘\%’.

The remaining ranges (161-172, 174-255) are printable characters that print as themselves. Although they can be specified directly with the keyboard on systems with a latin1 code page, it is better to use their glyph names; see next section.

Output

Input

Code

PostScript

Unicode

Notes

¡

¡

161

exclamdown

u00A1

inverted exclamation mark

¢

¢

162

cent

u00A2

currency unit

£

£

163

sterling

u00A3

pound sterling

¤

¤

164

currency

u00A4

generic currency symbol

¥

¥

165

yen

u00A5

Japanese currency symbol

¦

¦

166

brokenbar

u00A6

broken bar

§

§

167

section

u00A7

section sign

¨

¨

168

dieresis

u00A8

dieresis (umlaut)

©

©

169

copyright

u00A9

copyright symbol

ª

ª

170

ordfeminine

u00AA

feminine ordinal (Spanish)

«

«

171

guillemotleft

u00AB

left guillemet [sic]

¬

¬

172

logicalnot

u00AC

logical not

®

®

174

registered

u00AE

registered mark symbol

¯

¯

175

macron

u00AF

overbar accent

°

°

176

degree

u00B0

degree sign

±

±

177

plusminus

u00B1

plus-minus sign

²

²

178

twosuperior

u00B2

superscript 2

³

³

179

threesuperior

u00B3

superscript 3

´

´

180

acute

u00B4

acute accent

µ

µ

181

mu

u00B5

micro sign

¶

¶

182

paragraph

u00B6

end of paragraphs marker

·

·

183

periodcentered

u00B7

centered period

¸

¸

184

cedilla

u00B8

cedilla accent

¹

¹

185

onesuperior

u00B9

superscript 1

º

º

186

ordmasculine

u00BA

masculine ordinal (Spanish)

»

»

187

guillemotright

u00BB

right guillemet [sic]

¼

¼

188

onequarter

u00BC

1/4 symbol

½

½

189

onehalf

u00BD

1/2 symbol

¾

¾

190

threequarters

u00BE

3/4 symbol

¿

¿

191

questiondown

u00BF

inverted question mark

À

À

192

Agrave

u0041_0300

A grave

Á

Á

193

Aacute

u0041_0301

A acute

Â

Â

194

Acircumflex

u0041_0302

A circumflex

Ã

Ã

195

Atilde

u0041_0303

A tilde

Ä

Ä

196

Adieresis

u0041_0308

A dieresis (umlaut)

Å

Å

197

Aring

u0041_030A

A ring

Æ

Æ

198

AE

u00C6

A+E combined

Ç

Ç

199

Ccedilla

u0043_0327

C cedilla

È

È

200

Egrave

u0045_0300

E grave

É

É

201

Eacute

u0045_0301

E acute

Ê

Ê

202

Ecircumflex

u0045_0302

E circumflex

Ë

Ë

203

Edieresis

u0045_0308

E dieresis (umlaut)

Ì

Ì

204

Igrave

u0049_0300

I grave

Í

Í

205

Iacute

u0049_0301

I acute

Î

Î

206

Icircumflex

u0049_0302

I circumflex

Ï

Ï

207

Idieresis

u0049_0308

I dieresis

Ð

Ð

208

Eth

u00D0

E th

Ñ

Ñ

209

Ntilde

u004E_0303

N tilde

Ò

Ò

210

Ograve

u004F_0300

O grave

Ó

Ó

211

Oacute

u004F_0301

O acute

Ô

Ô

212

Ocircumflex

u004F_0302

O circumflex

Õ

Õ

213

Otilde

u004F_0303

O tilde

Ö

Ö

214

Odieresis

u004F_0308

O dieresis (umlaut)

×

×

215

multiply

u00D7

multiply

Ø

Ø

216

Oslash

u00D8

O slash

Ù

Ù

217

Ugrave

u0055_0300

U grave

Ú

Ú

218

Uacute

u0055_0301

U acute

Û

Û

219

Ucircumflex

u0055_0302

U circumflex

Ü

Ü

220

Udieresis

u0055_0308

U dieresis (umlaut)

Ý

Ý

221

Yacute

u0059_0301

Y acute

Þ

Þ

222

Thorn

u00DE

Thorn

ß

ß

223

germandbls

u00DF

German double s (sharp s)

à

à

224

agrave

u0061_0300

a grave

á

á

225

aacute

u0061_0301

a acute

â

â

226

acircumflex

u0061_0302

a circumflex

ã

ã

227

atilde

u0061_0303

a tilde

ä

ä

228

adieresis

u0061_0308

a dieresis (umlaut)

å

å

229

aring

u0061_030A

a ring

æ

æ

230

ae

u00E6

a+e combined

ç

ç

231

ccedilla

u0063_0327

c cedilla

è

è

232

egrave

u0065_0300

e grave

é

é

233

eacute

u0065_0301

e acute

ê

ê

234

ecircumflex

u0065_0302

e circumflex

ë

ë

235

edieresis

u0065_0308

e dieresis (umlaut)

ì

ì

236

igrave

u0069_0300

i grave

í

í

237

iacute

u0069_0301

i acute

î

î

238

icircumflex

u0069_0302

i circumflex

ï

ï

239

idieresis

u0069_0308

i dieresis (umlaut)

ð

ð

240

eth

u00F0

e th

ñ

ñ

241

ntilde

u006E_0303

n tilde

ò

ò

242

ograve

u006F_0300

o grave

ó

ó

243

oacute

u006F_0301

o acute

ô

ô

244

ocircumflex

u006F_0302

o circumflex

õ

õ

245

otilde

u006F_0303

o tilde

ö

ö

246

odieresis

u006F_0308

o dieresis (umlaut)

÷

÷

247

divide

u00F7

divide

ø

ø

248

oslash

u00F8

o slash

ù

ù

249

ugrave

u0075_0300

u grave

ú

ú

250

uacute

u0075_0301

u acute

û

û

251

ucircumflex

u0075_0302

u circumflex

ü

ü

252

udieresis

u0075_0308

u dieresis (umlaut)

ý

ý

253

yacute

u0079_0301

y acute

þ

þ

254

thorn

u00FE

thorn

ÿ

ÿ

255

ydieresis

u0079_0308

y dieresis (umlaut)

### Named Glyphs
Glyph names can be embedded into the document text by using escape sequences. groff(7) describes how these escape sequences look. Glyph names can consist of quite arbitrary characters from the ASCII or latin1 code set, not only alphanumeric characters. Here some examples:

\(ch

A glyph having the 2-character name ch.

\[char_name]

A glyph having the name char_name (having length 1, 2, 3, ...). Note that ‘c’ is not the same as ‘\[c]’ (c a single character): The latter is internally mapped to glyph name ‘\c’. By default, groff defines a single glyph name starting with a backslash, namely ‘\-’, which can be either accessed as ‘\-’ or ‘\[-]’.

\[base_glyph composite_1 composite_2 ...]

A composite glyph; see below for a more detailed description.

In groff, each 8-bit input character can also referred to by the construct ‘\[charn]’ where n is the decimal code of the character, a number between 0 and 255 without leading zeros (those entities are not glyph names). They are normally mapped onto glyphs using the .trin request.

Another special convention is the handling of glyphs with names directly derived from a Unicode code point; this is shown in the ‘Unicode’ column of the table below. In general, all glyphs not having a name as listed in this manual page can be accessed with the ‘\[uXXXX]’ construct; please go to section ‘Using Symbols’ in the groff info manual for more details.

Moreover, new glyph names can be created by the .char request; see groff(7).

In the following, a plus sign in the ‘Notes’ column indicates that this particular glyph name appears in the PS version of the original troff documentation, CSTR 54.

Entries marked with ‘***’ denote glyphs for mathematical purposes (mainly used for DVI output). Normally, such glyphs have metrics which make them unusable in normal text.

Output

Input

PostScript

Unicode

Notes

Ð

\[-D]

Eth

u00D0

uppercase eth

ð

\[Sd]

eth

u00F0

lowercase eth

Þ

\[TP]

Thorn

u00DE

uppercase thorn

þ

\[Tp]

thorn

u00FE

lowercase thorn

ß

\[ss]

germandbls

u00DF

German double s (sharp s)

Ligatures and Other Latin Glyphs

Output

Input

PostScript

Unicode

Notes

ﬀ

\[ff]

ff

u0066_0066

ff ligature +

ﬁ

\[fi]

fi

u0066_0069

fi ligature +

ﬂ

\[fl]

fl

u0066_006C

fl ligature +

ﬃ

\[Fi]

ffi

u0066_0066_0069

ffi ligature +

ﬄ

\[Fl]

ffl

u0066_0066_006C

ffl ligature +

Ł

\[/L]

Lslash

u0141

L slash (Polish)

ł

\[/l]

lslash

u0142

l slash (Polish)

Ø

\[/O]

Oslash

u00D8

O slash (Scandinavian)

ø

\[/o]

oslash

u00F8

o slash (Scandinavian)

Æ

\[AE]

AE

u00C6

A+E combined

æ

\[ae]

ae

u00E6

a+e combined

Œ

\[OE]

OE

u0152

O+E combined

œ

\[oe]

oe

u0153

o+e combined

Ĳ

\[IJ]

IJ

u0132

I+J combined (Dutch)

ĳ

\[ij]

ij

u0133

i+j combined(Dutch)

ı

\[.i]

dotlessi

u0131

i without a dot (Turkish)

ȷ

\[.j]

dotlessj

u0237

j without a dot

Accented Characters

Output

Input

PostScript

Unicode

Notes

Á

\['A]

Aacute

u0041_0301

A acute

\['C]

Cacute

u0043_0301

C acute

É

\['E]

Eacute

u0045_0301

E acute

Í

\['I]

Iacute

u0049_0301

I acute

Ó

\['O]

Oacute

u004F_0301

O acute

Ú

\['U]

Uacute

u0055_0301

U acute

Ý

\['Y]

Yacute

u0059_0301

Y acute

á

\['a]

aacute

u0061_0301

a acute

\['c]

cacute

u0063_0301

c acute

é

\['e]

eacute

u0065_0301

e acute

í

\['i]

iacute

u0069_0301

i acute

ó

\['o]

oacute

u006F_0301

o acute

ú

\['u]

uacute

u0075_0301

u acute

ý

\['y]

yacute

u0079_0301

y acute

Ä

\[:A]

Adieresis

u0041_0308

A dieresis (umlaut)

Ë

\[:E]

Edieresis

u0045_0308

E dieresis (umlaut)

Ï

\[:I]

Idieresis

u0049_0308

I dieresis (umlaut)

Ö

\[:O]

Odieresis

u004F_0308

O dieresis (umlaut)

Ü

\[:U]

Udieresis

u0055_0308

U dieresis (umlaut)

\[:Y]

Ydieresis

u0059_0308

Y dieresis (umlaut)

ä

\[:a]

adieresis

u0061_0308

a dieresis (umlaut)

ë

\[:e]

edieresis

u0065_0308

e dieresis (umlaut)

ï

\[:i]

idieresis

u0069_0308

i dieresis (umlaut)

ö

\[:o]

odieresis

u006F_0308

o dieresis (umlaut)

ü

\[:u]

udieresis

u0075_0308

u dieresis (umlaut)

ÿ

\[:y]

ydieresis

u0079_0308

y dieresis (umlaut)

Â

\[^A]

Acircumflex

u0041_0302

A circumflex

Ê

\[^E]

Ecircumflex

u0045_0302

E circumflex

Î

\[^I]

Icircumflex

u0049_0302

I circumflex

Ô

\[^O]

Ocircumflex

u004F_0302

O circumflex

Û

\[^U]

Ucircumflex

u0055_0302

U circumflex

â

\[^a]

acircumflex

u0061_0302

a circumflex

ê

\[^e]

ecircumflex

u0065_0302

e circumflex

î

\[^i]

icircumflex

u0069_0302

i circumflex

ô

\[^o]

ocircumflex

u006F_0302

o circumflex

û

\[^u]

ucircumflex

u0075_0302

u circumflex

À

\[`A]

Agrave

u0041_0300

A grave

È

\[`E]

Egrave

u0045_0300

E grave

Ì

\[`I]

Igrave

u0049_0300

I grave

Ò

\[`O]

Ograve

u004F_0300

O grave

Ù

\[`U]

Ugrave

u0055_0300

U grave

à

\[`a]

agrave

u0061_0300

a grave

è

\[`e]

egrave

u0065_0300

e grave

ì

\[`i]

igrave

u0069_0300

i grave

ò

\[`o]

ograve

u006F_0300

o grave

ù

\[`u]

ugrave

u0075_0300

u grave

Ã

\[~A]

Atilde

u0041_0303

A tilde

Ñ

\[~N]

Ntilde

u004E_0303

N tilde

Õ

\[~O]

Otilde

u004F_0303

O tilde

ã

\[~a]

atilde

u0061_0303

a tilde

ñ

\[~n]

ntilde

u006E_0303

n tilde

õ

\[~o]

otilde

u006F_0303

o tilde

\[vS]

Scaron

u0053_030C

S caron

\[vs]

scaron

u0073_030C

s caron

\[vZ]

Zcaron

u005A_030C

Z caron

\[vz]

zcaron

u007A_030C

z caron

Ç

\[,C]

Ccedilla

u0043_0327

C cedilla

ç

\[,c]

ccedilla

u0063_0327

c cedilla

Å

\[oA]

Aring

u0041_030A

A ring

å

\[oa]

aring

u0061_030A

a ring

Accents

The composite request is used to map most of the accents to non-spacing glyph names; the values given in parentheses are the original (spacing) ones.

Output

Input

PostScript

Unicode

Notes

˝

\[a"]

hungarumlaut

u030B (u02DD)

Hungarian umlaut

¯

\[a-]

macron

u0304 (u00AF)

overbar accent

˙

\[a.]

dotaccent

u0307 (u02D9)

dot accent

^

\[a^]

circumflex

u0302 (u005E)

circumflex accent

´

\[aa]

acute

u0301 (u00B4)

acute accent

`

\[ga]

grave

u0300 (u0060)

grave accent

˘

\[ab]

breve

u0306 (u02D8)

breve accent

¸

\[ac]

cedilla

u0327 (u00B8)

cedilla accent

¨

\[ad]

dieresis

u0308 (u00A8)

umlaut accent

ˇ

\[ah]

caron

u030C (u02C7)

caron accent

˚

\[ao]

ring

u030A (u02DA)

small circle, ring accent

~

\[a~]

tilde

u0303 (u007E)

tilde accent

˛

\[ho]

ogonek

u0328 (u02DB)

hook accent

^

\[ha]

asciicircum

u005E

high circumflex, ASCII character, in mathematics the power sign

~

\[ti]

asciitilde

u007E

tilde in vertical middle, ASCII, in Unix-like the home directory

Quotes

Output

Input

PostScript

Unicode

Notes

„

\[Bq]

quotedblbase

u201E

low double comma quote

‚

\[bq]

quotesinglbase

u201A

low single comma quote

“

\[lq]

quotedblleft

u201C

left double quote

”

\[rq]

quotedblright

u201D

right double quote

‘

\[oq]

quoteleft

u2018

single open (left) quote

’

\[cq]

quoteright

u2019

single closing (right) quote

'

\[aq]

quotesingle

u0027

apostrophe quote (ASCII 39)

"

\[dq]

quotedbl

u0022

double quote (ASCII 34)

«

\[Fo]

guillemotleft

u00AB

left guillemet [sic]

»

\[Fc]

guillemotright

u00BB

right guillemet [sic]

‹

\[fo]

guilsinglleft

u2039

single left-pointing angle quotation mark

›

\[fc]

guilsinglright

u203A

single right-pointing angle quotation mark

Punctuation

Output

Input

PostScript

Unicode

Notes

¡

\[r!]

exclamdown

u00A1

inverted exclamation mark

¿

\[r?]

questiondown

u00BF

inverted question mark

—

\[em]

emdash

u2014

em-dash symbol

–

\[en]

endash

u2013

en-dash symbol

‐

\[hy]

hyphen

u2010

hyphen symbol

Brackets

The extensible bracket pieces are font-invariant glyphs. In classical troff only one glyph was available to vertically extend brackets, braces, and parentheses: ‘bv’. We map it rather arbitrarily to u23AA.

Note that not all devices contain extensible bracket pieces which can be piled up with ‘\b’ due to the restrictions of the escape's piling algorithm. A general solution to build brackets out of pieces is the following macro:

```
.\" Make a pile centered vertically 0.5em
.\" above the baseline.
.\" The first argument is placed at the top.
.\" The pile is returned in string `pile'
.eo
.de pile-make
.  nr pile-wd 0
.  nr pile-ht 0
.  ds pile-args
.
.  nr pile-# \n[.$]
.  while \n[pile-#] \{\
.    nr pile-wd (\n[pile-wd] >? \w'\$[\n[pile-#]]')
.    nr pile-ht +(\n[rst] - \n[rsb])
.    as pile-args \v'\n[rsb]u'\"
.    as pile-args \Z'\$[\n[pile-#]]'\"
.    as pile-args \v'-\n[rst]u'\"
.    nr pile-# -1
.  \}
.
.  ds pile \v'(-0.5m + (\n[pile-ht]u / 2u))'\"
.  as pile \*[pile-args]\"
.  as pile \v'((\n[pile-ht]u / 2u) + 0.5m)'\"
.  as pile \h'\n[pile-wd]u'\"
..
.ec
```

```

```

Another complication is the fact that some glyphs which represent bracket pieces in original troff can be used for other mathematical symbols also, for example ‘lf’ and ‘rf’ which provide the ‘floor’ operator. Other devices (most notably for DVI output) don't unify such glyphs. For this reason, the four glyphs ‘lf’, ‘rf’, lc’, and ‘rc’ are not unified with similarly looking bracket pieces. In groff, only glyphs with long names are guaranteed to pile up correctly for all devices (provided those glyphs exist).

Output

Input

PostScript

Unicode

Notes

[

\[lB]

bracketleft

u005B

left square bracket

]

\[rB]

bracketright

u005D

right square bracket

{

\[lC]

braceleft

u007B

left curly brace

}

\[rC]

braceright

u007D

right curly brace

⟨

\[la]

angleleft

u27E8

left angle bracket

⟩

\[ra]

angleright

u27E9

right angle bracket

⎪

\[bv]

braceex

u23AA

curly brace vertical extension

⎪

\[braceex]

braceex

u23AA

curly brace vertical extension

⎡

\[bracketlefttp]

bracketlefttp

u23A1

left square bracket top

⎣

\[bracketleftbt]

bracketleftbt

u23A3

left square bracket bottom

⎢

\[bracketleftex]

bracketleftex

u23A2

left square bracket extension

⎤

\[bracketrighttp]

bracketrighttp

u23A4

right square bracket top

⎦

\[bracketrightbt]

bracketrightbt

u23A6

right square bracket bottom

⎥

\[bracketrightex]

bracketrightex

u23A5

right square bracket extension

⎧

\[lt]

bracelefttp

u23A7

left curly brace top

⎧

\[bracelefttp]

bracelefttp

u23A7

left curly brace top

⎨

\[lk]

braceleftmid

u23A8

left curly brace middle

⎨

\[braceleftmid]

braceleftmid

u23A8

left curly brace middle

⎩

\[lb]

braceleftbt

u23A9

left curly brace bottom

⎩

\[braceleftbt]

braceleftbt

u23A9

left curly brace bottom

⎪

\[braceleftex]

braceleftex

u23AA

left curly brace extension

⎫

\[rt]

bracerighttp

u23AB

right curly brace top

⎫

\[bracerighttp]

bracerighttp

u23AB

right curly brace top

⎬

\[rk]

bracerightmid

u23AC

right curly brace middle

⎬

\[bracerightmid]

bracerightmid

u23AC

right curly brace middle

⎭

\[rb]

bracerightbt

u23AD

right curly brace bottom

⎭

\[bracerightbt]

bracerightbt

u23AD

right curly brace bottom

⎪

\[bracerightex]

bracerightex

u23AA

right curly brace extension

⎛

\[parenlefttp]

parenlefttp

u239B

left parenthesis top

⎝

\[parenleftbt]

parenleftbt

u239D

left parenthesis bottom

⎜

\[parenleftex]

parenleftex

u239C

left parenthesis extension

⎞

\[parenrighttp]

parenrighttp

u239E

right parenthesis top

⎠

\[parenrightbt]

parenrightbt

u23A0

right parenthesis bottoom

⎟

\[parenrightex]

parenrightex

u239F

right parenthesis extension

Arrows

Output

Input

PostScript

Unicode

Notes

←

\[<-]

arrowleft

u2190

horizontal arrow left

→

\[->]

arrowright

u2192

horizontal arrow right

↔

\[<>]

arrowboth

u2194

horizontal arrow in both directions

↓

\[da]

arrowdown

u2193

vertical arrow down

↑

\[ua]

arrowup

u2191

vertical arrow up

↕

\[va]

arrowupdn

u2195

vertical arrow in both directions

⇐

\[lA]

arrowdblleft

u21D0

horizontal double arrow left

⇒

\[rA]

arrowdblright

u21D2

horizontal double arrow right

⇔

\[hA]

arrowdblboth

u21D4

horizontal double arrow in both directions

⇓

\[dA]

arrowdbldown

u21D3

vertical double arrow down

⇑

\[uA]

arrowdblup

u21D1

vertical double arrow up

⇕

\[vA]

uni21D5

u21D5

vertical double arrow in both directions

⎯

\[an]

arrowhorizex

u23AF

horizontal arrow extension

Lines

The font-invariant glyphs ‘br’, ‘ul’, and ‘rn’ form corners; they can be used to build boxes. Note that both the PostScript and the Unicode-derived names of these three glyphs are just rough approximations.

‘rn’ also serves in classical troff as the horizontal extension of the square root sign.

‘ru’ is a font-invariant glyph, namely a rule of length 0.5m.

Output

Input

PostScript

Unicode

Notes

|

\[ba]

bar

u007C

bar

│

\[br]

SF110000

u2502

box rule

_

\[ul]

underscore

u005F

underscore

‾

\[rn]

overline

u203E

overline

_

\[ru]

---

---

baseline rule

¦

\[bb]

brokenbar

u00A6

broken bar

/

\[sl]

slash

u002F

slash, solidus

\

\[rs]

backslash

u005C

reverse slash, reverse solidus

Use ‘\[radicalex]’, not ‘\[overline]’, for continuation of square root.

Text markers

Output

Input

PostScript

Unicode

Notes

○

\[ci]

circle

u25CB

circle

•

\[bu]

bullet

u2022

bullet

‡

\[dd]

daggerdbl

u2021

double dagger sign

†

\[dg]

dagger

u2020

dagger

◊

\[lz]

lozenge

u25CA

lozenge, diamond, pound key

□

\[sq]

uni25A1

u25A1

white square

¶

\[ps]

paragraph

u00B6

end of paragraphs marker

§

\[sc]

section

u00A7

section sign

☜

\[lh]

uni261C

u261C

hand pointing left

☞

\[rh]

a14

u261E

hand pointing right

@

\[at]

at

u0040

at

\#

\[sh]

numbersign

u0023

number sign

↵

\[CR]

carriagereturn

u21B5

carriage return

✓

\[OK]

a19

u2713

check mark, tick

Legal Symbols

Output

Input

PostScript

Unicode

Notes

©

\[co]

copyright

u00A9

copyright sign

®

\[rg]

registered

u00AE

registered mark

™

\[tm]

trademark

u2122

trademark symbol

\[bs]

---

---

AT&T Bell Labs logo +

The Bell Labs logo is not supported in groff.

Currency symbols

Output

Input

PostScript

Unicode

Notes

$

\[Do]

dollar

u0024

dollar

¢

\[ct]

cent

u00A2

cent

€

\[eu]

---

u20AC

official Euro symbol

€

\[Eu]

Euro

u20AC

font-specific Euro glyph variant

¥

\[Ye]

yen

u00A5

Japanese Yen

£

\[Po]

sterling

u00A3

pound sterling (British)

¤

\[Cs]

currency

u00A4

Scandinavian currency sign

ƒ

\[Fn]

florin

u0192

Dutch currency sign

Units

Output

Input

PostScript

Unicode

Notes

°

\[de]

degree

u00B0

degree

‰

\[%0]

perthousand

u2030

per thousand, per mille sign

′

\[fm]

minute

u2032

arc minute sign

″

\[sd]

second

u2033

acr second sign

µ

\[mc]

mu

u00B5

mu, micro sign

ª

\[Of]

ordfeminine

u00AA

feminine ordinal (Spanish)

º

\[Om]

ordmasculine

u00BA

masculine ordinal (Spanish)

Logical Symbols

Output

Input

PostScript

Unicode

Notes

∧

\[AN]

logicaland

u2227

logical and

∨

\[OR]

logicalor

u2228

logical or

¬

\[no]

logicalnot

u00AC

logical not

¬

\[tno]

logicalnot

u00AC

text variant of ‘no’

∃

\[te]

existential

u2203

there exists

∀

\[fa]

universal

u2200

for all

∋

\[st]

suchthat

u220B

sucht that

∴

\[3d]

therefore

u2234

therefore

∴

\[tf]

therefore

u2234

therefore

|

\[or]

bar

u007C

bitwise OR operator (as used in C)

Mathematical Symbols

Output

Input

PostScript

Unicode

Notes

½

\[12]

onehalf

u00BD

1/2 symbol

¼

\[14]

onequarter

u00BC

1/4 symbol

¾

\[34]

threequarters

u00BE

3/4 symbol

⅛

\[18]

oneeighth

u215B

1/8 symbol

⅜

\[38]

threeeighths

u215C

3/8 symbol

⅝

\[58]

fiveeighths

u215D

5/8 symbol

⅞

\[78]

seveneighths

u215E

7/8 symbol

¹

\[S1]

onesuperior

u00B9

superscript 1

²

\[S2]

twosuperior

u00B2

superscript 2

³

\[S3]

threesuperior

u00B3

superscript 3

+

\[pl]

plus

u002B

plus in special font

−

\[mi]

minus

u2212

minus in special font

∓

\[-+]

uni2213

u2213

minus-plus

±

\[+-]

plusminus

u00B1

plus-minus

±

\[t+-]

plusminus

u00B1

text variant of \[+-]

·

\[pc]

periodcentered

u00B7

period centered

⋅

\[md]

dotmath

u22C5

multiplication dot

×

\[mu]

multiply

u00D7

multiply sign

×

\[tmu]

multiply

u00D7

text variant of \[mu]

⊗

\[c*]

circlemultiply

u2297

multiply sign in circle

⊕

\[c+]

circleplus

u2295

plus sign in circle

÷

\[di]

divide

u00F7

division sign

÷

\[tdi]

divide

u00F7

text variant of \[di]

⁄

\[f/]

fraction

u2044

bar for fractions

∗

\[**]

asteriskmath

u2217

mathematical asterisk

≤

\[<=]

lessequal

u2264

less or equal

≥

\[>=]

greaterequal

u2265

greater or equal

≪

\[<<]

uni226A

u226A

much less

≫

\[>>]

uni226B

u226B

much greater

=

\[eq]

equal

u003D

equals in special font

≠

\[!=]

notequal

u003D_0338

not equal

≡

\[==]

equivalence

u2261

equivalent

≢

\[ne]

uni2262

u2261_0338

not equivalent

≅

\[=~]

congruent

u2245

congruent, approx. equal

≃

\[|=]

uni2243

u2243

asymptot. equal to

∼

\[ap]

similar

u223C

similar

≈

\[~~]

approxequal

u2248

almost equal to

≈

\[~=]

approxequal

u2248

almost equal to

∝

\[pt]

proportional

u221D

proportional

∅

\[es]

emptyset

u2205

empty set

∈

\[mo]

element

u2208

element of a set

∉

\[nm]

notelement

u2208_0338

not element of set

⊂

\[sb]

propersubset

u2282

proper subset

⊄

\[nb]

notsubset

u2282_0338

not supset

⊃

\[sp]

propersuperset

u2283

proper superset

⊅

\[nc]

uni2285

u2283_0338

not superset

⊆

\[ib]

reflexsubset

u2286

subset or equal

⊇

\[ip]

reflexsuperset

u2287

superset or equal

∩

\[ca]

intersection

u2229

intersection, cap

∪

\[cu]

union

u222A

union, cup

∠

\[/_]

angle

u2220

angle

⊥

\[pp]

perpendicular

u22A5

perpendicular

∫

\[is]

integral

u222B

integral

∫

\[integral]

integral

u222B

integral

∑

\[sum]

summation

u2211

summation

∏

\[product]

product

u220F

product

∐

\[coproduct]

uni2210

u2210

coproduct

∇

\[gr]

gradient

u2207

gradient

√

\[sr]

radical

u221A

square root

√

\[sqrt]

radical

u221A

square root

\[radicalex]

radicalex

---

square root continuation

\[sqrtex]

radicalex

---

square root continuation

⌈

\[lc]

uni2308

u2308

left ceiling

⌉

\[rc]

uni2309

u2309

right ceiling

⌊

\[lf]

uni230A

u230A

left floor

⌋

\[rf]

uni230B

u230B

right floor

∞

\[if]

infinity

u221E

infinity

ℵ

\[Ah]

aleph

u2135

aleph

ℑ

\[Im]

Ifraktur

u2111

Gothic I, imaginary

ℜ

\[Re]

Rfraktur

u211C

Gothic R, real

℘

\[wp]

weierstrass

u2118

Weierstrass p

∂

\[pd]

partialdiff

u2202

partial differentiation

ℏ

\[-h]

uni210F

u210F

Planck constant / 2pi (h-bar)

ℏ

\[hbar]

uni210F

u210F

Planck constant / 2pi (h-bar)

Greek glyphs

These glyphs are intended for technical use, not for real Greek; normally, the uppercase letters have upright shape, and the lowercase ones are slanted. There is a problem with the mapping of letter phi to Unicode. Prior to Unicode version 3.0, the difference between U+03C6, GREEK SMALL LETTER PHI, and U+03D5, GREEK PHI SYMBOL, was not clearly described; only the glyph shapes in the Unicode book could be used as a reference. Starting with Unicode 3.0, the reference glyphs have been exchanged and described verbally also: In mathematical context, U+03D5 is the stroked variant and U+03C6 the curly glyph. Unfortunately, most font vendors didn't update their fonts to this (incompatible) change in Unicode. At the time of this writing (January 2006), it is not clear yet whether the Adobe Glyph Names ‘phi’ and ‘phi1’ also change its meaning if used for mathematics, thus compatibility problems are likely to happen – being conservative, groff currently assumes that ‘phi’ in a PostScript symbol font is the stroked version.

In groff, symbol ‘\[*f]’ always denotes the stroked version of phi, and ‘\[+f]’ the curly variant.

Output

Input

PostScript

Unicode

Notes

Α

\[*A]

Alpha

u0391

Alpha

Β

\[*B]

Beta

u0392

Beta

Γ

\[*G]

Gamma

u0393

Gamma

Δ

\[*D]

Delta

u0394

Delta

Ε

\[*E]

Epsilon

u0395

Epsilon

Ζ

\[*Z]

Zeta

u0396

Zeta

Η

\[*Y]

Eta

u0397

Eta

Θ

\[*H]

Theta

u0398

Theta

Ι

\[*I]

Iota

u0399

Iota

Κ

\[*K]

Kappa

u039A

Kappa

Λ

\[*L]

Lambda

u039B

Lamda

Μ

\[*M]

Mu

u039C

Mu

Ν

\[*N]

Nu

u039D

Nu

Ξ

\[*C]

Xi

u039E

Xi

Ο

\[*O]

Omicron

u039F

Omicron

Π

\[*P]

Pi

u03A0

Pi

Ρ

\[*R]

Rho

u03A1

Rho

Σ

\[*S]

Sigma

u03A3

Sigma

Τ

\[*T]

Tau

u03A4

Tau

Υ

\[*U]

Upsilon

u03A5

Upsilon

Φ

\[*F]

Phi

u03A6

Phi

Χ

\[*X]

Chi

u03A7

Chi

Ψ

\[*Q]

Psi

u03A8

Psi

Ω

\[*W]

Omega

u03A9

Omega

α

\[*a]

alpha

u03B1

alpha

β

\[*b]

beta

u03B2

beta

γ

\[*g]

gamma

u03B3

gamma

δ

\[*d]

delta

u03B4

delta

ε

\[*e]

epsilon

u03B5

epsilon

ζ

\[*z]

zeta

u03B6

zeta

η

\[*y]

eta

u03B7

eta

θ

\[*h]

theta

u03B8

theta

ι

\[*i]

iota

u03B9

iota

κ

\[*k]

kappa

u03BA

kappa

λ

\[*l]

lambda

u03BB

lambda

μ

\[*m]

mu

u03BC

mu

ν

\[*n]

nu

u03BD

nu

ξ

\[*c]

xi

u03BE

xi

ο

\[*o]

omicron

u03BF

omicron

π

\[*p]

pi

u03C0

pi

ρ

\[*r]

rho

u03C1

rho

ς

\[ts]

sigma1

u03C2

terminal sigma

σ

\[*s]

sigma

u03C3

sigma

τ

\[*t]

tau

u03C4

tau

υ

\[*u]

upsilon

u03C5

upsilon

ϕ

\[*f]

phi

u03D5

phi oked glyph)

χ

\[*x]

chi

u03C7

chi

ψ

\[*q]

psi

u03C8

psi

ω

\[*w]

omega

u03C9

omega

ϑ

\[+h]

theta1

u03D1

variant theta

φ

\[+f]

phi1

u03C6

variant phi (curly shape)

ϖ

\[+p]

omega1

u03D6

variant pi, looking like omega

ϵ

\[+e]

uni03F5

u03F5

variant epsilon

Card symbols

Output

Input

PostScript

Unicode

Notes

♣

\[CL]

club

u2663

black club suit

♠

\[SP]

spade

u2660

black spade suit

♥

\[HE]

heart

u2665

black heart suit

♡

\[u2661]

uni2661

u2661

white heart suit

♦

\[DI]

diamond

u2666

black diamond suit

♢

\[u2662]

uni2662

u2662

white diamond suit

## SEE ALSO
groff(1)

the GNU roff formatter

groff(7)

a short reference of the groff formatting language

An extension to the troff character set for Europe, E.G. Keizer, K.J. Simonsen, J. Akkerhuis; EUUG Newsletter, Volume 9, No. 2, Summer 1989

The Unicode Standard

## COPYING
Copyright © 1989-2014 Free Software Foundation, Inc.

This file is part of groff (GNU roff), which is a free software project.

You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

You should have received a copy of the GNU General Public License along with this program. If not, see GPL2.

## AUTHORS
This document was written by James Clark with additions by Werner Lemberg and Bernd Warken. This document was revised to use real tables by Eric S. Raymond.