Ivan Shmakov wrote:
> > But a hyphens looks nicer when it is thin; \[u2012] achieves this.
> > What you really want to do is to change your groff input so that it
> > uses
>
> > * - for hyphens,
> > * \- for minus signs.
>
> > \fBiconv \-f ISO\-8859\-1 \-t UTF\-8\fP
> > converts input from the old West-European encoding ISO\-8859\-1 to
> > Unicode.
>
> Do I understand it correctly that this will produce U+2212
> (MINUS SIGN) in the example command line? Wouldn't it prevent
> this example from working should one copy it (from either $ man,
> or a PDF) to the command-line interpreter?
It depends on the output format ("device"):
* When using -Tps and converting to PDF, copy&paste will produce
U+2212 for the minus sign ('\-' input) and
U+002D for the hyphen ('-' input).
(I tried it with KDE's konqueror-embedded PDF viewer.)
But copy&paste from PDF always needs postprocessing: In particular,
I find the problem of the 'fi' ligature more inconventient when
copy&pasting from PDF. In other words, I think the copy behaviour
from PDF files should be corrected in the PDF viewers, not in groff.
The main purpose of PostScript and PDF output is to produce good-looking
printable output.
* When using -Tutf8, copy&paste will produce:
In groff < 1.20:
U+2212 for the minus sign ('\-' input) and
U+2010 for the hyphen ('-' input).
In groff >= 1.20, with the -man or -mandoc macro packages:
U+002D for the minus sign ('\-' input) and
U+002D for the hyphen ('-' input).
The latter change was done by Werner:
2009-01-03 Werner LEMBERG <[email protected]>
* tmac/an-old.tmac, tmac/doc.tmac: For -Tutf8, map \-, -, ', and `
conservatively to ASCII for the sake of easy cut and paste.
While it produces suboptimal typography, the justification is that
for a terminal output copy&paste is more important than fine points
of typography, and many man pages still use '-' instead of '\-'
for minus signs (because they have not been well tested with -Tdvi
or -Tpdf).
Bruno