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

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.

Thanks!

edit retag 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)

( 2013-02-08 00:03:54 +0200 )edit

Ah, gotcha. Thanks!

( 2013-02-08 00:06:24 +0200 )edit

Sort by » oldest newest most voted

[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.

more

Alternative solutions (shortcut keys)

( 2013-02-09 13:44:56 +0200 )edit
1

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).

( 2013-02-11 18:23:01 +0200 )edit

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

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

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

( 2013-02-11 20:40:22 +0200 )edit

@manj_k how do you find this cool stuff?

( 2013-02-13 02:35:28 +0200 )edit

@horst – See the link "MSKLC" above.

( 2013-02-13 10:51:35 +0200 )edit

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

more

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 :).

more

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

more

slick idea!

( 2013-02-09 11:24:22 +0200 )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.

( 2013-02-09 13:00:34 +0200 )edit

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.

more

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

( 2013-02-07 23:30:20 +0200 )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).

( 2013-02-08 00:05:52 +0200 )edit