Ask Your Question

Automatically place en (not em) dashes between numbers [closed]

asked 2013-02-07 22:27:28 +0100

Sulphur Firedot gravatar image

updated 2020-07-20 09:28:34 +0100

Alex Kemp gravatar image

When two hyphens (--) are placed between two numbers, LibreOffice changes them into an em dash, as it does between two words. The problem is that I use the Chicago style for all my work, which stipulates that an en, not em, dash should be used between numbers (like pages numbers and dates).

I want it to create an en dash instead.

I found this answer which shows how to convert them all, but it would be wonderful if it was automatic so I didn't have to periodically run that command. My workaround is to type number, space, --, number, and then go back and delete the space, but that's getting pretty tiring!

Note that the em dash should still be placed between two words (the default is correct here), so: word(em dash)word / number(en dash)number.


edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-03-03 16:55:34.680563


Re: commenting, you needed more karma...

@qubit hits you with his karma wand

Aaaand there you go :-)

(A full list of the karma levels required to perform certain actions on the site is available via the faq link at the bottom of the page)

qubit gravatar imagequbit ( 2013-02-08 00:03:54 +0100 )edit

Ah, gotcha. Thanks!

Sulphur Firedot gravatar imageSulphur Firedot ( 2013-02-08 00:06:24 +0100 )edit

5 Answers

Sort by » oldest newest most voted

answered 2013-02-09 13:21:32 +0100

manj_k gravatar image

updated 2013-06-05 12:07:03 +0100

[For a better understanding of the issue]

How to use "AutoCorrect Options → Replace dashes"

Replace Dashes
Replaces one or two hyphens with a long dash (see the following table). Text will be replaced after you type a trailing white space (space, tab, or return). In the following table, the A and B represent text consisting of letters A to z or digits 0 to 9.


Source (new):

edit flag offensive delete link more



It is unfortunate, but it looks like manually inserting en and em dashes is the best option. Those options look good, though I found what was easiest was to just set a compose key in my OS instead, so it works across all programs (Ubuntu 12.04: System settings -> Keyboard layout -> Options).

Sulphur Firedot gravatar imageSulphur Firedot ( 2013-02-11 18:23:01 +0100 )edit

BTW: I've modified my default keyboard layout (on WinXP) with MSKLC:

Ctrl+Alt+- = – (en-dash)

Ctrl+Alt+Shift+- = — (em-dash).

manj_k gravatar imagemanj_k ( 2013-02-11 20:40:22 +0100 )edit

@manj_k how do you find this cool stuff?

horst gravatar imagehorst ( 2013-02-13 02:35:28 +0100 )edit

@horst – See the link "MSKLC" above.

manj_k gravatar imagemanj_k ( 2013-02-13 10:51:35 +0100 )edit

answered 2014-09-05 18:30:48 +0100

László Németh gravatar image

updated 2014-09-06 00:35:50 +0100

Fixed problem: now autocorrect replacement uses en dash between digits, see fdo#62923 and the updated help page. Thanks for your suggestion!

edit flag offensive delete link more

answered 2013-02-08 00:07:13 +0100

horst gravatar image

You can also define new key combinations in autocorrect. E.g. "--" for en-dash and "---" for em-dash.

edit flag offensive delete link more


slick idea!

qubit gravatar imagequbit ( 2013-02-09 11:24:22 +0100 )edit

That works only for detached en-/em-dashes – the replacement table lists the entries for automatically replacing words or abbreviations. You can't type "1–2" without an additional space after the first number, when you want to use AutoCorrect → Replace, or ...Options → Replace dashes.

manj_k gravatar imagemanj_k ( 2013-02-09 13:00:34 +0100 )edit

answered 2013-02-10 17:20:33 +0100

horst gravatar image

I think the best solution for you is to download and install from here. Define a control character (e.g. Alt+Ctrl+B) and then you can enter both en-dash(.-) or em-dash(--) plus Control Character without leading or trailing blanks.

I hope we did not confuse you completely :).

edit flag offensive delete link more

answered 2013-02-07 23:24:46 +0100

qubit gravatar image

updated 2013-02-07 23:26:10 +0100

You may tweak the default replacement under AutoCorrect Options:

Navigate to Tools -> AutoCorrect Options and click on the "Replace" tab. The first item in the list (at least for me) is

 "--" -> "–"

Change the character in the "With" field from an em-dash to an en-dash and the replacement will work.

Note that this will change all replacements, not just ones for numbers.

edit flag offensive delete link more


Also take a look at fdo#56307 - "Grammar checker insists on em dash, inconsistent with Auto-correct"

qubit gravatar imagequbit ( 2013-02-07 23:30:20 +0100 )edit

Thank you, but my AutoCorrect options are the same as yours. This help page notes the rules LibreOffice uses for converting hyphens to dashes, which apparently trump that option (it would do me little good anyhow, since I need both en & em dashes).

Sulphur Firedot gravatar imageSulphur Firedot ( 2013-02-08 00:05:52 +0100 )edit

Question Tools

1 follower


Asked: 2013-02-07 22:27:28 +0100

Seen: 7,561 times

Last updated: Sep 06 '14