Jump to content

Template talk:Spaced en dash

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Why use HTML characters instead of the actual characters?

[edit]

Why are the HTML characters – and   used instead of the "–" and " " characters themselves? When substituting this template, it would make for more readable text in edit mode with the actual characters, e.g.:

lorem – ipsum

instead of

lorem – ipsum

—[AlanM1 (talk)]— 21:29, 22 August 2012 (UTC)[reply]

Entities are used to ensure they survive ohter templates they may transclude through. If regular spaces were used and used in another template, the parser might see them as extranious and remove them. Edokter (talk) — 07:47, 23 August 2012 (UTC)[reply]
In general, I understand there can be an issue with multiple trailing spaces being compressed to one space, though this should not present a problem in this case, since the one space would remain, and the MOS says to use a single space between the endash and the word that follows (in the case of a spaced endash).
I created my own User:AlanM1/Template/Snd, using the actual endash and space characters, and then created templates that both substitute and transclude it, and used the various combinations here:
Trans Subst
A – C A – C
A – C A – C
A – C A – C
A – C A – C
A – C A – C
A – C A – C
I cannot get it to fail in any of these situations. —[AlanM1 (talk)]— 05:04, 24 August 2012 (UTC)[reply]
Parser function may be a different story; they are notorious with spaces (even single ones!). However, this template is not ment to be substituted, and with the nbsp also being there, I do not see an issue. Edokter (talk) — 07:31, 24 August 2012 (UTC)[reply]
Perhaps I am missing something, but all I'm trying to do is have an easy way to insert a spaced endash (without having to type  , scroll down to the list below the edit window, move my hand to the mouse to click on the endash, etc.). I do this with a keyboard macro that sends "{{subst:snd}}". Now, I suppose I could just as easily set the macro to send " {{subst:ndash}} ", but its doc page says it's deprecated, so... I guess I'll just set it to use my own version when I know that it won't be used in anything that could break. —[AlanM1(talk)]— 20:25, 24 August 2012 (UTC)[reply]
Why not simply set your macro to send " – "? Edokter (talk) — 20:30, 24 August 2012 (UTC)[reply]
Hmmm. I didn't think it was possible to compose that character on Windows PC keyboard, since it is U+2013, but apparently Alt-0-1-5-0 will produce it, at least in the WP editor. Cool. Thanks. —[AlanM1(talk)]— 20:50, 24 August 2012 (UTC)[reply]

"Incorrect" use..?

[edit]

According to the current documentation, [[Salt]]{{spaced ndash}}[[Pepper]] (i.e. no space between the template's closing braces and subsequent word) is an incorrect use of the template (that "still behave[s] well"). Why is this incorrect..? Sardanaphalus (talk) 12:33, 9 August 2014 (UTC)[reply]
PS Just realized this thread above asks the same – if, therefore, there's no objection, I'm inclined to remove this description from the documentation. Sardanaphalus (talk) 12:37, 9 August 2014 (UTC)[reply]

Requested move 29 June 2015

[edit]
The following is a closed discussion of a requested move. Please do not modify it. Subsequent comments should be made in a new section on the talk page. Editors desiring to contest the closing decision should consider a move review. No further edits should be made to this section.

The result of the move request was: moved by Anthony Appleyard (talk · contribs). Jenks24 (talk) 01:56, 6 July 2015 (UTC)[reply]



Template:Spaced ndashTemplate:Spaced en dash – Align with {{Em dash}} and {{En dash}}. – Alakzi (talk) 17:58, 29 June 2015 (UTC)[reply]

This is a contested technical request (permalink). EdJohnston (talk) 00:11, 30 June 2015 (UTC)[reply]

The above discussion is preserved as an archive of a requested move. Please do not modify it. Subsequent comments should be made in a new section on this talk page or in a move review. No further edits should be made to this section.

COinS

[edit]

The HTML output of {{Spaced en dash}} is identical to the output given[1] when hardcoding the template’s contents ( – ). Is there another reason why this template is considered COinS‑unsafe? —LLarson (said & done) 23:56, 7 February 2016 (UTC)[reply]

References

  1. ^
    Markup Renders as
    {{cite book |author=Juice – Queen of Hearts |title=Title – Subtitle}}

    Juice – Queen of Hearts. Title – Subtitle.{{cite book}}: CS1 maint: multiple names: authors list (link) CS1 maint: numeric names: authors list (link)
    '"`UNIQ--templatestyles-0000000D-QINU`"'<cite id="CITEREFJuice_–_Queen_of_Hearts" class="citation book cs1">Juice&nbsp;&ndash;&#32;Queen of Hearts. ''Title&nbsp;&ndash;&#32;Subtitle''.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Title+%26ndash%3B%26%2332%3BSubtitle&rft.au=Juice+%26ndash%3B%26%2332%3BQueen+of+Hearts&rfr_id=info%3Asid%2Fen.wikipedia.org%3ATemplate+talk%3ASpaced+en+dash" class="Z3988"></span><span class="cs1-maint citation-comment"><code class="cs1-code">{{[[Template:cite book|cite book]]}}</code>: CS1 maint: multiple names: authors list ([[:Category:CS1 maint: multiple names: authors list|link]]) CS1 maint: numeric names: authors list ([[:Category:CS1 maint: numeric names: authors list|link]])</span>

    {{cite book |author=Juice{{Spaced en dash}}Queen of Hearts             |title=Title{{Spaced en dash}}Subtitle}}

    Juice – Queen of Hearts. Title – Subtitle.{{cite book}}: CS1 maint: multiple names: authors list (link) CS1 maint: numeric names: authors list (link)
    '"`UNIQ--templatestyles-00000013-QINU`"'<cite id="CITEREFJuice_–_Queen_of_Hearts" class="citation book cs1">Juice&nbsp;&ndash;&#32;Queen of Hearts. ''Title&nbsp;&ndash;&#32;Subtitle''.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Title+%26ndash%3B%26%2332%3BSubtitle&rft.au=Juice+%26ndash%3B%26%2332%3BQueen+of+Hearts&rfr_id=info%3Asid%2Fen.wikipedia.org%3ATemplate+talk%3ASpaced+en+dash" class="Z3988"></span><span class="cs1-maint citation-comment"><code class="cs1-code">{{[[Template:cite book|cite book]]}}</code>: CS1 maint: multiple names: authors list ([[:Category:CS1 maint: multiple names: authors list|link]]) CS1 maint: numeric names: authors list ([[:Category:CS1 maint: numeric names: authors list|link]])</span>

I’ve updated Template:Spaced en dash/doc to reflect that the template appears COinS‑safe.[1]LLarson (said & done) 15:02, 23 February 2016 (UTC)[reply]
@Trappist the monk and LLarson: Trappist says this template is not COinS safe‍—‌pollutes dates. What about Template:En dash, Template:Em dash, and Template:nbsp? Ping me back. Cheers! {{u|Checkingfax}} {Talk} 10:58, 4 March 2016 (UTC)[reply]
Both {{em dash}} and {{en dash}} are safe for COinS because they contain no html or css. {{nbsp}} is not safe for COinS because that template wraps one or more &nbsp; html entities in css:
<span class="nowrap">&nbsp;</span>
Trappist the monk (talk) 11:21, 4 March 2016 (UTC)[reply]

Intended usage

[edit]

Is it still intended for this template not to be used in regular paragraphs? I ask because the spaces flanking a dash in regular text should not be non-breaking. Thanks in advance for the clarification! Q·L·1968 21:25, 19 October 2016 (UTC)[reply]

I wouldn't worry much about that. Editors who use the keystroke (or the en-dash button below the edit box) rarely insert the nbsp thing. Tony (talk) 06:51, 21 October 2016 (UTC)[reply]

Date ranges & justification

[edit]

A date range with this template looks terrible when the page is justified—the spaces around the dash can get pretty wide.

What objections are there to something like &#8239;&ndash;&thinsp; instead of what's used now?

(31 February 2017 – 1 March 2017)

vs

(31 February 2017 – 1 March 2017)

Curly "JFC" Turkey 🍁 ¡gobble! 04:05, 19 July 2017 (UTC)[reply]

Template appears to render incorrectly on Firefox 94 on Mac

[edit]

When using this template if I have spaces surrounding the template, it appears as having two spaces on one side and one space on the other. For example Foo {{ndash}} Bar renders as Foo – Bar with two spaces on the first side and one space on the other side. Rendered example: "Foo  – Bar" Ergzay (talk) 19:03, 6 November 2021 (UTC)[reply]

COinS (2)

[edit]

The documentation claims this template pollutes COinS. But that doesn't make sense: it's just text, even if in the form of HTML entities. I don't think that's problematic, is it? Hairy Dude (talk) 17:53, 29 February 2024 (UTC)[reply]

{{cite book |title=Title |date=December 2020{{Spaced en dash}}January 2021}}Title. December 2020 – January 2021. {{cite book}}: Check date values in: |date= (help)
{{cite book |title=Title |date=December 2020 – January 2021}}Title. December 2020 – January 2021.
The metadata for the first example is incomplete (corrupt) because the value assigned to |date= is omitted. Compare:
'"`UNIQ--templatestyles-00000026-QINU`"'<cite class="citation book cs1">''Title''. December 2020&nbsp;&ndash;&#32;January 2021.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Title&rfr_id=info%3Asid%2Fen.wikipedia.org%3ATemplate+talk%3ASpaced+en+dash" class="Z3988"></span> <span class="cs1-visible-error citation-comment"><code class="cs1-code">{{[[Template:cite book|cite book]]}}</code>: </span><span class="cs1-visible-error citation-comment">Check date values in: <code class="cs1-code">&#124;date=</code> ([[Help:CS1 errors#bad_date|help]])</span>
against:
'"`UNIQ--templatestyles-00000029-QINU`"'<cite class="citation book cs1">''Title''. December 2020 – January 2021.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Title&rft.date=2020-12%2F2021-01&rfr_id=info%3Asid%2Fen.wikipedia.org%3ATemplate+talk%3ASpaced+en+dash" class="Z3988"></span>
The keyword that you are looking for is &rft.date= (value is rendered in percent encoded ISO 8601 format).
Trappist the monk (talk) 18:28, 29 February 2024 (UTC)[reply]

Usage in article prose

[edit]

At some point this template's docs had specified that it should not be used in regular article prose and should be limited to lists and other non-prose elements; can we add that back?

I've seen a lot of usages of this template in the opening sentence of an article as the separator between birth dates and death dates, for example in:
John Smith (23 January 1953 – 31 December 2023) was a British example person.
This template should probably be used in this instance; it's unnecessary and the dash doesn't render at all in the preview cards such as Wikipedia:Tools/Navigation popups. RachelTensions (talk) 17:10, 30 November 2024 (UTC)[reply]

I noticed that Wikipedia:ProveIt inserted this template when editing citations. Flibirigit (talk) 17:15, 30 November 2024 (UTC)[reply]
It should be deprecated for inside citations, as noted on the template documentation. If ProveIt is doing this, can you find a diff or two and post to Wikipedia talk:ProveIt? DrKay (talk) 08:32, 1 December 2024 (UTC)[reply]

Was that a serious proposal? In en.uk (and similar), spaced ndashes are routinely used in running prose, just as unspaced mdashes are (still) used in en.us. This style is entirely normal – the nonbreaking space is there in case repagination might force a line break before the dash, separating it from its preceding word.

5.2.1.Use spaced ndashes – rather than mdashes or hyphens – to set off phrases
[ ... ]
5.2.2. Use close-set ndashes or three-to-em dashes between digits to indicate a range.

— Bringhurst, Robert (2004). The elements of typographic style (third ed.). Seattle: Hartley & Marks. p. 80.

Spaced ndash should be used in running text (but not in numeric ranges). Thus John Smith (23 January 1953 – 31 December 2023) was a British example person. is certainly wrong but John Smith (23 January 1953–31 December 2023) – noted for having done somthing wonderful – was a British example person is certainly valid. --𝕁𝕄𝔽 (talk) 14:35, 4 October 2025 (UTC)[reply]

This was referring to using this particular template to insert one, not use of a spaced en dash in general. RachelTensions (talk) 14:39, 4 October 2025 (UTC)[reply]
Sorry, I don't follow? Using this template (or, more practically, its shortcut {{snd}}) is the easiest way to use the spaced ndash in general. And it is to be encouraged, given the number of times that editors use space hyphen-minus space, trusting (I assume) that 'the system' will sort it out like MsWord does. 𝕁𝕄𝔽 (talk) 14:49, 4 October 2025 (UTC)[reply]
@JMF: I don't understand why the example above you say "is certainly wrong" is wrong. MOS:DATERANGE states:
  • In certain cases where at least one item on either side of the en dash contains a space, then a spaced en dash ({{snd}}) is used. For example:
    • between specific dates in different months: They travelled June 3 – August 18, 1952;  They travelled 3 June – 18 August 1952
    • between dates in different years:
      • Charles Robert Darwin (12 February 1809 – 19 April 1882) was an English naturalist ...
        • Markup: 12{{nbsp}}February 1809{{snd}}19{{nbsp}}April 1882 or 12&nbsp;February 1809&nbsp;&ndash; 19&nbsp;April 1882
      • Abraham Lincoln (February 12, 1809 – April 15, 1865) was the 16th president of ...
Bazza 7 (talk) 14:49, 4 October 2025 (UTC)[reply]
Yes, accepted, brain not entirely in gear. I was thinking of date ranges like 1776–1801. 𝕁𝕄𝔽 (talk) 14:52, 4 October 2025 (UTC)[reply]
@JMF: I had a moment of self-doubt. Thanks for the reassurance that I have understood the MOS guideline correctly. Bazza 7 (talk) 14:54, 4 October 2025 (UTC)[reply]
Bringhurst advises caution with the use of a dash in date ranges (Archive.org). He doesn't contradict the MOS, but rather advises the reader to consider whether a dash is appropriate. Such as it is [appropriate] in the Darwin and Lincoln examples you cite but to take care when using it elsewhere. 𝕁𝕄𝔽 (talk) 15:02, 4 October 2025 (UTC)[reply]