groff
[Top][All Lists]
Advanced

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

Re: [Groff] escaping punctuation in mdoc pages


From: Werner LEMBERG
Subject: Re: [Groff] escaping punctuation in mdoc pages
Date: Fri, 04 Jul 2003 23:08:15 +0200 (CEST)

> I've been having a look at the new mdoc stuff in groff, and I'm
> really confused about when punctuation needs to be escaped, and when
> not.

A leading dot and a leading right single quote starting a line are
interpreted as control characters.

> I take it that it's *not* necessary in the body of text, only within
> macros?

You don't have to protect them within macros.

> Is it necessary within a display (.Bd)?

Only for leading dots and leading right single quotes starting a line.

> Also take the following examples:
> 
>       .Pa .file
>       .Pa /
>       .Pa /root
>       .Dq !?foo?^ !$
>       ^lb^lib
>       ?foo?
>       .Ic !la
> 
> I have no idea which parts of these macros need escaping, and which
> don't.

Nothing needs escaping.

> One more point: is there a difference between "\-1" and "\&-1"? Are
> these both correct ways to represent minus, or is it possible they
> could format differently?

There is a difference.  `\-' is a minus, `-' is a hyphen, and `\&' is
a zero-width invisible character.  Only `\-1' is correct.

> groff_mdoc(7) is not very helpful about what to do here, and in most
> cases I detect no difference in output.

You should read the info pages of groff which have a complete
reference of troff(1).  Another helpful page is groff_char(7).


    Werner

reply via email to

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