Documentation/How Tos/Inserting En and Em Dashes

From Apache OpenOffice Wiki
< Documentation‎ | How Tos
Revision as of 12:46, 26 January 2009 by Mwaller (Talk | contribs)

Jump to: navigation, search

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.

Using AutoCorrect

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.

Windows

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.

Template:Documentation/Tip

Template:Documentation/Tip

Linux

Hold down the Compose key and type two hyphens and a period for an en dash, or three hyphens for an em dash. The dash appears when you release the Compose key.

Template:Documentation/Tip

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.

  1. Use Tools > Macros > Record Macro to start recording a macro. A small window is displayed so you know that OpenOffice.org is recording. StopRecording3.png
  2. 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.
    Find and choose the en dash.
  3. 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.
    Naming the new macro and storing it.
  4. Be sure to open the library container named My Macros. Find the library named Standard under My Macros. Select Module1 and click Save.
  5. 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

  1. Use Tools > Customize > Keyboard tab.
  2. 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.
  3. Repeat for the em-dash , then click OK.
Defining keyboard shortcuts for running macros.

Template:Documentation/Tip

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools