[Top][All Lists]

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

Re: [groff] hyphen, minus sign and hyphen-minus

From: Ingo Schwarze
Subject: Re: [groff] hyphen, minus sign and hyphen-minus
Date: Mon, 28 May 2018 17:01:51 +0200
User-agent: Mutt/1.8.0 (2017-02-23)

Hi Pali,

Pali Rohar wrote on Mon, May 28, 2018 at 04:28:51PM +0200:
> On Sunday 27 May 2018 21:58:07 Ingo Schwarze wrote:
>> Ingo Schwarze wrote:

>>> So usage of mathematical minus sign (\-) is recommended as 0x2D
>>> character for describing command line options in manpage?

>> Unfortunately, yes, that is the consensus regarding best practice,
>> for want of a better alternative.

> Ok, and the remaining question, how to type mathematical minus sign
> in manual page if \- is used for 0x2D?

You have to use \- for that as well, just like in any other
non-manual-page document.

The escape sequences \(mi and \(pl are appropriate in the context
of larger mathematical formulae, which rarely occur in manual pages.
On output devices supporting that, they select plus and minus glyphs
from a special font that may look better in combination with other
mathematical symbols.  For plus and minus in the middle of running
text, using just \- and + is more appropriate, though.

> Probably it is no so common,

Quite to the contrary, it is very common and appears in almost all
section 3 manual pages:

     Upon successful completion, the value 0 is returned; otherwise
     the value -1 is returned and the global variable errno is set
     to indicate the error.

> but in
> some cases it makes sense to express negative numbers which are not
> command line switches.  As HTML, PDF, PS and DVI outputs can show
> different glyph for mathematical minus sign and other command line
> switches.

For output devices supporting it (like -Tutf8), mathematical minus 
correctly encoded as \- in manual pages will be shown as hyphen-minus.
That's a price that has to be paid.

By the way, it doesn't matter whether \- represents a command
line switch.  What matters is whether it is a syntax element
hyphen-minus in some formal language of any kind (C, sh, Perl,
whatever); command line switches are just one example.  In

        for (i = 10; i > \-1; i\-\-)

you also want the \-s rendered as hyphen-minus if possible, not
mathematical minus, because it matters more that they represent
the "-" token of the C language than that they can be considered
as mathematical minus signs.


reply via email to

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