12

On Mac and some other systems, typing two hyphens quickly "--", would be automatically converted to an em dash "—" or an en dash "–" depending on the setting. But Stack Exchange fields are different, and this feature does not work.

Therefore, how to type dashes in Stack Exchange?

24

The HTML entities – and — work on all systems: in the rendered post, they will be shown as – resp. —.

On a Mac (and on iOS devices connected to a physical keyboard), you can use + - for an en-dash and ⇧ Shift + + - for an em-dash. ( is the Option or Alt key).

On iOS, you can hold the - button and a sub-menu will appear which allows you to choose between different types of dashes.

On Windows, if you have a numeric keypad, you can use Alt + 0150 resp. Alt + 0151.

| improve this answer | |
  • Oh cool! I forgot about HTML entities... And the Mac shortcut seem to be more handy and as helpful as well!! Thanks! – jackxujh Dec 28 '17 at 14:12
  • @jackxujh thank you for spotting the mistake. I always mix them up; because the m precedes the n in the alphabet, my mind thinks the m must correspond to the shorter dash. – Glorfindel Dec 28 '17 at 14:58
  • 3
    You are welcome! I got that too! I found it is easier to distinguish them by their widths – an em-dash has the width of an "m", which is wider than an en-dash, who has the width of an "n". Wish it help! – jackxujh Dec 28 '17 at 15:06
  • Why can't I get an — here? – HeWhoMustBeNamed Apr 23 at 12:53
  • 1
    @HeWhoMustBeNamed HTML entities don't work in comments. – Glorfindel Apr 23 at 12:57
  • @Glorifindel Then is there any way to get an em-dash in comments, apart from copying and pasting? – HeWhoMustBeNamed Apr 23 at 13:00
  • 1
    @HeWhoMustBeNamed No, not really. – Glorfindel Apr 23 at 13:01
  • @Glorfindel can't you use the other methods described in your answer (i.e. Windows and Mac key combinations)? Since they don't use html-encoded strings and instead use the actual unicode character edit: — it works for Mac. – Kodos Johnson 2 days ago
5

On Chrome OS and some Linux distros, you can press Ctrl+Shift+U, then type:

  • 2013 for an en-dash, or
  • 2014 for an em-dash

(You can also type the hex code of any other Unicode character to enter it, too)

| improve this answer | |
0

The system doesn't have a way to do this. People achieve it by having their own shortcuts or by copying and pasting them.

Shift plus dash becomes underscore because that's how QWERTY keyboards are set up. That's not a Stack Exchange customization.

| improve this answer | |
  • 1
    Thanks for the reminder of the shortcut for underlines! – jackxujh Dec 28 '17 at 15:07
0

In addition to what @Glorfindel has mentioned about the use of

On a Mac (and on iOS devices connected to a physical keyboard), you can use + - for an en-dash and ⇧ Shift + + - for an em-dash. ( is the Option or Alt key).

On Windows, if you have a numeric keypad, you can use Alt + 0150 resp. Alt + 0151.

There's a great extension ChromeDash that solves this problem gracefully. I find this to be a much better solution then using the cumbersome commands. But note that this only works on Google Chrome.

Simple Instructions of use-case

Simply enter two dashes (hyphens) for an en–dash, and three for an em–dash! This can be changed, as can all other aliases you make!

This works nearly anywhere, in google, hangouts, messenger, facebook, etc.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .