_                    _
  ___ | |__   __ _ _______ | |_
 / _ \| '_ \ / _` |_  / _ \| __|
| (_) | | | | (_| |/ / (_) | |_
 \___/|_| |_|\__,_/___\___/ \__|

back_to_top

roffcheatsheet

back_to_top

Document about roff macros that are currently supported by mandoc and compatible with both mdoc/man output with examples.

back_to_top

als: create alias for request,string, macro, diversion
als newname oldname
am: append to a macro definition
am macroname
as: append to string
as stringname
br: break line
break: break loop
de: define a macro
ds: define user string
ds stringname string
el: else
el body
fi: switch to fill mode
ft: font selection
ft font
ie: if/else if if
if: conditional statement
ig: ignore input
nf: switch to no-fill mode
nr: define a numeric register
nr s 0
po: horizontal page offset
po +/-offset
rj: justify the next N lines to the right
rj N
rm: remove a request, macro or string
rm item
rr: remove a register
rr register
shift: shift macro arguments
shift N
so: source file
so oh_header.7
sp: break output line and emit vertical space
sp height
ta: set tab stop, use without arguments to remove it
ta width
ti: indent the next output line by width
ti +/-width
tr: translate glyph
tr input output
while: while loop

back_to_top

.ds string text
.string

text

.as string newtext
.string

textnewtext

.als newstring string
.newstring

textnewtext

.de m
.Em macrodef
..
.m

macrodef

.de m
.Em macrodef \\$1
..
.m test
macrodef test

.am m
.Em macroappend
..

macrodef

.ft BI
.text in bold italic
.ft P

text in bold italic

.nr r 1

.rr r

.if ( \nr == 1 ) \{\
.Em is 1
.\}
..

.ie ( \nr == 1 ) \{\
.Em nr is 1
.\}
.el .Em nr is 0

nr is 1 nr is 0

.ig
text
..

.rm string

back_to_top

roff(7)

back_to_top

<roff.oh>

back_to_top

ohazot | about | ohazot.com <admin@ohazot.com>

Created:2025-10-03|Updated:2025-10-06 OpenBSD