groff
[Top][All Lists]
Advanced

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

[Groff] ASCII Minus Sign in man Pages.


From: Ralph Corderoy
Subject: [Groff] ASCII Minus Sign in man Pages.
Date: Thu, 20 Apr 2017 23:37:48 +0100

Hi,

If a command is called /bin/foo-bar and it processes a file format
foo-xyzzy, then should their man pages use

    foo\-bar
    .IR foo\-bar (1)
    .IR foo\-xyzzy (5)

...and so on?  That's what I thought, `foo-bar' being a hyphen.

Various things around the place collude so both `\-', or the wrong,
hyphen, `-', produce U+002D, e.g.
/usr/share/groff/1.22.3/tmac/an-old.tmac has

    .\" For UTF-8, map some characters conservatively for the sake
    .\" of easy cut and paste.
    .
    .if '\*[.T]'utf8' \{\
    .  rchar \- - ' `
    .
    .  char \- \N'45'
    .  char  - \N'45'
    .  char  ' \N'39'
    .  char  ` \N'96'
    .\}

But for a man page that's cross platform, non-groff, e.g. AIX, and to be
seen in a variety of formats, all groff's `-T's at least, how does one
ensure that U+002D will result so it can be cut and pasted back to the
shell?  Investigation is hamped by some viewers, e.g. PDF, seeming to
translate non-U+002D back to U+002D as a "favour".  :-)  Fine, but one
can't assume the user's PDF viewer will do this.

\N'45' is portable since it's CSTR 54, but it's Nth character of the
current font.  Does that mean I should use this wherever I want to
ensure U+002D appears in the output for pasting?

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



reply via email to

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