21

I understand that to be able to type en and em dashes I have to configure the COMPOSE key, or something like that, but I am not sure about that nor on how I get from there to be able to type en and em dashes in addition to the minus sign.

How do I type en and em dashes on Ubuntu GNOME 15.10 with GNOME 3.18?

I have now looked at this answer, so I would now also like to know the code for the en dash and how to assign other keyboard shortcuts to these Unicode characters, as I don't want to have to type something too long in order to get these.

avpaderno
  • 297

3 Answers3

30

You need to learn the Unicode numbers of these two characters. They are not actually hard to remember, because they look like years. ;)

  • En dash: U+2013
  • Em dash: U+2014

To write a Unicode symbol, perform the following actions:

  • Press Ctrl+Shift+U (the display will show something like )
  • Type the code (e.g. 2014)
  • Press Enter

There you go: – —

For a complete reference to Unicode characters, run gucharmap.

9

Compose key can be used like this: ­

  • Compose and then --. gives (en-dash).

  • Compose and then --- gives (em-dash).

The compose key can be set in the advanced keyboard settings

In LibreOffice Writer one can use :--: and :---:.

In LO there is also the method of using the LO auto-corrector and set -- to and --- to for example (but this has the limitation that the automatic corrector acts only after the end of a "word", that is, after Space is pressed, so that, in order to put the em dash close to a word —the way it's often done in English—, you have to delete that space manually etc).

— The compose solution seems the best, as it works everywhere, including in a browser and a terminal.

cipricus
  • 4,066
  • 4
  • 47
  • 106
3

When I look up "em dash" on the gnome 3 overview a result comes up that puts it on the clipboard. I think you need to have gnome-characters installed for it to work.