Wikipedia:Manual of Style/Superscripts and subscripts: Difference between revisions
Content deleted Content added
→Mathematics: example |
→Mathematics: rm archaic use of spacing LaTeX codes from examples, now long deprecated |
||
(74 intermediate revisions by 36 users not shown) | |||
Line 1:
{{confused|MOS:ORDINAL}}
{{MoS guideline|MOS:SUP|MOS:SUB}}
{{style}}▼
'''[[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><sub></code> and <code><sup></code> tags, respectively, with no other formatting info. Do not use the [[Unicode subscripts and superscripts]] {{!xt|²}} and {{!xt|³}}, or [[List of XML and HTML character entity references|XML/HTML character entity references]] (<code>&sup2;</code>). Rather write <code><nowiki><sup>2</sup></nowiki></code> and <code><nowiki><sup>3</sup></nowiki></code> to produce the superscripts {{xt|<sup>2</sup>}} and {{xt|<sup>3</sup>}}. The superscripted 2 and 3 are easier to read, especially on small displays, and ensure that exponents are properly aligned. Compare:▼
: {{xt|w<sup>i</sup>x<sup>2</sup>y<sup>3</sup>z<sup>(n + 6)</sup>}}; (<code><nowiki>w<sup>i</sup>x<sup>2</sup>y<sup>3</sup>z<sup>(n + 6)</sup></nowiki></code>)▼
: {{!xt|1 + ''x'' + ''x''² + ''x''<sup>3</sup> + ''x''<sup>4</sup>}} (<code>&sup2;</code>) to ▼
: {{xt|1 + ''x'' + ''x''<sup>2</sup> + ''x''<sup>3</sup> + ''x''<sup>4</sup>}} (<code><sup>2</sup></code>).)▼
▲
==General guidelines==
▲Subscripts and superscripts should be wrapped in <code>
: {{!xt|wⁱx²z⁽ⁿ ⁺ ⁶⁾}} (Unicode superscripts) to
▲: {{xt|w<sup>i</sup>x<sup>2
: {{xt|w{{sup|i}}x{{sup|2}}z{{sup|(n + 6)}}}} (<code><nowiki>w{{sup|i}}x{{sup|2}}z{{sup|(n + 6)}}</nowiki></code>)
{{br}}
▲: {{!xt|1
▲: {{xt|1
: {{xt|1 + ''x''{{sup|2}} + ''y''{{sup|3}}}} (<code><nowiki>{{sup|2}}</nowiki></code>)
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===
<!-- Discussed with participants at [[Wikipedia talk:Manual of Style/Pronunciation]] -->
Phonetic transcriptions in the [[International Phonetic Alphabet]] and [[Uralic Phonetic Alphabet]] (which are most often inside {{tl|IPA}}, {{tl|IPA link}}, {{tl|UPA}}, and related templates) should use [[Unicode subscripts and superscripts]]. This follows the recommendation of the [[International Phonetic Association]]<ref>{{cite book|last=Esling|first=John|author-link=John Esling|year=1999|chapter=Appendix 2: Computer coding of IPA symbols|editor=International Phonetic Association|title=Handbook of the International Phonetic Association: A Guide to the Use of the International Phonetic Alphabet|pages=161–185|publisher=Cambridge University Press|isbn=0-521-63751-1}}</ref> 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 {{tl|Needs IPA}} 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 is where Unicode superscripts and subscripts are used is in the ''title'' of articles, though this is only rarely necessary. See {{section link|Wikipedia:Manual of Style/Titles|Typographic effects}}.
===Short descriptions===
Per [[WP:SDFORMAT]], {{tl|short description}} cannot use HTML or wikitext formatting, leaving Unicode characters as the only option for superscripts and subscripts.
==Dates and numbers==
{{main|Wikipedia:Manual of Style (dates and numbers)}}
* The '''ordinal suffix''' (e.g., ''th'') is not superscripted ({{xt|23rd}} and {{xt|496th}}, not {{!xt|23<sup>rd</sup>}} and {{!xt|496<sup>th</sup>}}). (Exception: Non-English languages; see [[MOS:ORDINAL]].)
* '''Centuries and millennia''' are written using ordinal numbers, without superscripts and without Roman numerals: {{xt|the second millennium}}, {{xt|the 19th century}}, {{xt|a 19th-century book}}
* '''Non-[[
==Music==
{{main|Wikipedia:Manual of Style
* In '''[[figured bass]]''', superscript and subscript may be combined
*For [[diminished chord]]s and half-diminished chords: <code><nowiki>{{music|dim}}</nowiki></code> and <code><nowiki>{{music|halfdim}}</nowiki></code>.
*For
==Unit symbols and abbreviations ==
{{main|Wikipedia:Manual of Style (dates and numbers)#Unit names and symbols}}
* '''
==Science==
Line 33 ⟶ 54:
Descriptions of:
*'''[[Chemical compound]]s'''
:{{xt|
*'''[[
:{{xt|{{
===Mathematics===
Line 42 ⟶ 63:
* '''[[Exponentiation]]''' is indicated using a superscript:
:{{xt|2
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:
: <math> x_\text{this one} = y_\text{that one}
and
: <math>\sum_{i=1}^n { {y_i}^2 }
but not
: <math>r = x_{predicted} - x_{observed}</math>   (''incorrect''—typeset from <code><nowiki
Moreover, the TeX engine used on Wikipedia may format simple superscripts using
==Notes==
{{reflist}}
== See also ==
▲Moreover, the TeX engine used on Wikipedia may format simple superscripts using <code><nowiki><sup>...</sup></nowiki></code> depending on user preferences. Thus, instead of the image <math>x^2\,</math>, many users see ''x''<sup>2</sup>. Formulae formatted without using TeX should use the same syntax to maintain the same appearance.
* This guideline was implemented per [[Special:Permalink/1297089060#Superscript and subscript typography guideline|an RfC discussion]] at [[Wikipedia:Village pump (proposals)]].
[[Category:Wikipedia Manual of Style (formatting)|Superscripts and subscripts]]
|