←back to thread

650 points Stratoscope | 7 comments | | HN request time: 0.207s | source | bottom
Show context
mmooss ◴[] No.43499567[source]
Here's an easy, if not always precise way to remember:

* Hyphens connect things, such as compound words: double-decker, cut-and-dried, 212-555-5555.

* EN dashes make a range between things: Boston–San Francisco flight, 10–20 years: both connect not only the endpoints, but define that all the space between is included. (Compare the last usage with the phone number example under Hyphens.)

* EM dashes break things, such as sentences or thoughts: 'What the—!'; A paragraph should express one idea—but rules are made to be broken.

Unicode has the original ASCII hyphen-minus (U+002d), as well as a dedicated hyphen (U+2010), other functional hyphens such as soft and non-breaking hyphens, and a dedicated minus sign (U+2212), and some variations of minus such as subscript, superscript, etc.

There's also the figure dash "‒" (U+2012), essentally a hyphen-minus that's the same width as numbers and used aesthetically for typsetting, afaik. And don't overlook two-em-dashes "⸺" and three-em-dashes "⸻" and horizontal bars "―", the latter used like quotation marks!

replies(12): >>43499795 #>>43500096 #>>43500276 #>>43500389 #>>43500958 #>>43501074 #>>43502495 #>>43503176 #>>43504564 #>>43507109 #>>43512927 #>>43570687 #
1. divbzero ◴[] No.43500096[source]
I prefer the dedicated minus (U+2212) over the hyphen-minus (U+002d) for mathematical use because they look different in most font faces.

Are there cases where the dedicated hyphen (U+2010) is preferred over the hyphen-minus?

replies(5): >>43500351 #>>43500372 #>>43501078 #>>43504265 #>>43505733 #
2. LegionMammal978 ◴[] No.43500351[source]
G. Brandon Robinson swears by U+2010 for hyphens in groff's Unicode output [0], but I see it as a hypercorrection. The most common convention by far (among authors who use Unicode and care about dashes) is to use U+002D for hyphens and U+2212 for minus signs. Not even the Unicode Consortium uses U+2010 for hyphens in its documents, and I'm not aware of any major organization that does.

As far as appearance goes, almost all fonts I've looked at make U+2010 identical to U+002D (i.e., they don't put any 'minus' into the 'hyphen-minus'), but a few make U+2010 a smidgeon shorter.

[0] https://news.ycombinator.com/item?id=38121765

replies(1): >>43511038 #
3. wruza ◴[] No.43500372[source]
Intl.NumberFormat also prefers it, but then you can't paste negative numbers into most financial software, calculators, spreadsheets. Even back into inputs on the same webpage, if it does custom number parsing. Even though <input type=number> accepts U+2212 as a minus, it turns it into a regular minus when you spin it down to -2.

It looks much better though and more visible: −1 vs -1. I wish hyphen was a separate symbol from the ascii start, or that monospace fonts didn't tend to shorten "-" cause it makes little sense in monospace anyway.

4. mproud ◴[] No.43501078[source]
A regular hyphen arguably looks better when used as a hyphen and not a minus.
5. zajio1am ◴[] No.43504265[source]
Visual style of hyphen-minus depends on font. Some fonts displays it more like a minus, others like a hyphen. So if you care about distinguishing hyphen and minus, it makes sense to use dedicated hyphen and minus, and do not use hyphen-minus at all.
6. layer8 ◴[] No.43505733[source]
It has two potential benefits:

— In the context of automatic text processing, it unambiguously indicates the function of a hyphen, as opposed to a minus

— Fonts can choose to make the hyphen-minus a bit wider than a regular hyphen, to accommodate the usage as a minus sign. In that case, U+2010 would be typographically more appropriate for a hyphen, similar to how U+2212 usually is typographically more appropriate for a minus sign.

7. mmooss ◴[] No.43511038[source]
Edit: G. Branden Robinson (note spelling) is the maintainer of groff.

https://www.gnu.org/software/groff/