This is a work in progress to document some troff commands and
common macros. See also groff, groff,
groff_man, groff_mdoc,
groff_char and mdoc.samples.
" | in a string definition, marker for whitespace at the beginning of the string. |
$0 | name of the macro executing |
.$ | 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. |
.as name string | Append string to string name (append version of .ds). |
.Bd | Begin display. This can begin indented text, preformatted text like source code, or filled text depending on the argument. The section ends with .Ed.
|
.Bf | begin a font, either emphasis, symbolic (bold) or literal (monospace). See also .Ef. |
.Bk | Begin keep. See also .Ek. |
.c | 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) |
.Dd | [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 ...
|
.Dl | literal line |
.Dq | [Manual page macro] double quotes |
.Dq | 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 | [Manual page macro] Title for BSD manual pages. See also .Dd, .TH. |
.Dt title | [Manual page macro] Set document title to title |
.ec | reset escape character to \ |
.ec c | Set escape character to c. |
.ec c | set escape character to "c". If c is empty, set it to \. |
.Ed | End of a .Bd block. |
.Ef | end a font started with .Bf |
.Ek | End keep. See also .Bk. |
.el | if / else else part; see also .ie and .if. |
.eo | turn off escape mechanism |
.EQ | Start of equation |
.f | predefined read-only register containing number of current font. |
.F | current input file name |
.fi | fill (join lines); see also .nf. |
.Fn function | [Manual page macro] Function |
.ft R | font change |
.g | [Groff-specific] register which is true for GNU troff (groff) |
.ie | 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 | if statement; see also if / else using .ie and .el. |
.It | [Manual page macro] List item |
.Lb | [Manual page macro] Macro which expands to the name of a library. |
.Ms | mathematical symbol |
.mso name | include macro package name. See also .so. |
.MTO | GNU mailto www extension |
.na | No adjust. Ragged right margin. |
.Nd | [Manual page macro] Emphasize following text (used in SYNOPSIS section). |
.nf | no fill (do not join lines); see also .fi. |
.nh | no hyphenation |
.Nm | Name of command. |
.nop anything | Always execute "anything". |
.nr R N | set value of number register R to N |
.nx filename | Switch to file filename, do not return to current file. See also .so.
|
.Os | [Manual page macro] Macro which expands to the name of the operating system. |
.PP | [Manual page macro] New paragraph |
.ps | point size |
.return | [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. |
.Sc | |
.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 | |
.so file | include "file". See also .mso. |
.Sq | [Manual page macro] single quotes |
.Ss | [Manual page macro] "Subsection". |
.TE | 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. |
.ti | temporary indent |
.tm message | terminal message; print message on the terminal. |
.TP | Indented paragraph with label. |
.TS | Start of a table (see also .TE). |
.URL | GNU www.mdoc extension |
.x | reserved version-dependent register (contains major version of groff) |
.Xc | End of an .Xo block. |
.Xo | [Manual page macro] extended argument |
.Xo | 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. |
.y | reserved version-dependent register (contains minor version of groff) |
.yr | years since 1900 |
\ <new line> | Line continuation marker. |
\$* | unknown |
\$@ | 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 α |
\(co | copyright mark, © |
\*(xy | string xy defined by .ds |
\*[] | string with arbitrary length. See also \*x, \*(xy, and .ds |
\*x | string x defined by .ds |
\[la] | < |
\[ra] | > |
\\$n | macro argument n, e.g. \\$1 is the first macro argument. |
\c | connect to next input text (not sure what this means?) |
\f[CB] | Courier-Bold font |
\f[CO] | Courier font |
\n(xx | value of number register xx |
\nx | value of number register x |
\s | point-size change function |
\~ | non-breaking space |