First time here? Check out the FAQ!
The question says it all: how does one convert every dash between numbers to en-dash (a common publishing convention)? That is, change e.g. "27-32" to "27–32" without changing the hypen in, e.g. "bitter-sweet" to an en-dash as well?
It turns out there is a trick to the use LibreOffice's regular expressions that took a bit of head-scratching. For changing hyphen/dash to en-dash between numbers only, this is what to do:
Commentary: the "search" looks for any dash that is preceded and followed by a number. The "replace" value changes only the dash to an en-dash, while
$2 represent the values found in the search for the first and second terms, and retains them unchanged.
That ought to do it. It works for me, at any rate! Hope this is a help for others.
Sorry I messed up the attempt to make a corrective comment to my answer. Here the correction - and I hope not save mistake happens again.
actually there should be space between figures and a hyphen/dash/en-dash when you write a text in writer. (mathematical formulas in Calc are different!!!)
Thus when you type: "2 space hyphen space 3 space" the hyphen (short) changes to the en-dash (longer) The "space" after the "3" triggers writer to change the hyphen to the en-dash.
i need to apologize because me answer above contains an error. My statement "actually there should be space between figures and a hyphen/dash/en-dash when you write a text in writer." is wrong. Between to numbers, indicating a range from a to b there should be no space before and after the en dash.
Best to read: https://en.wikipedia.org/wiki/Dash and note there under "Em dash" the paragraph "According to most American sources (such as The Chicago Manual of Style) and some British sources (such as The Oxford Guide to Style), an em dash should always be set closed, meaning it should not be surrounded by spaces. But the practice in some parts of the English-speaking world, including the style recommended by The New York Times Manual of Style and Usage, sets it open, separating it from its surrounding words by using spaces or hair spaces (U+200A) when it is being used parenthetically. Some writers, finding the em dash unappealingly long, prefer to use an open-set en dash. This "space, en dash, space" sequence is also the predominant style in German and French typography. See En dash versus em dash below."
LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!
Asked: 2012-10-22 09:35:23 +0200
Seen: 396 times
Last updated: Oct 31 '12