Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Template:Chem/doc
Template
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
Move
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Documentation subpage}} {{High-use}} {{COinS safe|n}} This template allows you to render chemical formulas using HTML. Alternatively, you can use {{tag|chem}}, using [[Help:Displaying_a_formula#Chemistry|mhchem LaTeX]] notation to generate formulas. <div style="clear: both;"></div> == Template instructions == This template, {{Tl|chem}}, serves to simplify the writing of chemical formulas. For example, <pre> {{chem|H|2|O}} </pre> will yield: : {{chem|H|2|O}} === Algebraic expression as subscript === Algebraic expressions are rendered as subscripts (but must not contain upper case letters). <syntaxhighlight lang="wikitext"> {{chem|C|''n''|H|2''n''+2}} </syntaxhighlight> gives : {{chem|C|''n''|H|2''n''+2}} === Charge === Ion charge superscripts (for: +/-) are also supported: <pre> {{chem|H|3|O|+}} </pre> yields a "+" as superscript: : {{chem|H|3|O|+}} Simultaneous subscripts/superscripts are automatically handled (use a hyphen for the minus sign): <pre> {{chem|SO|4|2-}} </pre> gives "2β" as superscript: : {{chem|SO|4|2-}} The hyphen is converted to a true minus sign. === Atomic number and mass number === The first parameter can be used for mass number. <pre> {{chem|4|He}} </pre> gives: : {{chem|4|He}} The first two parameters can be used for mass number and atomic number. <pre> {{chem|4|2|He}} </pre> gives: : {{chem|4|2|He}} '''''Note''''' : Only the first two parameters can handle two consecutive plain numbers (i.e. without a plus sign or a hyphen (<code>+</code> or <code>-</code>) following). Otherwise the template will loop. The [[Template:Chem2|Chem2 template]] can be used for e.g. {{chem2|^{1}H2^{16}O}}, heavy water. ''See also {{tl|Nuclide|}}'' === Linking === The optional parameter <kbd>link</kbd> changes the formula into a link. For example: <pre> {{chem|link=water|H|2|O}} </pre> will yield: : {{chem|link=water|H|2|O}} Individual elements can be linked in the following manner: <syntaxhighlight lang="wikitext"> {{chem|[[Hydrogen|H]]|2|[[Oxygen|O]]}} </syntaxhighlight> gives : {{chem|[[Hydrogen|H]]|2|[[Oxygen|O]]}} == Notes == * To include "=" in the formula, use "&#61;" For example, "<syntaxhighlight lang="wikitext" inline>{{chem|CH|2|=CH|2}}</syntaxhighlight>" yields {{chem|CH|2|=CH|2}}.<!-- AWKWARD, ISN'T IT? --> ** Or, don't use this template. For example, "<syntaxhighlight lang="wikitext" inline>CH<sub>2</sub>=CH<sub>2</sub></syntaxhighlight>" yields CH<sub>2</sub>=CH<sub>2</sub>. * To include "β‘" in the formula, use "&#8801;" For example, "<syntaxhighlight lang="wikitext" inline>{{chem|HC&#8801;CH}}</syntaxhighlight>" yields {{chem|HC≡CH}}.<!-- AWKWARD, ISN'T IT? --> * The template accepts up to twenty parameters in addition to <code>link</code>. * This template uses {{tl|su}}. == See also == * {{tl|Chem2}} * {{tl|Chem molar mass}} == TemplateData == {{TemplateData header}} {{collapse top|title=Template data|bg=#ccc}} <templatedata> { "params": { "1": {}, "2": {}, "3": {}, "4": {}, "5": {}, "6": {}, "7": {}, "8": {}, "9": {}, "10": {}, "11": {}, "12": {}, "13": {}, "14": {}, "15": {}, "16": {}, "17": {}, "18": {}, "19": {}, "20": {}, "21": {}, "22": {}, "23": {}, "24": {}, "link": { "label": "Link", "description": "Make the formula link to an article", "example": "Water", "type": "wiki-page-name" } }, "description": "Render chemical formulas using HTML. Alternatively, you can use <chem>...</chem>, using mhchem LaTeX notation to generate formulas.\n\nUp to 25 unnamed ordered parameters can be used with automatic detection of subscripts and superscripts.", "format": "inline", "paramOrder": [ "link", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24" ] } </templatedata> {{collapse bottom}} <includeonly>{{sandbox other|| [[Category:Text-specific formatting and function templates]] [[Category:Chemistry formatting and function templates]] [[Category:Superscript and subscript templates]] }}</includeonly>
Summary:
Please note that all contributions to Ikwipedia are considered to be released under the Creative Commons Attribution-ShareAlike (see
Ikwipedia:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width