A recent LWN.net article <https://lwn.net/Articles/947941/> (paywalled 
for a while) pointed at https://bugs.debian.org/1041731 and the topic of 
"-" vs "\-".

Given the following input:

        -\-\[u002D]\[u2013]\[u2014]+\[u2212]

Feeding it through `groff -Tutf8`, I get

        ‐−-–—+−
        <U+2010><U+2212><U+002D><U+2013><U+002B><U+2014>

groff_char(7) says \- maps to "minus sign/Unix dash". Ambiguous, but
ok, it is what it is. Is there a better way though than to explicitly
use \[u002D] to get a guaranteed U+002D?

Second, I turn to PostScript output that is generated by
`groff -Tps`. One observes:

        troff:<standard input>:1: warning: special character 'u002D' not defined

(Converting the PS to PDF and opening that with evince), the rendered
view shows a hyphen, a minus, an endash, an emdash, and another minus
but rendered in a different vertical position which does not line up
with the '+' sign.

Third, when one copy-pastes the string shown in evince, I get back:

        -−–—+−
        <U+002D><U+2212><U+2013><U+2014><U+002B><U+2212>

I expected to receive:

        <U+2010><U+002D><U+2013><U+2014><U+002B><U+2212>

so that copypasting commands from PS/PDF would work "right"
similarly as it does for manpages when they use \-.

Reply via email to