.Dd Created:$Mdocdate$ .Dt ohazot_roff .Tg back_to_top .Bd -literal -compact _ _ ___ | |__ __ _ _______ | |_ / _ \\| '_ \\ / _` |_ / _ \\| __| | (_) | | | | (_| |/ / (_) | |_ \\___/|_| |_|\\__,_/___\\___/ \\__| .Ed .Tg menu .Bl -column ".Sy ohazot " ".Sy ohazot " ".Sy ohazot " .It Xr ohazot oh Ta | .Xr docs oh Ta | .Xr about oh Ta .El .Dd Created:2025-10-03|Updated:2025-10-06 .Dt ohazot_roff .Os OpenBSD .Sh NAME .Sx back_to_top .Nm roff .Nd cheatsheet .Sh DESCRIPTION .Sx back_to_top Document about roff macros that are currently supported by mandoc and compatible with both mdoc/man output with examples. .Sh MACROS .Sx back_to_top .Bl -hang -compact .It .Sx als : create alias for request,string, macro, diversion .Dl als newname oldname .It .Sx am : append to a macro definition .Dl am macroname .It .Sx as : append to string .Dl as stringname .It .Sx br : break line .It .Sx break : break loop .It .Sx de : define a macro .Ed .It .Sx ds : define user string .Dl ds stringname string .It .Sx el : else .Dl el body .It .Sx fi : switch to fill mode .It .Sx ft : font selection .Dl ft font .It .Sx ie : if/else if .Sx if .It .Sx if : conditional statement .Ed .It .Sx ig : ignore input .It .Sx nf : switch to no-fill mode .It .Sx nr : define a numeric register .Dl nr s 0 .It .Sx po : horizontal page offset .Dl po +/-offset .It .Sx rj : justify the next N lines to the right .Dl rj N .It .Sx rm : remove a request, macro or string .Dl rm item .It .Sx rr : remove a register .Dl rr register .It .Sx shift : shift macro arguments .Dl shift N .It .Sx so : source file .Dl so oh_header.7 .It .Sx sp : break output line and emit vertical space .Dl sp height .It .Sx ta : set tab stop, use without arguments to remove it .Dl ta width .It .Sx ti : indent the next output line by width .Dl ti +/-width .It .Sx tr : translate glyph .Dl tr input output .It .Sx while : while loop .El .Sh EXAMPLES .Sx back_to_top .Ss ds .Bd -literal -compact \&.ds string text \&.string .Ed .ds string text .string .Ss as .Bd -literal -compact \&.as string newtext \&.string .Ed .as string newtext .string .Ss als .Bd -literal -compact \&.als newstring string \&.newstring .Ed .als newstring string .newstring .Ss de .Bd -literal -compact \&.de m \&.Em macrodef \&.\&. \&.m .Ed .de m .Em macrodef .. .m .Bd -literal -compact \&.de m \&.Em macrodef \\\\$1 \&.\&. \&.m test .Ed .de m .Em macrodef \\$1 .. .m test .Ss am .Bd -literal -compact \&.am m \&.Em macroappend \&.\&. .\&.m .Ed .am m .Em macroappend .. .m .Ss ft .Bd -literal -compact \&.ft BI \&.text in bold italic \&.ft P .Ed .ft BI text in bold italic .ft P .Ss nr .Bd -literal -compact \&.nr r 1 .Ed .nr r 1 .Ss rr .Bd -literal -compact \&.rr r .Ed .Ss if .Bd -literal -compact \&.if ( \\nr == 1 ) \\{\\ \&.Em is 1 \&.\\} \&.. .Ed .if ( \nr == 1 ) \{\ .Em is 1 .\} .. .Ss el .Ss ie .Bd -literal -compact \&.ie ( \\nr == 1 ) \\{\\ \&.Em nr is 1 \&.\\} \&.el .Em nr is 0 .Ed .ie ( \nr == 1 ) \{\ .Em nr is 1 .\} .el .Em nr is 0 .rr r .ie ( \nr == 1 ) \{\ .Em nr is 1 .\} .el .Em nr is 0 .Ss ig .Bd -literal -compact \&.ig text \&.\&. .Ed .ig text .. .Ss rm .Bd -literal -compact \&.rm string .Ed .rm string .string .Sh SEE ALSO .Sx back_to_top .Ss OpenBSD manpages .Xr roff 7 .Sh TODO .Sx back_to_top .Bl -dash -compact .It pending examples for: while, shift, tr, ti, ta, sp, rj, po, nf, fi, break, br, so .It review and update .El .Ss files .In roff.oh .Sh AUTHORS .Sx back_to_top .An -nosplit .Xr ohazot oh | .Xr about oh | .Lk https://ohazot.com ohazot.com .Aq Mt admin@ohazot.com