Documentation/How Tos/Inserting En and Em Dashes

From Apache OpenOffice Wiki
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.

Tip.png On a keyboard with no numeric keypad, use a Fn (Function) key combination to type the numbers. (The Fn key is usually to the right of the left-hand Ctrl key on the keyboard.)

For example, on a US keyboard layout, the combination for an en dash should be Alt+Fn+mjim and for an em dash it should be Alt+Fn+mjij.


Tip.png You might prefer to install a small, free, open source program for Windows called AllChars, which you can get here.


Linux

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.

Tip.png 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  +  ⌥ Opt  +  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 Apache OpenOffice 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 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.
Tip.png 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).
Personal tools
In other languages