This site is supported by donations to The OEIS Foundation.

Template:Thinsp

From OeisWiki
Jump to: navigation, search

The {{thinsp}} typographical template gives a thin space (also known as thin SP).

Usage

{{thinsp}} or {{thinsp|htm}} (default)

or

{{thinsp|tex}}

where the parameter is taken from

  • htm (default): to get the HTML+CSS Unicode character U+2009 (thin space, also known as thin SP), which is a thin variant (i.e. 1/6 em @opsp@@opsp@≈@opsp@@opsp@ 0.16667em) of the ordinary space U+0020 (space, also known as SP);
  • tex: to get the TeX/LaTeX \, command, which yields a 3mu (mathematical units) space, i.e. 3/18 of a quad space (you may use this template within the {{math}} template, but not within the <math>...</math> element).

It can be useful when, e.g. an ''italic'' character leans too close to the following [non-italic] character. Previously, &nbsp; (no-break space, U+00A0: 6 mu, no-break) was used as a workaround, but a thin space (3 mu) is better.

Examples

The code (using the {{^}} template)

{{math| ''a''{{^|''n''}} |&&}}

yields (where the exponent is too close to the base)

an

while

{{math| ''a''{{thinsp}}{{^|''n''}} |&&}}

yields (where the exponent is now too far from the base)

an

while

{{math| ''a''{{^|{{thinsp}}''n''}} |&&}}

yields (where the exponent is now just at the right distance from the base)

a  n

Example with HTML+CSS

The code

The zeros of {{math| ''x''{{^|3}} {{op|+}} 2''x''{{^|2}} {{op|+}} 10''x'' {{op|-}} 20 {{=}} 0 |&}} are (...)

yields

The zeros of 
x 3  +  2x 2  +  10x  −  20 = 0
are (...)

versus (e.g. to have more space before and after the = sign; not needed here, since the above was right)

The zeros of {{math| ''x''{{^|3}} {{op|+}} 2''x''{{^|2}} {{op|+}} 10''x'' {{op|-}} 20 {{thinsp}}{{=}}{{thinsp}} 0 |&}} are (...)

which yields

The zeros of 
x 3  +  2x 2  +  10x  −  20  =  0
are (...)

Example with TeX

The code

The zeros of {{math| ''x''{{^|3|tex}} {{op|+|tex}} 2''x''{{^|2|tex}} {{op|+|tex}} 10''x'' {{op|-|tex}} 20 {{=}} 0 |$}} are (...)

yields

The zeros of are (...)

versus (e.g. to have more space before and after the = sign; really needed here, since the above was not right)

The zeros of {{math| ''x''{{^|3|tex}} {{op|+|tex}} 2''x''{{^|2|tex}} {{op|+|tex}} 10''x'' {{op|-|tex}} 20 {{thinsp|tex}}{{=}}{{thinsp|tex}} 0 |$}} are (...)

which yields

The zeros of are (...)

Code


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

  HTML+CSS: use htm option (default) 

  TeX/LaTeX: use tex option (you may use this template within the {{math}} template, 
             but not within the <math>...</math> element)

    \, is 3mu (mathematical units) space, i.e. 3/18 of a quad space (or (1/6) em {{rel|approx}} 0.16667em)

--></noinclude><includeonly>{{#switch: {{lc: {{#if: {{{1|}}} | {{{1}}} | htm }} }}
| htm = &#x2009;<!-- thin space -->
| tex = \,  
}}</includeonly>

See also

  • {{sp}} (horizontal space of a chosen width, possibly negative)
  • {{thinsp}} (3mu space, i.e. 3/18 of a quad space, or 1/6 em @opsp@@opsp@≈@opsp@@opsp@ 0.16667em)
  • {{nbsp}} (6 mu no-break space, i.e. 6/18 of a quad space, or 1/3 em @opsp@@opsp@≈@opsp@@opsp@ 0.33333em) (formally known as: non-breaking space)
  • {{nl}} (new line)