Documentation/How Tos/Inserting En and Em Dashes
Dashes are longer than hyphens. The two main types of dash are the en dash (roughly the width of the letter n) and the em dash (roughly the width of the letter m). Wikipedia has lots of information about when to use en or em dashes.
Apache OpenOffice provides a convenient way to enter en and em dashes when you are typing. This method uses the Replace dashes option under Tools > AutoCorrect > Options to replace one or two hyphens, under certain conditions, with the corresponding dash.
In the following table, the A and B represent text consisting of letters A to z or digits 0 to 9.
|Text that you type:||Result|
|A - B (A, space, minus, space, B)||A – B (A, space, en-dash, space, B)|
|A -- B (A, space, minus, minus, space, B)||A – B (A, space, en-dash, space, B)|
|A--B (A, minus, minus, B)||A—B (A, em-dash, B)|
|A-B (A, minus, B)||A-B (unchanged)|
|A -B (A, space, minus, B)||A -B (unchanged)|
|A --B (A, space, minus, minus, B)||A –B (A, space, en-dash, B)|
Using the Special Characters Dialog
Another means of inserting en or em dashes is through the Insert > Special Characters menu. Select the U+2013 or U+2014 character, respectively.
Using Keyboard Shortcuts
Many people like to use keyboard shortcuts, especially when editing existing material that includes incorrectly-done dashes.
The shortcuts vary depending on your operating system.
Hold down one of the Alt keys and type on the numeric keypad: 0150 for an en dash or 0151 for an em dash. The dash appears when you release the Alt key.
|You might prefer to install a small, free, open source program for Windows called AllChars, which you can get here.|
Press and release the Compose key, then type two hyphens and a period for an en dash, or three hyphens for an em dash. The dash appears when you release the last key.
|The key that operates as a Compose key varies with the Linux distribution. It is usually Shift-AltGr, but may be another key (e.g. the windows key), and should be user-configurable.|
On Linux distributions based on the Gnome/GTK+ desktop environment, you can also input Unicode characters by pressing Ctrl + Shift + U, followed by the hexadecimal value of the Unicode character (2013 for an en dash, 2014 for an em dash). To end the input sequence, press either the Return key or release the Ctrl/Shift keys.
Mac OS X
Hold down the Option (Alt) key and type a hyphen for an en dash. For an em dash, the combination is Shift+Option+Hyphen.
Record Macros and Assign Them to Shortcut Keys
You can also record macros for inserting dashes and assign those macros to key combinations.
Step 1: Record macros for inserting en and em dashes.
- Use Tools > Macros > Record Macro to start recording a macro. A small window is displayed so you know that OpenOffice.org is recording.
- Use Insert > Special Characters to open the Special Characters dialog. Scroll down until you find the en dash (U+2013) character. Select it and click OK.
- Click the Stop Recording button to stop recording, save the macro, and display the OpenOffice.org Basic Macros dialog. Type a descriptive name for the new macro in the Macro name box on the upper left. For this example, we have used Endash and Emdash for the names of the macros.
- Be sure to open the library container named My Macros. Find the library named Standard under My Macros. Select Module1 and click Save.
- Repeat steps 1–4 to create another macro, to insert an em dash (U+2014 in the special characters table).
Step 2: Assign the macros to key combinations
- Use Tools > Customize > Keyboard tab.
- In the Shortcut keys list, pick an unused combination (for example, Ctrl+Shift+N for an en dash). In the Category list, scroll down to OpenOffice.org Macros, click the + sign, then click the + next to the Standard library and choose Module1. In the Function list, choose Endash and click the Modify button on the upper right. The selected key combination now appears in the Keys list on the lower right, and Endash appears next to Ctrl+Shift+N in the Shortcut keys list.
- Repeat for the em-dash , then click OK.
|For inserting en- and em-dashes, and other special characters, you may find extensions such as Compose Special Characters useful. See Adding functionality with extensions in the Writer Guide.|
|Content on this page is licensed under the Public Documentation License (PDL).|