groff
[Top][All Lists]
Advanced

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

Re: [Groff] : ASCII Minus Sign in man Pages


From: Ralph Corderoy
Subject: Re: [Groff] : ASCII Minus Sign in man Pages
Date: Wed, 03 May 2017 11:27:14 +0100

Hi Doug,

> Originally \(pl and \(mi came from a fixed font (S) while + and \-
> came from the current font.

That matches CSTR 54 which has

    \-    Minus sign in the current font

in the table near the beginning and \(pl and \(mi as `Special Character
Names' on the last page.

> As I understand your comment, groff has reversed this troff
> convention. Additionally groff interprets - as a compromise
> HYPHEN-MINUS.

It's not that simple.  :-)  Here's groff 1.22.3-7 with a UTF-8 terminal.

    $ nroff <<<'- \- \(mi + \(pl' | tr -d ' \n' | recode ..dump
    UCS2   Mne   Description

    2010   -1    hyphen
    2212   -2    minus sign
    2212   -2    minus sign
    002B   +     plus sign
    002B   +     plus sign
    $ 

    $ troff -Tutf8 <<<'- \- \(mi + \(pl' | egrep 'font|^[Ct]'
    x font 1 R
    Chy
    C\-
    Cmi
    t+
    Cpl
    $

nroff never gave U+002D, an ASCII minus.  This is a problem for a man
page wanting text with an ASCII minus that can be cut and pasted to sh.
Because Unicode has reached the TTY, and PDF can be viewed as pixels,
we've migrated away from the many-usage ASCII minus to the other
specific, more typographic, runes.

The PostScript from groff is

    /F0 10 /address@hidden SF
    2.5<2dad>72 12 S            PostScript names: 2d=hyphen  ad=softhyphen
    /F1 10 /Symbol SF
    (-) A
    F0
    (+) 2.5 E
    F1
    (+) 2.5 E
    0 Cg EP

So troff's characters map onto these PostScript fonts and characters.

    -     Times-Roman  hyphen
    \-    Times-Roman  softhyphen
    \(mi  Symbol       hyphen
    +     Times-Roman  plus
    \(pl  Symbol       plus

All five look distinct here in gv(1) and match your description;  \(mi
and \(pl are the Symbol font, \- and + are the current font.

As a solution, Ingo made the suggestion to switch \- to always be ASCII
minus because we thought \(mi was another name for \- and so still
available for the original use of a mathematical minus sign.  It's spelt
out half-way through
https://lists.gnu.org/archive/html/groff/2017-04/msg00052.html starting
"That leads to a natural suggestion solving *both* of these problems".

But you've thrown a spanner by pointing out \- and \(mi are not
equivalent.  :-)

Ingo, I think this means we need to pause on the switching of \- to
always be ASCII minus.

> man groff_char, however, tells the original state of affairs.  What is
> one to believe?

groff_char(7) is correct.

    Output  Input  PostScript  Unicode  Notes
    +       \[pl]  plus        u002B    plus in special font
    −       \[mi]  minus       u2212    minus in special font

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy



reply via email to

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