troff/nroff input, output, and abort

input

.so filename
reads input from filename, then continues with the current file.
.nx filename
continues with filename and doesn't come back. (Like a "goto".)

reading standard input

.rd prompt arg1 arg2 ...
prompts with prompt: (default: beep, if input is from a terminal), and copies text from standard input until an empty line. Arguments to .rd after the prompt can be accessed as \$1, \$2, ...

output

\!text
writes text directly to the formatter. (E.g., PostScript images to a printer that understands them.)

.tm message
prints the message to the standard error stream, presumably the user's terminal.

flush

.fl
flushes output. (E.g., for debugging.)

piping nroff output to commands

.pi command
pipe output to command (nroff only). This must occur before any output. Or before the first BUFSIZ bytes of output, presumably.

Only the first word in command is used, and it's opened without evaluating $PATH; use absolute pathnames or die.

exiting

.ex
ends processing. (The manual has that as .ex prompt, but I assume that prompt was carried over from the previous item, rd.)
.ab text
prints text and aborts.