This site is supported by donations to The OEIS Foundation.
Template:Dash/doc
From OeisWiki
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]
Contents
Note: This is for XHTML5 future proofing, where named character entities should not be used, except the following four
Named entity Glyph & & < < > > " "
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 mathematics (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'') (x − y)(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 = - <!-- hyphen --><!-- ASCII hyphen --><!-- hyphus, hyphen-minus, hyphen or minus sign --> | s- | shy = ­ <!-- soft hyphen, discretionary hyphen --> | n- | nhy = ‑ <!-- non-breaking hyphen --><!-- dashes --> | fig = ‒ <!-- figure dash --> | n | en = – <!-- en dash --> | m | em = — <!-- em dash --><!-- minus sign --> | mn | minus = − <!-- 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>