A dictionary of troff commands

This documents some troff commands and common macros. See also the manual pages for groff, groff_man, groff_mdoc, groff_char and mdoc.samples. The entries in this "dictionary" are sorted in ASCII order, so "." is followed by "\" and so on, with the exception that alphabetical entries are sorted case-insensitively. The command itself is highlighted, and the arguments to the command are shown after it.

followed by new line
Line continuation marker.
In a string definition, marker for whitespace at the beginning of the string.
Name of the macro executing
In a macro or string, the concatenation of all the arguments with each surrounded by double quotes, and separated by spaces.
Non-printing zero-width character.
Greek character conversion, e.g. \(*a gives α
Copyright mark, ©
String xy defined by .ds
String with arbitrary length. See also \*x, \*(xy, and .ds
String x defined by .ds
Number of arguments available at the current level.
End of macro. See .de.
.af R c
Assign format c to register R. See also .nr.
.als alias object
Alias for request, string, macro, or diversion object.
[Manual page macro] An argument. This becomes "file ..." by default.
.as name string
Append string to string name (append version of .ds).
Begin display. This can begin indented text, preformatted text like source code, or filled text depending on the argument. The section ends with .Ed.
.Bd -literal
Start of preformatted text.
Begin a font, either emphasis, symbolic (bold) or literal (monospace). See also .Ef.
Begin keep. See also .Ek.
[Manual page macro] Begin a list. See also .El for ending.
Causes text on the same line to appear alternately in bold face and roman. The text must be on the same line as the macro call. This is often used for a manual page, like
.BR stdio (3)
See also .IR.
Number of lines read from current input file.
.cf filename
Copy file filename to output, unprocessed.
.Cm commands
[Manual page macro] Command (like a flag without - in front)
[Manual page macro] Date for BSD manual pages. See also .Dt, .TH.
.de xx yy
Define a macro. If yy is present then the definition ends at .yy, otherwise it ends at "..". See also ...
Literal line
[Manual page macro] Double quotes around what follows
.ds abc xyz
Define string abc to have the value xyz; expland with \*x or \*(xy. See also .as (append string).
.Dt title
[Manual page macro] Title for BSD manual pages. See also .Dd, .TH.
Reset escape character to
.ec c
Set escape character to "c". If c is empty, set it to \.
End of a .Bd block.
End a font started with .Bf
End keep. See also .Bk.
If / else else part; see also .ie and .if.
[Manual page macro] End a list. See also .Bl for ending.
Turn off escape mechanism
Start of equation
Predefined read-only register containing number of current font.
Current input file name
[Manual page macro] Function argument
[Manual page macro] Function declaration in the synopsis section.
Fill (join lines); see also .nf.
.Fn function
[Manual page macro] Function
[Manual page macro] Function open, used after the function's type and before the name of the function.
[Manual page macro] Function type, like int or char.
.ft R
Font change
[Groff-specific] register which is true for GNU troff (groff)
Hyphenation; see also .nh.
If / else if part; see also .el and .if.
.ie n
If in "nroff" mode (terminal output)
.ie t
If in "troff" mode (print output)
If statement; see also if / else using .ie and .el.
[Manual page macro] An "include" file for a C program.
Indented paragraph
Causes text on the same line to appear alternately in italic and roman. The text must be on the same line as the macro call. This is often used for a manual page, like
.IR stdio (3)
See also .BR.
[Manual page macro] List item
[Manual page macro] Macro which expands to the name of a library.
Literal text
Mathematical symbol
.mso name
Include macro package name. See also .so.
GNU mailto www extension
No adjust. Ragged right margin.
[Manual page macro] Emphasize following text (used in SYNOPSIS section).
No fill (do not join lines); see also .fi.
No hyphenation; see also .hy.
Name of command.
.nop anything
Always execute "anything". (nop means "no operation".)
.nr R N
Set value of number register R to N
[Manual page macro] No spaces, used between things to not add spaces there.
.nx filename
Switch to file filename, do not return to current file. See also .so.
[Manual page macro] Macro which expands to the name of the operating system.
[Manual page macro] Unknown
[Manual page macro] New paragraph
Point size
[Groff-specific] return from a macro. See also .de.
.Rv std function1 function2
Display text stating the standard return values for the functions. Always takes std after the .Rv.
[Manual page macro] "Section heading"
.shift n
Shift the arguments by n positions
.Sm on / off
[Manual page macro] Space mode on / off; do or do not put spaces between arguments
.so file
Include "file". See also .mso.
[Manual page macro] Single quotes
[Manual page macro] "Subsection".
[Manual page macro] Standards of various kinds.
[Manual page macro] A tab in a table. The literal tab character is also used. If you want to go insane, try writing a troff processor.
End of a table (see also .TS).
.TH title section date source manual
[Manual page macro] Title for GNU manual pages. See also .Dd, .Dt for the BSD equivalents.
Temporary indent
.tm message
Terminal message; print message on the terminal.
Indented paragraph with label.
Start of a table (see also .TE).
GNU www.mdoc extension
Reserved version-dependent register (contains major version of groff)
End of an .Xo block.
[Manual page macro] Extend the current line of arguments until .Xc is seen.
.Xr page section
[Manual page macro] Cross-reference to manual page "page" in section "section" of the manual.
Reserved version-dependent register (contains minor version of groff)
Years since 1900
Macro argument n, e.g. \\$1 is the first macro argument.
Connect to next input text (not sure what this means?)
Courier-Bold font
Courier font
Value of number register xx
Value of number register x
Point-size change function
Non-breaking space

Where the command is marked "unknown", I don't know what that command does. I started this list of commands for a project putting Unix manual page translations on the web. If you have any suggestions for improvements, please email them to me (email is at the bottom of the page). The original dictionary from which the above HTML is made is downloadable here.

Web links

Copyright © Ben Bullock 2009-2022. All rights reserved. For comments, questions, and corrections, please email Ben Bullock (benkasminbullock@gmail.com) or use the discussion group at Google Groups. / Privacy / Disclaimer