Template:Subsup: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
ArrowHead294 (talk | contribs)
Make template
 
ArrowHead294 (talk | contribs)
mNo edit summary
Line 1: Line 1:
<includeonly>{{#ifeq: {{{1|}}}{{{2|}}}{{{3|}}}||<!-- no output if no parameters -->|{{nowrap|{{#ifeq: {{{1|}}}||<!-- do nothing -->|{{{1}}}{{#ifeq: {{{s|}}}|0|<!-- no spacing -->|<span style{{=}}"font-size: 40%;">&nbsp;</span>}}}}{{#ifeq: {{{2|}}}{{{3|}}}||<!-- do nothing if neither parameter -->|<span style{{=}}"font-size: 70%;">{{#ifeq: {{{3|}}}||<!-- subscript --><span style{{=}}"vertical-align: -0.4em;">{{{2}}}</span>|{{#ifeq: {{{2|}}}||<!-- superscript --><span style{{=}}"vertical-align: 0.7em;">{{{3}}}</span>|<!-- superscript and subscript --><span style{{=}}"display: inline-block; vertical-align: -0.4em; line-height: 1.1em;">{{{3}}}<br />{{{2}}}</span>}}<!-- end subscript and superscript -->}}<span style{{=}}"font-size: 40%;">&nbsp;</span></span><!-- end font-size italic -->}}}}}}</includeonly><noinclude>
<includeonly>{{#ifeq: {{{1|}}}{{{2|}}}{{{3|}}}||<!-- no output if no parameters -->|{{nowrap|{{#ifeq: {{{1|}}}||<!-- do nothing -->|{{{1}}}{{#ifeq: {{{s|}}}|0|<!-- no spacing -->|{{nbhsp}}}}}}{{#ifeq: {{{2|}}}{{{3|}}}||<!-- do nothing if neither parameter -->|<span style{{=}}"font-size: 70%;">{{#ifeq: {{{3|}}}||<!-- subscript --><span style{{=}}"vertical-align: -0.4em;">{{{2}}}</span>|{{#ifeq: {{{2|}}}||<!-- superscript --><span style{{=}}"vertical-align: 0.7em;">{{{3}}}</span>|<!-- superscript and subscript --><span style{{=}}"display: inline-block; vertical-align: -0.4em; line-height: 1.1em;">{{{3}}}<br />{{{2}}}</span>}}<!-- end subscript and superscript -->}}<span style{{=}}"font-size: 40%;">&nbsp;</span></span><!-- end font-size italic -->}}}}}}</includeonly><noinclude>
This template provides a simple means of coding inline expressions that have both a subscript and a superscript, for display in the same typeface as the surrounding text.
This template provides a simple means of coding inline expressions that have both a subscript and a superscript, for display in the same typeface as the surrounding text.



Revision as of 15:06, 9 January 2025

This template provides a simple means of coding inline expressions that have both a subscript and a superscript, for display in the same typeface as the surrounding text.

Template documentation[view] [edit] [history] [purge]
English Wikipedia has an article on:

This template provides a simple means of coding inline expressions that have both a subscript and a superscript, for display in the same typeface as the surrounding text.

Usage

Pass in, as three unnamed parameters, the expression followed by the subscript and then the superscript:

{{subsup|expression|subscript|superscript}}

If you only need a superscript or only a subscript, just use <sup> or <sub> tags.

For example:

{{subsup|''x''|2|3}}

gives

x⁠ ⁠3
2