This site is supported by donations to The OEIS Foundation.

Template:Sub sup

From OeisWiki
(Redirected from Template:Subsup)
Jump to: navigation, search

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

Usage

Text{{subsup|subscript|superscript}}

or

Text{{subsup|subscript|superscript|format}}


or

Text{{subsup|subscript|superscript|styles}}

or

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

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

  • script & script, script&script, s & s, s&s: to get script size subscript and superscript (default);
  • script & text, script&text, s & t, s&t: to get script size subscript and text size superscript;
  • text & script, text&script, t & s, t&s: to get text size subscript and script size superscript;
  • text & text, text&text, t & t, t&t: to get text size subscript and superscript;

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

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

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

Subscript followed by superscript

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

Textsubscriptsuperscript

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

Textsubscriptsuperscript

Examples

before a{{subsup|below|above|htm}} a{{subsup|''ijkl''|''ijkl''|htm}} after yields: before a abovebelow a ijklijkl after
before a{{subsup|below|above}} a{{subsup|''ijkl''|''ijkl''}} after yields: before a abovebelow a ijklijkl after
before a{{subsup|below|above|s&s}} a{{subsup|''ijkl''|''ijkl''|s&s}} after yields: before a abovebelow a ijklijkl after
before a{{subsup|below|above|s&s|htm}} a{{subsup|''ijkl''|''ijkl''|s&s|htm}} after yields: before a abovebelow a ijklijkl after
before a{{subsup|below|above|s&t}} a{{subsup|''ijkl''|''ijkl''|s&t}} after yields: before a abovebelow a ijklijkl after
before a{{subsup|below|above|t&s}} a{{subsup|''ijkl''|''ijkl''|t&s}} after yields: before a abovebelow a ijklijkl after
before a{{subsup|below|above|t&t}} a{{subsup|''ijkl''|''ijkl''|t&t}} after yields: before a abovebelow a ijklijkl after

HTML+CSS math examples

before {{math|''a''{{subsup|''ijkl''|''ijkl''|htm}}|&}} after yields: before 
aijklijkl
after
before {{math|''a''{{subsup|''ijkl''|''ijkl''}}|&}} after yields: before 
aijklijkl
after
before {{math|''a''{{subsup|''ijkl''|''ijkl''|s&s}}|&}} after yields: before 
aijklijkl
after
before {{math|''a''{{subsup|''ijkl''|''ijkl''|s&s|htm}}|&}} after yields: before 
aijklijkl
after
before {{math|''a''{{subsup|''ijkl''|''ijkl''|s&t}}|&}} after yields: before 
aijklijkl
after
before {{math|''a''{{subsup|''ijkl''|''ijkl''|t&s}}|&}} after yields: before 
aijklijkl
after
before {{math|''a''{{subsup|''ijkl''|''ijkl''|t&t}}|&}} after yields: before 
aijklijkl
after
before {{math|''a''{{subsup|''i''|{{sp|3}}''j''}}|&}} after yields: before 
aji
after
before {{math|''a''{{subsup|''j''|''k''}}|&}} after yields: before 
akj
after
before {{math|''a''{{subsup|''k''|{{sp|3}}''j''}}|&}} after yields: before 
ajk
after

LaTeX math examples

before {{math|a{{subsup|ijkl|ijkl|tex}}|$}} after yields: before after
before {{math|a{{subsup|ijkl|ijkl|s&s|tex}}|$}} after yields: before after
before {{math|a{{subsup|ijkl|ijkl|s&t|tex}}|$}} after yields: before after
before {{math|a{{subsup|ijkl|ijkl|t&s|tex}}|$}} after yields: before after
before {{math|a{{subsup|ijkl|ijkl|t&t|tex}}|$}} after yields: before after
before {{math|a{{subsup|i|j|tex}}|$}} after yields: before after
before {{math|a{{subsup|j|k|tex}}|$}} after yields: before after
before {{math|a{{subsup|k|j|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''{{subsup|''y''{{subsup|''a''|''b''}}|''z''{{sub|''c''}}}}|&}} yields: 
xzcyba
{{math|''x''{{subsup|''y''{{subsup|''a''|''b''}}|''z''{{sup|''d''}}}}|&}} yields: 
xzdyba
{{math|''x''{{subsup|''y''{{subsup|''a''|''b''}}|''z''{{subsup|''c''|''d''}}}}|&}} yields: 
xzdcyba

or, to get text style LaTeX

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

or, to get display style HTML+CSS

{{math|''x''{{subsup|''y''{{subsup|''a''|''b''}}|''z''{{sub|''c''}}}}|&&}} yields:
xzcyba
{{math|''x''{{subsup|''y''{{subsup|''a''|''b''}}|''z''{{sup|''d''}}}}|&&}} yields:
xzdyba
{{math|''x''{{subsup|''y''{{subsup|''a''|''b''}}|''z''{{subsup|''c''|''d''}}}}|&&}} yields:
xzdcyba

or, to get display style LaTeX

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

Example with prescripts (as well as postscripts)

before {{math|{{subsup|''i''{{sp|1}}|{{sp|1}}''j''}}''a''{{subsup|''k''|{{sp|1}}''l''}}|&}} after yields: before 
jialk
after
before {{math|{{subsup|''m''{{sp|1}}|{{sp|3}}''n''}}''a''{{subsup|{{sp|1}}''j''|''k''}}|&}} after yields: before 
nmakj
after

See also

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