.Dd Created:2025-10-03|Updated:2025-10-06| .de ocsi \\$* , .. .de oxr .ocsi .Xr \\$* .. .de oit .It \\$* .. .de obdi .Bl -dash -compact .oit \\$* .. .de obdl .Bd -literal -compact \\$* .. .de onote .Bl -hang -compact .oit \\$* .El .. .de ocomm .Bl -diag -compact .oit \\$* .El .. .de opsy .Pp .Sy - \\$* .. .de obc .Bl -column \\$* .. .de obc2 .obc opt desc .. .de obc3 .obc option arguments description .. .Dt ROFF oh .Os OpenBSD 7.7| .Nm roff .Nd cheatsheet .Sh DESCRIPTION Document about roff macros that are currently supported by mandoc and compatible with both mdoc/man output with examples. .Sh MACROS .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 .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 TODO .Bl -dash -compact .It pending examples for: while, shift, tr, ti, ta, sp, rj, po, nf, fi, break, br, so .It review and update .It split examples into roff_examples. .El .Sh SEE ALSO .oxr documentation oh .oxr openbsd oh .oxr mdoc oh .Xr mandoc oh .opsy OpenBSD manpages: .Xr roff 7 .El .Sh AUTHORS .An -nosplit .Xr ohazot oh | .Xr about oh | .Lk https://ohazot.com ohazot.com .Aq Mt admin@ohazot.com