This site is supported by donations to The OEIS Foundation.

Template:Dash/doc

From OeisWiki
Jump to: navigation, search

This documentation subpage contains instructions, categories, or other information for Template:Dash. [<Edit> Template:Dash]

[⧼Purge⧽ Template:Dash/doc]

The {{dash}} HTML numeric character entity template gives the UTF-16 HTML [hexadecimal] numeric character entity for an hyphen, a dash or a minus sign.[1]

Note: This is for XHTML5 future proofing, where named character entities should not be used, except the following four

Named entity Glyph
&amp; &
&lt; <
&gt; >
&quot; "

Numeric character entities or glyphs (except the four above glyphs, which have a special meaning in HTML) should be used instead.[2]

Usage

{{dash|type}}

where type is among (case insensitive)

  • {-, hymn, hyphus} for hyphen, ASCII hyphen, hyphus, hyphen-minus, hyphen or minus sign;
  • {s-, shy} for soft hyphen, discretionary hyphen;
  • {n-, nhy} for non-breaking hyphen;


  • {fig} for figure dash;
  • {n, en} for en dash (default);
  • {m, em} for em dash;


  • {mn, minus} for minus sign.

Examples

Code Result Comment
well-formed, well{{dash|-}}formed well-formed, well-formed (hyphen, hyphus, hyphen-minus)
mathe{{dash|shy}}matics mathe­matics (soft hyphen)
non{{dash|nhy}}breaking non‑breaking (non-breaking hyphen)
12{{dash|fig}}45 12‒45 (figure dash)
{{dash}} (en dash, by default)
{{dash|n}} (en dash)
{{dash|en}} (en dash)
pp. 89{{dash|en}}97 pp. 89–97 (en dash)
pp. 89{{dash|n}}97 pp. 89–97 (en dash)
pp. 89{{dash}}97 pp. 89–97 (en dash, by default)
[[Euler{{dash|en}}Mascheroni constant]] Euler–Mascheroni constant (en dash)
[[Birch{{dash|en}}Swinnerton-Dyer conjecture]] Birch–Swinnerton-Dyer conjecture (en dash and hyphen)
{{dash|m}} (em dash)
{{dash|em}} (em dash)
You are the friend{{dash|em}}the only friend{{dash|em}}who offered to help me. You are the friend—the only friend—who offered to help me. (em dash)
{{dash|mn}} (minus sign)
{{dash|minus}} (minus sign)
(''x'' {{dash|mn}} ''y'')(''x'' + ''y'') (xy)(x + y) (minus sign)

Code Result
{{dash|}} Dash error: Argument must be from {-, hymn, hyphus} or {s-, shy} or {n-, nhy} or {fig} or {n, en} or {m, em} or {mn, minus}
{{dash|x}} Dash error: Argument must be from {-, hymn, hyphus} or {s-, shy} or {n-, nhy} or {fig} or {n, en} or {m, em} or {mn, minus}

Code


<noinclude>{{Documentation}}<!-- 

  http://stackoverflow.com/questions/3215053/xhtml5-and-html4-character-entities

Unicode Characters in the 'Punctuation, Dash' Category:

  http://www.fileformat.info/info/unicode/category/Pd/list.htm 

--></noinclude><includeonly>{{#switch: {{lc: {{{1|n}}} }}<!--

  hyphens

-->
|  - | hymn | hyphus = &#x002D; <!-- hyphen --><!-- ASCII hyphen --><!-- hyphus, hyphen-minus, hyphen or minus sign --> 
| s- | shy = &#x00AD; <!-- soft hyphen, discretionary hyphen -->
| n- | nhy = &#x2011; <!-- non-breaking hyphen --><!--

  dashes

-->
| fig      = &#x2012; <!-- figure dash -->
|  n | en  = &#x2013; <!-- en dash -->
|  m | em  = &#x2014; <!-- em dash --><!--

  minus sign

-->
| mn | minus = &#x2212; <!-- minus sign --> 
| #default = {{error| Dash error: Argument must be from {<tt>-</tt>, <tt>hymn</tt>, <tt>hyphus</tt>} or {<tt>s-</tt>, <tt>shy</tt>} or {<tt>n-</tt>, <tt>nhy</tt>} or {<tt>fig</tt>} or {<tt>n</tt>, <tt>en</tt>} or {<tt>m</tt>, <tt>em</tt>} or {<tt>mn</tt>, <tt>minus</tt>} }}
}}</includeonly>

Notes