.de XX YYbegins the definition of macro XX. The definition continues until command YY; the default for YY is a single dot. Consequently, macro definitions usually look like
.de XXThe terminating command is executed during the definition of the macro, but not copied.
The text in the macro is read and copied in copy mode. To place a line with .. in a macro (e.g. because your macro defines another macro), use
removing and renaming
.rm XXremoves the definition of macro or string XX.
.rn XX YYrenames XX to YY.
Macro arguments are tokenized into words; words can be quoted with double quotes (") to embed white space. Within quotes, two double quotes ("") are folded into one literal double quote; consequently, """" expands to one literal ".
\$Naccesses the current macro argument N (for N in 0..9). When defining macros, you'll want to use
\\$Ntwo slashes - you don't want the macro argument evaluated during the definition, only when the macro is expanded.
.pmprints the names and sizes (in blocks of 128 bytes) of all defined macros, followed by their total size; or, in the second form, only the total.