Template:Spaced en dash/doc

Revision as of 16:11, 10 May 2026 by Chrysophylax (talk | contribs) (Created page with "{{Documentation subpage}} <!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE --> {{COinS safe|n}} {{High-use| 30632 }} {{Template shortcut |dash|snd|spnd|sndash|spndash}} This template produces a '''spaced en dash''' ('''{{tlc|snd}}''' for short): <code>{{spaced en dash}}</code>. It works similarly to the HTML markup sequence <code>'''&nbsp;&ndash;''' </code> i.e. a non-breaking space (which will not line-break and will not collapse to...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:COinS safe

This template produces a spaced en dash ( – for short):  – . It works similarly to the HTML markup sequence &nbsp;&ndash;  i.e. a non-breaking space (which will not line-break and will not collapse together with normal spaces that come before the template), a short dash (known as an en dash), and a normal space (which will line-break and will collapse together with normal spaces that come after the template).

Typical uses of dashes are to mark a break in a sentence, or to set off an explanatory remark (similar to parentheses), or to show spans of time or ranges of values. The spaced en dash is generally preferred in modern "Commonwealth English" typography, while older British and recent American typography generally uses an unspaced em dash for the same purpose. See MOS:DASH.

Usage

<syntaxhighlight lang="wikitext">This is an example of how to use the template – like this.</syntaxhighlight>

produces:

Template:Xt

Lists

The template may also be used in lists to provide something stronger than a bold middot "·" or a bullet "•", but shorter than an em dash "—".

(The use of dot templates for dotted lists is now deprecated. Use {{flatlist}} or {{Hlist}} instead; see WP:HLIST.)

Here, the recommended usage is to use no space before the template and one space after the template, like this: <syntaxhighlight lang="wikitext">Salt – Pepper</syntaxhighlight> This renders one space on each side of the dash, like this:

SaltPepper

A line break will come after one of the dashes, not before, when the spacing is used as suggested, like this:

SaltPepper
CurrySaffron
Examples for use for lists
One use of template "spaced en dash" is within other templates, tables, lists, and similar things to provide a separator between items. It is also to be consistent so that the article editor can use their choice of {{bull}}, {{dot}}, {{middot}}, or {{spaced en dash}} and not have to insert the Template:•, Template:Dot, Template:Middot, or  – symbol, they can use any of these as a simple macro. The idea being that if you have a table with a list of items, you can insert a spaced short dash (or the other symbols) between items that will appear correct, in that the items always have just one separator between them, and when a list crawls to the next line, the dash hangs onto the prior item instead of rolling over to the next line. Notice on the end of this box, the symbol hangs on the end of the last item that will fit on the line indicating that additional items follow on the next line as part of this list, but the item only stays on the line if the item and the dash will fit. See the column on the right. (with some smaller items squeezed in to show that the list does not have to be the same number of items per line) but in the box they all fold perfectly once it runs out of space on the line to fit the next item and the dash following. The space on the end makes sure the dash doesn't touch the edge of the box, either.

The markup used is:

<syntaxhighlight lang="wikitext">Normally, in a real box, these items would be links, but this is an example. Item1 – A – B – Item2 – Item3 – Item4 – Item5 – extra item – E – 1 – 2 – 3 – 4 – 5 – 6 – 7 – item that won't attach to prior line unless it fits in the remaining space – Q – A slightly longer item – KK – An obviously really even longer item that the dash will hang at its end – Item6 – C – Item7 – Item8 – Item9 – Item10 – Item11 – Item12 – D – Item13 – Item14 – Item15 – Item16 – Item17 – Item18</syntaxhighlight>. Normally, in a real box, these items would be links, but this is an example. Item1 – A – B – Item2 – Item3 – Item4 – Item5 – extra item – E – 1 – 2 – 3 – 4 – 5 – 6 – 7 – item that won't attach to prior line unless it fits in the remaining space – Q – A slightly longer item – KK – An obviously really even longer item that the dash will hang at its end – Item6 – C – Item7 – Item8 – Item9 – Item10 – Item11 – Item12 – D – Item13 – Item14 – Item15 – Item16 – Item17 – Item18

Dot sizes

Template:Dot size

TemplateData

Inserts a spaced en dash; it renders like this (without the quote marks): " &ndash; ".

Template parameters

ParameterDescriptionTypeStatus
No parameters specified

See also