groff
[Top][All Lists]
Advanced

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

Re: [Groff] U+0027, U+002D, and U+0060 in code examples?


From: Bruno Haible
Subject: Re: [Groff] U+0027, U+002D, and U+0060 in code examples?
Date: Sun, 06 May 2012 12:20:17 +0200
User-agent: KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; )

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  <address@hidden>

        * 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




reply via email to

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