Permanently protected template

Template:Spaced en dash

From Vigyanwiki
Revision as of 21:10, 16 September 2008 by Template>Kaldari (nominating for deletion)

Template:Tfd-inline


Template documentation

This is the spaced en dash template; it renders like this (without the quote marks): " – " It works similarly to the HTML markup sequence  –  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). Among other uses, this template may be used in lists to provide something stronger than a bold middot "·" or a bullet "•", but shorter than an em dash "—". For horizontal lists, use {{flatlist}} or class="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:

[[Salt]]{{spaced en dash}} [[Pepper]]
This will render 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

{{snd}} is a handy synonym.

Here's an example of 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  • ,  · ,  · , or Template:Tfd-inline

 – 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. In code it is Item1{{spaced en dash}} Item2{{spaced en dash}} Item3{{spaced en dash}} Item4{{spaced en dash}} Item5{{spaced en dash}} etc. (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.

Normally, in a real box these items would be links, but this is an example.

Item1Template:Tfd-inline

 – ATemplate:Tfd-inline  – BTemplate:Tfd-inline  – Item2Template:Tfd-inline  – Item3Template:Tfd-inline  – Item4Template:Tfd-inline  – Item5Template:Tfd-inline  – extra itemTemplate:Tfd-inline  – ETemplate:Tfd-inline  – 1Template:Tfd-inline  – 2Template:Tfd-inline  – 3Template:Tfd-inline  – 4Template:Tfd-inline  – 5Template:Tfd-inline  – 6Template:Tfd-inline  – 7Template:Tfd-inline  – item that won't attach to prior line unless it fits in the remaining spaceTemplate:Tfd-inline  – QTemplate:Tfd-inline  – A slightly longer itemTemplate:Tfd-inline  – KKTemplate:Tfd-inline  – An obviously really even longer item that the dash will hang at its endTemplate:Tfd-inline  – Item6Template:Tfd-inline  – CTemplate:Tfd-inline  – Item7Template:Tfd-inline  – Item8Template:Tfd-inline  – Item9Template:Tfd-inline  – Item10Template:Tfd-inline  – Item11Template:Tfd-inline  – Item12Template:Tfd-inline  – DTemplate:Tfd-inline  – Item13Template:Tfd-inline  – Item14Template:Tfd-inline  – Item15Template:Tfd-inline  – Item16Template:Tfd-inline  – Item17Template:Tfd-inline

 – Item18

The space on the end makes sure the dash doesn't touch the edge of the box, either

Dot sizes

· middot
· bold {{middot}}
small bullet
{{bullet}}
bold bullet
{{en dash}}
{{em dash}}

See also

  • {{·}}, which produces a spaced bold interpunct ("middot"): " · "
  • {{•}}, which produces a spaced bullet-point: " • "
  • {{\}}, which produces a spaced (forward-)slash: " / "
  • {{en dash}}, which produces an (unspaced) en dash.
  • {{em dash}}, which produces an (unspaced) em dash.

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

Template parameters

ParameterDescriptionTypeStatus
No parameters specified