Testwiki:Manual of Style/Superscripts and subscripts

From testwiki
Jump to navigation Jump to search

Template:Confused Template:Shortcut Template:Supplement

A superscript or subscript is text that is positioned slightly above or below the normal line of type. Superscripts and subscripts are often rendered in a smaller font size than the adjacent normal text. This part of the Manual of Style aims to achieve consistency in the use and formatting of superscripts and subscripts in Wikipedia articles.

General guidelines

Subscripts and superscripts should be wrapped in <sub> and <sup> HTML tags, respectively, with no other formatting info, with some exceptions (see below). The Template:Tlx and Template:Tlx templates are useful shortcuts to the HTML markup. Do not use the Unicode subscripts and superscripts Template:!xt and Template:!xt, or XML/HTML character entity references (Template:!xt etc.). Rather, write Template:Xt and Template:Xt to produce the superscripts Template:Xt and Template:Xt. The superscripted 2 and 3 are easier to read, especially on small displays, and ensure that exponents are properly aligned. Compare:

Template:!xt (Unicode superscripts) to
Template:Xt (w<sup>i</sup>x<sup>2</sup>z<sup>(n + 6)</sup>) or
Template:Xt (w{{sup|i}}x{{sup|2}}z{{sup|(n + 6)}})

Template:Br

Template:!xt (&sup2;) to
Template:Xt (<sup>2</sup>) or
Template:Xt ({{sup|2}})

These guidelines also apply in citations and template parameters; templates are responsible for cleaning up markup if needed for external consumption, e.g. for COinS.

Exceptions

Phonetic transcriptions

Phonetic transcriptions in the International Phonetic Alphabet and Uralic Phonetic Alphabet (which are most often inside Template:Tl, Template:Tl, Template:Tl, and related templates) should use Unicode subscripts and superscripts. This follows the recommendation of the International Phonetic Association[1] and is done by the tools, help pages, and articles referenced in Wikipedia:Manual of Style/Pronunciation. Tone should usually be marked with diacritics or IPA tone symbols, according to Wikipedia:Manual of Style/Pronunciation#Tone. Use Template:Tl for any non-compliant articles.

Orthographies

Superscript and subscript symbols in orthographies of languages, such as in the Proto-Indo-European language, some Salishan languages, and the Wade–Giles romanization of Mandarin, should use Unicode subscripts and superscripts.

Titles

Another exception where Unicode superscripts and subscripts are used is in the title of articles, though this is only rarely necessary. See Template:Section link.

Short descriptions

Per WP:SDFORMAT, Template:Tl cannot use HTML or wikitext formatting, leaving Unicode characters as the only option for superscripts and subscripts.

Dates and numbers

Template:Main

Music

Template:Main

Unit symbols and abbreviations

Template:Main

Science

Chemistry

Template:Main Descriptions of:

Template:Xt using {{chem2|C2H5OH}}
Template:Xt using Template:Tlx

Mathematics

Template:Main Template:See

Template:Xt using 2{{sup|2}} = 4

Special care is needed with subscripted labels to distinguish the purpose of the subscript (as this is a common error): variables and constants in subscripts should be italic, while textual labels should be in normal text font (Roman, upright). For example:

xthis one=ythat one   (correct—typeset from <math> x_\text{this one} = y_\text{that one} \,\!</math>),

and

i=1nyi2   (correct—typeset from <math>\sum_{i=1}^n { y_i^2 }\!</math>),

but not

r=xpredictedxobserved   (incorrect—typeset from r = x_{predicted} - x_{observed}).

Moreover, the TeX engine used on Wikipedia may format simple superscripts using Template:Tag depending on user preferences. Thus, instead of the image x2, many users see xTemplate:Sup. Formulae formatted without using TeX should use the same syntax to maintain the same appearance.

Notes

Template:Reflist