Wikipedia:How to make dashes
This help page is a how-to guide. It explains concepts or processes used by the Wikipedia community. It is not one of Wikipedia's policies or guidelines, and may reflect varying levels of consensus. |
The hyphen-minus (keyboard hyphen), en dash, em dash, and mathematical minus/negative symbols are different. They are handled differently from each other on Wikipedia . Below is information on how to generate these characters.
By button in the Wikipedia editor
Edit the article you want to add the dash to, and click where you want the dash to appear, to put the text cursor there. Notice that below the edit box is a CharInsert toolbar with a pull-down menu, followed by a horizontal list of characters.
- To insert a hyphen-minus, just press the button on your keyboard, usually located between the zero and plus keys.
- To insert an endash, select "Insert" in the pull-down menu, and click on the first character (the shorter-looking dash).
- To insert an emdash, select "Insert" in the pull-down menu, and click on the second character (the longer-looking dash).
- To insert a minus sign, select "Math and Logic" from the pulldown, and click on the first character.
By copy and paste
- Select. First, select a dash already in the text. That is, click just to the left of the dash but don't let go of the mouse button. While holding down the button, move to the right side of the dash or else press the → key once. Now let go of the mouse button. The dash should now change color, and nothing else should change color. If not, try again.
- Copy. Next, press Ctrl+c; that is, hold down the Ctrl key, probably at the lower left corner of your keyboard. Without letting go of the Ctrl key, press the C key; then let go of both keys. This is designed to be done with two fingers of your left hand, but can, of course, be done any way you like.
- Locate insertion point. Go to where you want to add the dash. Click there.
- Insert. Press Ctrl+v; it's similar to Ctrl+c, but with a v instead of a c.
A variant available in Windows is to create folders with the en and em dashes as their names. First copy an en dash from somewhere, the Dash article for example, as described above. Then open File Explorer to the Documents folder and click "New folder". A new folder will appear with New Folder highlighted. Use Cntrl+v, to paste the en dash and press ↵ Enter to establish the folder with the en dash as its name. Do the same with the em dash. Then, whenever you need a dash, open the Documents folder, click on the relevant folder name, press F2 to select the dash, and copy and paste as described above. The en and em dashes sort before alphanumeric folder names, so they will appear at the top; there is no need to page down through your other folders.
By keyboard - short explanation
- For Mac: ⌥ Opt+- (en dash, '–') or ⌥ Opt+⇧ Shift+- (em dash, '—'), and ignore the rest of the page.
- For Linux:
- Use AltGr- (en dash), or AltGr⇧ Shift- (em dash), and ignore the rest of the page.
- If you have Compose key: Compose--. (en dash) or Compose--- (em dash), and ignore the rest of the page.
- For Windows:
- Alt+0150 (en dash) or Alt+0151 (em dash), using the number pad and ignore the rest of the page.
- If the number pad is not installed, use ⊞ Win+R to open the Run box. Enter
charmap
to call up the Character Map. Scroll down three times, click on the en or em dash, then on "Select", then on "Copy", and paste the dash into your document. The Character Map icon will appear on the taskbar; if the service will be needed often, right-click the icon and select "Pin to taskbar". - In Microsoft Office applications: Ctrl+- (en dash) and Ctrl+Alt+- (em dash), using the minus key from the number pad.
- For iOS (iPhone and iPad) and Android:
- Hold the - on-screen keyboard until a pop up appears with choices including the en dash and em dash. If using an external keyboard with iOS, use the Mac advice above; ignore the rest of the page.
- Alternatively, regardless of platform:
By keyboard - long explanation
There are several ways to make en dashes and em dashes. Each has its partisans. Each has advantages and disadvantages. This table shows en dashes. Em dashes are similar, and are described below the table. If you make hundreds of dashes, invest some time learning software to make it faster. If you just want to make one dash, see the short explanation above.
Method | How to do it | Advantages | Disadvantages |
---|---|---|---|
Copy and paste | See "Short explanation" above. You can also find dashes to copy on other pages, or on the edit screen "Insert" line described below, or put dashes on your user page. | Easiest to learn. Most Wikipedians already know how to copy and paste because they use it in word processors and other software. Especially recommended if you've never entered a dash before and don't expect to make a career out of it. After you learn this method, then maybe you will want to learn how to speed up the process by using another method. | Compared to other methods, it takes a few seconds longer to navigate to another page with a dash on it, and then come back again. That's assuming it doesn't take you hours to learn those other methods. Other methods are a little faster once you have them set up and understood, so you will want to learn one if entering dashes gets to be a habit. |
Copy and paste from a "character map"–type application. | Similar to above. | There is no need to navigate to another Wikipedia page. This approach becomes more advantageous when special characters other than an en dash must be entered. | The application must be started, the hand moved from the keyboard to the mouse, and the en dash selected and copied from the application and pasted into the edit window—a lot of work if only one dash is to be entered. |
HTML entity–
|
Type – where you want an en dash. It will transform into – when you preview or save the page.
|
One of the easiest methods to learn. When you see it on the edit page, you can tell it isn't a hyphen or an em dash because it says "– " not just "– " which can be difficult (in many fonts) to distinguish from the others on the edit page. Some editors think "– " should be changed to "– " throughout Wikipedia for that reason.
Because it uses Windows-1252 characters, the entity |
More editors think the opposite change should be made, and some of them use WP:AWB to accomplish that. So does Wikipedia:AutoEd, which says: "HTML entities like Ö will be replaced with their Unicode characters like Ö ." Example. The characters – are reasonably mnemonic (compare the decimal and hexadecimal numerical entities – and – ) but not self evident, and there isn't an obvious way to jog your memory (though MOS:NDASH and Wikipedia:en dash redirect to the guideline section). Although the characters include the letters "ndash", it doesn't look like an actual – , which is potentially confusing to the inexperienced editor.
|
Edit page "Insert" | On the edit page, below the edit window and just above "Edit summary (Briefly describe your changes)", there will be a field that might have the word "Insert" in it. However, if you have used that function before, it might say something else instead: "Wiki markup", "Symbols", "Latin", "Greek", "Cyrillic", "Hebrew", "Arabic", "IPA (English)", "IPA", or "Math and logic". If it says one of those things, click the blue arrow and change it back to "Insert". Immediately to the right of the arrow pointing down should be something that looks like an equals sign. It isn't. It's an underlined link that inserts an en dash into the edit window. The first one is a link for an en dash; the second one is a link for an em dash, which is longer.
In the edit window, go to where you want an en dash. Click there to position the insertion point; verify that the cursor appears at the desired position. Without clicking anywhere else, scroll down below the edit window. Click the en dash link. Now make sure the en dash went where you want it to. If you clicked the dash link before clicking where it goes, or if you clicked anything else before clicking the en dash, you just added an en dash in the wrong place. It may look like nothing happened, so that may make you click the dash again and again, adding more and more en dashes in the wrong place. It goes the last place you clicked before clicking the en dash below, not where the mouse is pointing. |
You can easily find the dash below the edit screen when you need it, and you can easily see that it is an en dash. Once you learn how to add en dashes this way, you can use this feature to add other special characters on the "Insert" line, and on the other lines you can get to with the down arrow. | It takes considerable practice to use it correctly. If you make any of the mistakes described to the left in the "How to" column, the en dash will silently go in the wrong place. If the user mistakenly thinks nothing is happening, and therefore he tries again and again, then more and more en dashes will go in wrong places. If he still thinks nothing is happening, he may save the page with en dashes in the wrong place, creating a typo much worse than the hyphen problem he was probably trying to solve. On a laptop, scrolling down to the "Insert" line can make the top of the edit screen scroll off the top, so you can't see where the dash is going. |
Alt code Alt+ 0150 (ndash)Alt+ 0151 (mdash)
|
Your keyboard probably has two Alt keys. While holding down the left Alt key (the right Alt key does not work if the US-International keyboard is enabled), type 0150 or 0151 on the numeric keypad. The numbers above the letters on your keyboard won't work; make sure the "num lock" light is on and use the numeric keypad. Do not type the plus sign; it is there just to indicate that the Alt key is held down while the digit string is entered.
One user reported getting this to work on his laptop by pressing function key F11 to turn regular numbers into keypad numbers, and then press F11 again to turn them back to regular numbers. More explanation here. |
Takes two seconds once you learn how. | Learning how. Some users can't get it to work, and we don't know if it's because they didn't follow all the instructions to the left in the "How to" column. Even if you can get it to work, you still have the problem of memorizing the left Alt and the 0150 , and the problem of finding a good place to look up those instructions. Got MouseKeys? (A Windows Accessibility option not active by default.) If MouseKeys are set to be active while numlock is on, the Alt method won't work. See note.[1]
|
Hex input Alt+ +2013
|
While holding down the left Alt key (the right Alt key does not work if the US-International keyboard is enabled), type +2013 on the numeric keypad; make sure the "Num Lock" light is on. Here you do type the second plus sign. This approach, along with techniques to use if the keypad is unavailable and one prefers not to edit the Windows registry, are described here.
|
Uses codes corresponding to Unicode rather than obsolescent Windows-1252 codes above. Consequently, a character such as U+2013 can be entered by simply entering the code rather than having to learn an additional numerical code. | May require editing the Windows registry, which should never be attempted by a user who isn't very familiar with the procedure (editing the registry incorrectly can make a computer unusable). As with the Alt code above, it is non-mnemonic. Some alphanumeric codes (e.g., U+00B6, "¶") may not work correctly with an application that interprets the alphabetic character as part of a command (e.g., Alt+B for the Firefox Bookmarks menu).
|
{{Spaced ndash}} (Spaced en dash) |
Type {{spaced ndash}} . (But not the period.) It's an alternative to – if you want a non-breaking space before the dash, and a regular space after the dash.
|
In addition to the advantages of – : If you're familiar with Wikipedia templates, and if you aren't familiar with HTML entities, then you won't need as much of an introduction to {{spaced ndash}} as you need for – . If you're adding a spaced en dash, the template correctly makes the space before not space after the dash be a non-breaking space, according to MOS:ENDASH.
|
In addition to the disadvantages of – : There are so many 's throughout Wikipedia, that a person who is unfamiliar with them is also likely to be unfamiliar with templates. Adding the space before and after is more of a pain than a help, because MOS:ENDASH specifies many situations, such as "pages 46–49", where the en dash should not have those spaces. If you need to first decide whether to include the spaces or not, then why not just code either "– " or " – ", rather than type in the spaced ndash template, and then remember that's the spaced version, not the unspaced version?
|
User:GregU/dashes.js | Click the link to the left for instructions. | Makes suggested auto-corrections of dashes and hyphens while editing. | Requires both knowledge of proper dash usage and attention to detail, since not every suggestion it makes will be correct. |
abcTajpu[1] | An add-on for the Firefox browser. Straightforward. | Two or three keystrokes. Customizable. Enables other symbols, selectable by language. | Requires unfamiliar software, so this is practical only if you frequently enter dashes or use it for something else. |
Customise your keyboard with AutoHotkey | Make a script (probably in Notepad) to assign actions to any number of key combinations of your choice; load the script automatically whenever you start Windows or load scripts and unload them ad hoc. Perhaps choose to use the ⊞ Win key in combination with a mnemonic second key such as the slash, pressed simultaneously, and assign typing ⊞ Win+/ to make an en dash. The code for this is just
It is necessary to use an actual en dash in this script, perhaps created using another technique in this table, but ⊞ Win+/ will suffice thereafter. You can also make an .exe file and distribute to any Windows user. Also good for developing huge scripts that are full-metal applications. |
Free. Under constant improvement by zealous nerds. Versions for other operating systems also. Extensive helpfile. Worth the effort of learning. Intuitive enough once you get started. As simple or as complex as you like. Can be used to make a system for a collaborative group. | For anything more complicated than simple character substution, you do have to learn it or get someone else to make a script to meet your needs. |
Microsoft Keyboard Layout Creator | Modify an existing keyboard or create a new keyboard. Somewhat involved. | Described here | Requires unfamiliar software, so this is practical only if you frequently enter dashes or use it for something else. Not all hotkeys work on all systems, so may require tinkering.[2] |
Change Wikipedia's underlying rendering software. | One proposal is: You type in two hyphens into the edit page. The system changes them into an en dash, in the same way that the system changes [[dog]] into dog. | Once the software is changed, typing two hyphens (for instance) is easier than anything else on the list, considering that the individual editor doesn't need to install any software. Therefore, he will be more likely to use dashes. Therefore, the cause of dashes is more likely to triumph throughout Wikipedia. | If the specific proposal is two hyphens, then what happens if you really want two hyphens, in a file name for instance? And if you need some obscure parameter to allow that to happen, then would it be easier to just enter the dashes the old-fashioned way? |
Em dashes
The alternatives for em dashes closely resemble the alternatives for en dashes. In the table above: substitute — for –; mdash for ndash; Alt+0151
for Alt+0150
; the longer (second) equals sign for the shorter (first) equals sign after the blue arrow; etc. An em dash can also be approximated using the typewriter convention of two hyphens:
Method | How to do it | Advantages | Disadvantages |
---|---|---|---|
--
|
Press the hyphen key twice | It's easy to input. | Deprecated: This violates the MOS:DASH guideline, and makes people think we don't know how to make dashes, which is bad for our image. It may also line-wrap between the dashes (depends on browser). |
See also
Footnotes
- ^ If using MouseKeys, the Alt method of entering character codes will not work if MouseKeys are set to be active while numlock is on. Click Start, click Help. In search window, enter: MouseKeys and press Enter. In the left column, click "Change MouseKeys options". Follow instructions to: "Use MouseKeys when NumLock is Off".