groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: man(7), hyphen, and minus


From: Russ Allbery
Subject: Re: man(7), hyphen, and minus
Date: Fri, 23 Dec 2022 14:42:42 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

"G. Branden Robinson" <g.branden.robinson@gmail.com> writes:

>    For the (neutral) double quote, you have recourse to an obscure
> syntactical feature of AT&T 'troff'.  Because a double quote can begin a
> macro argument, the formatter keeps track of whether the current
> argument was started thus, and doesn't require a space after the double
> quote that ends it.(2)  (*note Calling Macros-Footnote-2::) In the
> argument list to a macro, a double quote that _isn't_ preceded by a
> space _doesn't_ start a macro argument.  If not preceded by a double
> quote that began an argument, this double quote becomes part of the
> argument.  Futhermore, within a quoted argument, a pair of adjacent
> double quotes becomes a literal double quote.

Incidentally, the rules for the second argument to .ds appear to not
follow the normal rules for macro arguments.

.ds C` ""

defines \*(C` to a single double-quote, but:

.ds C` """"

defines \*(C` to """, not to " as one might expect if that were
interpreted as a quoted argument and then adjacent doublequotes become a
literal double quote.

So far as I can tell, the correct rule for escaping the second argument to
.ds is that you should double any *leading* double quote, but leave all
the other double quotes alone.

.ds C` "

appears to define \*(C` to the empty string.  (I'm not sure where this all
might be documented.)

-- 
Russ Allbery (eagle@eyrie.org)             <https://www.eyrie.org/~eagle/>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]