Wikipedia:Manual of Style/Superscripts and subscripts: Difference between revisions

Content deleted Content added
rm serif font which defeats the purpose of the example
Line 2:
'''[[Subscript and superscript|Superscripts and subscripts]]''' appears smaller than the normal line of type and is set slightly below or above it and have many uses. This part of the [[Wikipedia:Manual of Style|Manual of Style]] aims to achieve consistency in the use and formatting of superscripts and subscripts in Wikipedia articles.
 
Subscripts and superscripts should be wrapped in <code>&lt;sub></code> and <code>&lt;sup></code> tags, respectively, with no other formatting info. Do not use the [[Unicode subscripts and superscripts]] {{!xt|<span class="bad_example" style="color: #B20000;">²}}</span> and {{!xt|<span class="bad_example" style="color: #B20000;">³}}</span>, or [[List of XML and HTML character entity references|XML/HTML character entity references]] (<code>&amp;sup2;</code>). Rather write <code><nowiki><sup>2</sup></nowiki></code> and <code><nowiki><sup>3</sup></nowiki></code> to produce the superscripts {{xt|<span class="example" style="color: #006F00;"><sup>2</sup>}}</span> and {{xt|<span class="example" style="color: #006F00;"><sup>3</sup>}}</span>. The superscripted 2 and 3 are easier to read, especially on small displays, and ensure that exponents are properly aligned. Compare:
: {{!xt|<span class="bad_example" style="color: #B20000;">wⁱx²y³z⁽ⁿ⁺⁶⁾}}</span> to
: {{xt|<span class="example" style="color: #006F00;">w<sup>i</sup>x<sup>2</sup>y<sup>3</sup>z<sup>(n + 6)</sup>}}</span> (<code><nowiki>w<sup>i</sup>x<sup>2</sup>y<sup>3</sup>z<sup>(n + 6)</sup></nowiki></code>)
<br />
: {{!xt|<span class="bad_example" style="color: #B20000;">1 + ''x'' + ''x''² + ''x''<sup>3</sup> + ''x''<sup>4</sup>}}</span> (<code>&amp;sup2;</code>) to
: {{xt|<span class="example" style="color: #006F00;">1 + ''x'' + ''x''<sup>2</sup> + ''x''<sup>3</sup> + ''x''<sup>4</sup>}}</span> (<code>&lt;sup>2&lt;/sup></code>)
 
Font sizes and such should be entrusted to be handled with stylesheets.<!--see discussion on Talk:Template:Sup-->