Arguments to requests and macros are processed much like the shell: The line is split into arguments according to spaces.1
An argument to a macro which is intended to contain spaces can either be enclosed in double quotes, or have the spaces escaped with backslashes. This is not true for requests.
Here are a few examples for a hypothetical macro
.uh The Mouse Problem .uh "The Mouse Problem" .uh The\ Mouse\ Problem
The first line is the
uh macro being called with 3 arguments,
‘The’, ‘Mouse’, and ‘Problem’. The latter two have the
same effect of calling the
uh macro with one argument, ‘The
A double quote which isn't preceded by a space doesn't start a macro argument. If not closing a string, it is printed literally.
.xxx a" "b c" "de"fg"
has the arguments ‘a"’, ‘b c’, ‘de’, and ‘fg"’. Don't rely on this obscure behaviour!
There are two possibilities to get a double quote reliably.
.de xx . tm xx: `\\$1' `\\$2' `\\$3' . . yy "\\$1" "\\$2" "\\$3" .. .de yy . tm yy: `\\$1' `\\$2' `\\$3' .. .xx A "test with ""quotes""" . ⇒ xx: `A' `test with "quotes"' `.' ⇒ yy: `A' `test with ' `quotes""'
If not in compatibility mode, you get the expected result
xx: `A' `test with "quotes"' `.' yy: `A' `test with "quotes"' `.'
gtroff preserves the input level.
\(dq. This works with and without compatibility mode enabled since
\(dqback to a double quote input character.
Note that this method won't work with UNIX
general since the glyph `dq' isn't defined normally.
Double quotes in the
ds request are handled differently.
See Strings, for more details.
 Plan 9's
troff implementation also allows
tabs for argument separation –
gtroff intentionally doesn't
 The last solution, i.e., using escaped spaces,
is “classical” in the sense that it can be found in most
documents. Nevertheless, it is not optimal in all situations, since
‘\ ’ inserts a fixed-width, non-breaking space character which
gtroff provides a different command
insert a stretchable, non-breaking space.