_ _ ___ | |__ __ _ _______ | |_ / _ \| '_ \ / _` |_ / _ \| __| | (_) | | | | (_| |/ / (_) | |_ \___/|_| |_|\__,_/___\___/ \__|
| ohazot | docs | links | dev | conf | txt |
| es | en |
| mdoc file |
| search |
roff —
cheatsheet
DESCRIPTION
Document about roff macros that are currently supported by mandoc and compatible with both mdoc/man output with examples.
MACROS
- 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
EXAMPLES
ds
.ds string text .string
text
as
.as string newtext .string
textnewtext
als
.als newstring string .newstring
textnewtext
de
.de m .Em macrodef .. .m
macrodef
.de m .Em macrodef \\$1 .. .m test
am
.am m .Em macroappend ..
macrodef macroappend
ft
.ft BI .text in bold italic .ft P
text in bold italic
nr
.nr r 1
rr
.rr r
if
.if ( \nr == 1 ) \{\
.Em is 1
.\}
..
el
ie
.ie ( \nr == 1 ) \{\
.Em nr is 1
.\}
.el .Em nr is 0
nr is 1 nr is 0
ig
.ig text ..
rm
.rm string
TODO
- pending examples for: while, shift, tr, ti, ta, sp, rj, po, nf, fi, break, br, so
- review and update
- split examples into roff_examples.
SEE ALSO
documentation , openbsd , mdoc , mandoc
- OpenBSD manpages: roff(7)