This site is supported by donations to The OEIS Foundation.

Template:Sp/doc

From OeisWiki
Jump to: navigation, search

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

[⧼Purge⧽ Template:Sp/doc]

The {{sp}} (space) typographical template inserts an horizontal space of a given [negative, null or positive] width. Negative width “spaces” are especially useful for kerning in mathematical expressions.

Usage

{{sp}} (HTML+CSS 4mu space by default)

or

{{sp|format}} (4mu space by default)

or

{{sp|width descriptor}}

or

{{sp|width descriptor|format}}

where

  • the first parameter (width descriptor) describes the space width (default: 4, i.e. 4mu, corresponding to a medium space) (see space width);
  • the last parameter (format) is taken from:
    • htm (default): to get a HTML+CSS Unicode space (of a given width) character (or a <span style="margin-left: width in em units em;"></span>);
    • tex: to get a LaTeX space (of a given width) command.

You may use this template within the {{math}} template, but not within the <math>...</math> element.

Issue with HTML+CSS negative spaces

A previous version had HTML+CSS negative spaces implemented with e.g. <span style="margin-left: {{#expr: -1/9}}em;"></span> for a -2mu (-1/9em) negative space, which was actually working in the examples.

There was a problem (not anymore?!) with the {{sum}} and {{prod}} templates though:

{{math|{{sum|''m''{{sp|1}}{{=}}1|''n''|''F''<span style{{=}}"margin-left: {{#expr: -1/9}}em;"></span>{{sub|''m''}}}}|&}} yields 
n

m   = 1
Fm
{{math|{{prod|''m''{{sp|1}}{{=}}1|''n''|''F''<span style{{=}}"margin-left: {{#expr: -1/9}}em;"></span>{{sub|''m''}}}}|&}} yields 
n

m   = 1
Fm

Actually, there was a problem (not anymore?!) when I had implemented a HTML+CSS 1mu (1/18 em) space as <span style="margin-left: {{#expr: 1/18}}em;"></span> since I didn't find a Unicode point for a 1/18em space, so I was using the Unicode point for a 1.5mu (1/12em) hair space instead:

{{math|{{sum|''i''<span style{{=}}"margin-left: {{#expr: 1/18}}em;"></span>{{=}}1|''n''|''i''}}|&}} yields 
n

i  = 1
i
{{math|{{prod|''i''<span style{{=}}"margin-left: {{#expr: 1/18}}em;"></span>{{=}}1|''n''|''i''}}|&}} yields 
n

i  = 1
i

Space width


Space width descriptors
(Italicized descriptors cannot be used as arguments.)
mu em Descriptors
-36 -2 em negqquad
-18 -1 em negem or negquad
-9 -1/2 em negen
-8 -4/9 em
-7 -7/18 em
-6 -1/3 em negverythick
-5 -5/18 em negthick
-4 -2/9 em negmed
-3 -1/6 em negthin
-2 -1/9 em negverythin
-1.5 -1/12 em neghair
-1 -1/18 em negveryverythin
0 0 em null
1 1/18 em veryverythin
1.5 1/12 em hair
2 1/9 em verythin
3 1/6 em thin
4 2/9 em med
5 5/18 em thick
6 1/3 em verythick
7 7/18 em
8 4/9 em
9 1/2 em en
18 1 em em or quad
36 2 em qquad

Examples

Kerning

The code

: {{math|''a''{{sp|1}}(''n'')|&}} is divisible by {{math|''F''{{sub|''n''}}|&}} since

yields the text style HTML+CSS (without kerning)

a (n)
is divisible by 
Fn
since

The code

: {{math|''a''{{sp|1}}(''n'')|&}} is divisible by {{math|''F''{{sp|-3}}{{sub|''n''}}|&}} since

yields the text style HTML+CSS (with -3mu kerning)

a (n)
is divisible by 
Fn
since

The code

: {{math|''a''{{sp|1|tex}}(''n'')|$}} is divisible by {{math|''F''{{sub|''n''|tex}}|$}} since

yields the text style LaTeX

is divisible by since

HTML+CSS examples

The code

<span style="background: #f2f2f2;">Read on{{sp|-36}}after a -36 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|-2 em}}after a -2 em space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|negqquad}}after a negqquad space.</span>{{nl}}

<span style="background: #f2f2f2;">Read onMafter a negem space.</span> ''(The negem space should have the width of <s>capital M</s> two capital N.)''{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|-18}}after a -18 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|-1 em}}after a -1 em space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|negem}}after a negem space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|negquad}}after a negquad space.</span>{{nl}}

<span style="background: #f2f2f2;">Read onNafter a negen space.</span> ''(The negen space should have the width of capital N.)''{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|-9}}after a -9 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|-1/2 em}}after a -1/2 em space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|negen}}after an negen space.</span>{{nl}}

<span style="background: #f2f2f2;">Read on{{sp|-6}}after a -6 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|-1/3 em}}after a -1/3 em space.</span>{{nl}}

<span style="background: #f2f2f2;">Read on{{sp|-5}}after a -5 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|-5/18 em}}after a -5/18 em space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|negthick}}after a negthick space.</span>{{nl}}

<span style="background: #f2f2f2;">Read on{{sp|-4}}after a -4 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|-2/9 em}}after a -2/9 em space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|negmed}}after a negmed space.</span>{{nl}}

<span style="background: #f2f2f2;">Read on{{sp|-3}}after a -3 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|-1/6 em}}after a -1/6 em space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|negthin}}after a negthin space.</span>{{nl}}

<span style="background: #f2f2f2;">Read on{{sp|-2}}after a -2 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|-1/9 em}}after a -1/9 em space.</span>{{nl}}

<span style="background: #f2f2f2;">Read on{{sp|-1.5}}after a -1.5 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|-1/12 em}}after a -1/12 em space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|neghair}}after a neghair space.</span>{{nl}}

<span style="background: #f2f2f2;">Read on{{sp|-1}}after a -1 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|-1/18 em}}after a -1/18 em space.</span>{{nl}}

<span style="background: #f2f2f2;">Read on{{sp|0}}after a 0 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|null}}after a null space.</span>{{nl}}

<span style="background: #f2f2f2;">Read on{{sp|1}}after a 1 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|1/18 em}}after a 1/18 em space.</span>{{nl}}

<span style="background: #f2f2f2;">Read on{{sp|1.5}}after a 1.5 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|1/12 em}}after a 1/12 em space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|hair}}after a hair space.</span>{{nl}}

<span style="background: #f2f2f2;">Read on{{sp|2}}after a 2 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|1/9 em}}after a 1/9 em space.</span>{{nl}}

<span style="background: #f2f2f2;">Read on{{sp|3}}after a 3 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|1/6 em}}after a 1/6 em space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|thin}}after a thin space.</span>{{nl}}

<span style="background: #f2f2f2;">Read on{{sp|4}}after a 4 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|2/9 em}}after a 2/9 em space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|med}}after a med space.</span>{{nl}}

<span style="background: #f2f2f2;">Read on{{sp|5}}after a 5 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|5/18 em}}after a 5/18 em space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|thick}}after a thick space.</span>{{nl}}

<span style="background: #f2f2f2;">Read on{{sp|6}}after a 6 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|1/3 em}}after a 1/3 em space.</span>{{nl}}

<span style="background: #f2f2f2;">Read onNafter an en space.</span> ''(The en space should have the width of capital N.)''{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|9}}after a 9 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|1/2 em}}after a 1/2 em space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|en}}after an en space.</span>{{nl}}

<span style="background: #f2f2f2;">Read onMafter an em space.</span> ''(The em space should have the width of <s>capital M</s> two capital N.)''{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|18}}after a 18 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|1 em}}after a 1 em space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|em}}after an em space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|quad}}after a quad space.</span>{{nl}}

<span style="background: #f2f2f2;">Read on{{sp|36}}after a 36 mu space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|2 em}}after a 2 em space.</span>{{nl}}
<span style="background: #f2f2f2;">Read on{{sp|qquad}}after a qquad space.</span>

yields the HTML+CSS formatted

Read onafter a -36 mu space.
Read onafter a -2 em space.
Read onafter a negqquad space.

Read onMafter a negem space. (The negem space should have the width of capital M two capital N.)
Read onafter a -18 mu space.
Read onafter a -1 em space.
Read onafter a negem space.
Read onafter a negquad space.

Read onNafter a negen space. (The negen space should have the width of capital N.)
Read onafter a -9 mu space.
Read onafter a -1/2 em space.
Read onafter an negen space.

Read onafter a -6 mu space.
Read onafter a -1/3 em space.

Read onafter a -5 mu space.
Read onafter a -5/18 em space.
Read onafter a negthick space.

Read onafter a -4 mu space.
Read onafter a -2/9 em space.
Read onafter a negmed space.

Read onafter a -3 mu space.
Read onafter a -1/6 em space.
Read onafter a negthin space.

Read onafter a -2 mu space.
Read onafter a -1/9 em space.

Read onafter a -1.5 mu space.
Read onafter a -1/12 em space.
Read onafter a neghair space.

Read onafter a -1 mu space.
Read onafter a -1/18 em space.

Read on​after a 0 mu space.
Read on​after a null space.

Read on after a 1 mu space.
Read on after a 1/18 em space.

Read on after a 1.5 mu space.
Read on after a 1/12 em space.
Read on after a hair space.

Read on  after a 2 mu space.
Read on  after a 1/9 em space.

Read on after a 3 mu space.
Read on after a 1/6 em space.
Read on after a thin space.

Read on after a 4 mu space.
Read on after a 2/9 em space.
Read on after a med space.

Read on  after a 5 mu space.
Read on  after a 5/18 em space.
Read on  after a thick space.

Read on after a 6 mu space.
Read on after a 1/3 em space.

Read onNafter an en space. (The en space should have the width of capital N.)
Read on after a 9 mu space.
Read on after a 1/2 em space.
Read on after an en space.

Read onMafter an em space. (The em space should have the width of capital M two capital N.)
Read on after a 18 mu space.
Read on after a 1 em space.
Read on after an em space.
Read on after a quad space.

Read on  after a 36 mu space.
Read on  after a 2 em space.
Read on  after a qquad space.

LaTeX examples

The code

{{math| \text{Read onMafter an em space. (The negem space should have the width of two capital N.)} |$}}{{nl}}
{{math| \text{Read on}{{sp|-36|tex}}\text{after a } -36 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|-2 em|tex}}\text{after a } -2 \text{ em space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|negqquad|tex}}\text{after a negqquad space.} |$}}{{nl}}

{{math| \text{Read onMafter an em space. (The negen space should have the width of capital N.)} |$}}{{nl}}
{{math| \text{Read on}{{sp|-18|tex}}\text{after a } -18 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|-1 em|tex}}\text{after a } -1 \text{ em space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|negem|tex}}\text{after an negem space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|negquad|tex}}\text{after a negquad space.} |$}}{{nl}}

{{math| \text{Read on}{{sp|-9|tex}}\text{after a } -9 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|-1/2 em|tex}}\text{after a } -1/2 \text{ em space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|negen|tex}}\text{after an negen space.} |$}}{{nl}}

{{math| \text{Read on}{{sp|-6|tex}}\text{after a } -6 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|-1/3 em|tex}}\text{after a } -1/3 \text{ em space.} |$}}{{nl}}

{{math| \text{Read on}{{sp|-5|tex}}\text{after a } -5 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|-5/18 em|tex}}\text{after a } -5/18 \text{ em space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|negthick|tex}}\text{after a negthick space.} |$}}{{nl}}

{{math| \text{Read on}{{sp|-4|tex}}\text{after a } -4 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|-2/9 em|tex}}\text{after a } -2/9 \text{ em space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|negmed|tex}}\text{after a negmed space.} |$}}{{nl}}

{{math| \text{Read on}{{sp|-3|tex}}\text{after a } -3 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|-1/6 em|tex}}\text{after a } -1/6 \text{ em space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|negthin|tex}}\text{after a negthin space.} |$}}{{nl}}

{{math| \text{Read on}{{sp|-2|tex}}\text{after a } -2 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|-1/9 em|tex}}\text{after a } -1/9 \text{ em space.} |$}}{{nl}}

{{math| \text{Implemented as } -1 \text{ mu, since don't know how to make } -1.5 \text{ mu.} |$}}{{nl}}
{{math| \text{Read on}{{sp|-1.5|tex}}\text{after a } -1.5 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|-1/12 em|tex}}\text{after a } -1/12 \text{ em space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|neghair|tex}}\text{after a neghair space.} |$}}{{nl}}

{{math| \text{Read on}{{sp|-1|tex}}\text{after a } -1 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|-1/18 em|tex}}\text{after a } -1/18 \text{ em space.} |$}}{{nl}}

{{math| \text{Read on}{{sp|0|tex}}\text{after a } 0 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|null|tex}}\text{after a null space.} |$}}{{nl}}

{{math| \text{Read on}{{sp|1|tex}}\text{after a } 1 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|1/18 em|tex}}\text{after a } 1/18 \text{ em space.} |$}}{{nl}}

{{math| \text{Implemented as } 1 \text{ mu, since don't know how to make } 1.5 \text{ mu.} |$}}{{nl}}
{{math| \text{Read on}{{sp|1.5|tex}}\text{after a } 1.5 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|1/12 em|tex}}\text{after a } 1/12 \text{ em space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|hair|tex}}\text{after a hair space.} |$}}{{nl}}

{{math| \text{Read on}{{sp|2|tex}}\text{after a } 2 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|1/9 em|tex}}\text{after a } 1/9 \text{ em space.} |$}}{{nl}}

{{math| \text{Read on}{{sp|3|tex}}\text{after a } 3 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|1/6 em|tex}}\text{after a } 1/6 \text{ em space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|thin|tex}}\text{after a thin space.} |$}}{{nl}}

{{math| \text{Read on}{{sp|4|tex}}\text{after a } 4 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|2/9 em|tex}}\text{after a } 2/9 \text{ em space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|med|tex}}\text{after a med space.} |$}}{{nl}}

{{math| \text{Read on}{{sp|5|tex}}\text{after a } 5 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|5/18 em|tex}}\text{after a } 5/18 \text{ em space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|thick|tex}}\text{after a thick space.} |$}}{{nl}}

{{math| \text{Read on}{{sp|6|tex}}\text{after a } 6 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|1/3 em|tex}}\text{after a } 1/3 \text{ em space.} |$}}{{nl}}

{{math| \text{Read onNafter an en space. (The en space should have the width of capital N.)} |$}}{{nl}}
{{math| \text{Read on}{{sp|9|tex}}\text{after a } 9 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|1/2 em|tex}}\text{after a } 1/2 \text{ em space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|en|tex}}\text{after an en space.} |$}}{{nl}}

{{math| \text{Read onMafter an em space. (The em space should have the width of two capital N.)} |$}}{{nl}}
{{math| \text{Read on}{{sp|18|tex}}\text{after a } 18 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|1 em|tex}}\text{after a } 1 \text{ em space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|em|tex}}\text{after an em space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|quad|tex}}\text{after a quad space.} |$}}{{nl}}

{{math| \text{Read on}{{sp|36|tex}}\text{after a } 36 \text{ mu space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|2 em|tex}}\text{after a } 2 \text{ em space.} |$}}{{nl}}
{{math| \text{Read on}{{sp|qquad|tex}}\text{after a qquad space.} |$}}

yields the LaTeX formatted






























































See also

  • {{thinsp}} (3mu space, i.e. 3/18 of a quad space, or 1/6 em ≈ 0.16667em)
  • {{nbsp}} (6 mu no-break space, i.e. 6/18 of a quad space, or 1/3 em ≈ 0.33333em) (formally known as: non-breaking space)


  • {{indent}} (standardized indentations)


  • {{nl}} (new line)

External links