This site is supported by donations to The OEIS Foundation.

Template:Sup sub

From OeisWiki
Jump to: navigation, search

The {{sup sub}} or {{supsub}} OEIS Wiki formatting and function template is used to superscript and/or subscript text, either in script style (default for both superscript and subscript) or text style. Returns either HTML+CSS or LaTeX code.

Usage

Text{{supsub|superscript|subscript}}

or

Text{{supsub|superscript|subscript|format}}

or

Text{{supsub|superscript|subscript|styles}}

or

Text{{supsub|superscript|subscript|styles|format}}

where the [optional] third argument (styles) is from

  • script & script, script&script, s & s, s&s: to get HTML+CSS or LaTeX script style superscript and subscript (default);
  • script & text, script&text, s & t, s&t: to get HTML+CSS or LaTeX script style superscript and text style subscript;
  • text & script, text&script, t & s, t&s: to get HTML+CSS or LaTeX text style superscript and script style subscript;
  • text & text, text&text, t & t, t&t: to get HTML+CSS or LaTeX text style superscript and subscript;

and the [optional] last argument (format) is from

  • htm: to get HTML+CSS (default);
  • tex: to get LaTeX code;

and where script size is 0.7em and text size is 1.0em.

Superscript followed by subscript

The code : Text<sup>superscript</sup><sub>subscript</sub> yields the HTML

Textsuperscriptsubscript

The code : Text{{sup|superscript}}{{sub|subscript}} yields the HTML+CSS

Textsuperscriptsubscript

Examples

before a{{supsub|above|below|htm}} after yields: before a above below after
before a{{supsub|above|below}} after yields: before a above below after
before a{{supsub|above|below|s&s}} after yields: before a above below after
before a{{supsub|above|below|s&s|htm}} after yields: before a above below after
before a{{supsub|above|below|s&t}} after yields: before a above below after
before a{{supsub|above|below|t&s}} after yields: before a above below after
before a{{supsub|above|below|t&t}} after yields: before a above below after

HTML+CSS math examples

before {{math|''a''{{supsub|''ijkl''|''ijkl''|htm}}|&}} after yields: before 
aijklijkl
after
before {{math|''a''{{supsub|''ijkl''|''ijkl''}}|&}} after yields: before 
aijklijkl
after
before {{math|''a''{{supsub|''ijkl''|''ijkl''|s&s}}|&}} after yields: before 
aijklijkl
after
before {{math|''a''{{supsub|''ijkl''|''ijkl''|s&s|htm}}|&}} after yields: before 
aijklijkl
after
before {{math|''a''{{supsub|''ijkl''|''ijkl''|s&t}}|&}} after yields: before 
aijklijkl
after
before {{math|''a''{{supsub|''ijkl''|''ijkl''|t&s}}|&}} after yields: before 
aijklijkl
after
before {{math|''a''{{supsub|''ijkl''|''ijkl''|t&t}}|&}} after yields: before 
aijklijkl
after
before {{math|''a''{{supsub|{{sp|3}}''j''|''i''}}|&}} after yields: before 
a  ji
after
before {{math|''a''{{supsub|''k''|''j''}}|&}} after yields: before 
akj
after
before {{math|''a''{{supsub|{{sp|3}}''j''|''k''}}|&}} after yields: before 
a  jk
after

LaTeX math examples

before {{math|a{{supsub|ijkl|ijkl|tex}}|$}} after yields: before after
before {{math|a{{supsub|ijkl|ijkl|s&s|tex}}|$}} after yields: before after
before {{math|a{{supsub|ijkl|ijkl|s&t|tex}}|$}} after yields: before after
before {{math|a{{supsub|ijkl|ijkl|t&s|tex}}|$}} after yields: before after
before {{math|a{{supsub|ijkl|ijkl|t&t|tex}}|$}} after yields: before after
before {{math|a{{supsub|j|i|tex}}|$}} after yields: before after
before {{math|a{{supsub|k|j|tex}}|$}} after yields: before after
before {{math|a{{supsub|j|k|tex}}|$}} after yields: before after

More elaborate examples

Examples with nesting

You may nest the templates {{sup}}, {{sub}}, {{supsub}} and {{subsup}}.

To get text style HTML+CSS

{{math|''x''{{supsub|''y''{{supsub|''a''|''b''}}|''z''{{sub|''c''}}}}|&}} yields: 
xyabzc
{{math|''x''{{supsub|''y''{{supsub|''a''|''b''}}|''z''{{sup|''d''}}}}|&}} yields: 
xyabzd
{{math|''x''{{supsub|''y''{{supsub|''a''|''b''}}|''z''{{supsub|''c''|''d''}}}}|&}} yields: 
xyabzcd

or, to get text style LaTeX

{{math|''x''{{supsub|''y''{{supsub|''a''|''b''|tex}}|''z''{{sub|''c''|tex}}|tex}}|$}} yields:
{{math|''x''{{supsub|''y''{{supsub|''a''|''b''|tex}}|''z''{{sup|''d''|tex}}|tex}}|$}} yields:
{{math|''x''{{supsub|''y''{{supsub|''a''|''b''|tex}}|''z''{{supsub|''c''|''d''|tex}}|tex}}|$}} yields:

or, to get display style HTML+CSS

{{math|''x''{{supsub|''y''{{supsub|''a''|''b''}}|''z''{{sub|''c''}}}}|&&}} yields:
xyabzc
{{math|''x''{{supsub|''y''{{supsub|''a''|''b''}}|''z''{{sup|''d''}}}}|&&}} yields:
xyabzd
{{math|''x''{{supsub|''y''{{supsub|''a''|''b''}}|''z''{{supsub|''c''|''d''}}}}|&&}} yields:
xyabzcd

or, to get display style LaTeX

{{math|''x''{{supsub|''y''{{supsub|''a''|''b''|tex}}|''z''{{sub|''c''|tex}}|tex}}|$$}} yields:
{{math|''x''{{supsub|''y''{{supsub|''a''|''b''|tex}}|''z''{{sup|''d''|tex}}|tex}}|$$}} yields:
{{math|''x''{{supsub|''y''{{supsub|''a''|''b''|tex}}|''z''{{supsub|''c''|''d''|tex}}|tex}}|$$}} yields:

Example with prescripts (as well as postscripts)

before {{math|{{supsub|''i''|''j''{{sp|1}}}}''a''{{supsub|''k''|''l''}}|&}} after yields: before 
ijakl
after
before {{math|{{supsub|''m''|{{sp|2}}''n''}}''a''{{supsub|{{sp|2}}''j''|''k''}}|&}} after yields: before 
m   na   jk
after

See also

  • {{^}} (exponent)
  • {{sub}}      (textsubscript)
  • {{sup}}      (textsuperscript)
  • {{sub sup}} or {{subsup}}      (text superscriptsubscript)
  • {{sup sub}} or {{supsub}}      (text superscript subscript)