Template:Chem2/doc

chem2 is a template used to format a chemical formula or equation.

end } -bracket issue
When input ends correctly with a } -bracket, like with, the final }-brackets are technically mixed up:
 * &rarr; A_{x}H_{1-x} ❌

The closing bracket {..} of input and end of template brackets }}.


 * Solutions:
 * add empty pipe:  (empty parameter #2)
 * add parameters numbers 1 and 2 (empty):
 * add a space:
 * Result:  &rarr; A_{x}H_{1-x} ✅

Formulas, charges, equations
Formulas (without charge) are just written:

Charges are written inside parentheses:

Charges +1 and &minus;1 can be written plain:
 * same as
 * same as
 * same as

Chemical equations: The arrows can be written as  or just. All characters (and unicode markup) are valid input except, = (Mediawiki use it),   and   (endash etc.)

Hapticity and mu:

Wikilinks
, should not be used inside wikilinks; this can cause erratic failures to properly render sub/superscripts in other invocations on the same page. Instead, use the following options.

Whole formula link
Link the whole formula with &lt;wiki pagename&gt;:

Or use wikilink brackets in input like NH3:

Link each element (C, Hg) and generic element code (R, X)
Use yes to link from the first occurrence of each element symbol, and some functional-group symbols such as Ph

Link functional groups
Some common groups are recognized and linked if you wikilink them using undefined
 * In particular H2O links to water of crystallization in, because a link to water is generally unnecessary.
 * In particular H2O links to water of crystallization in, because a link to water is generally unnecessary.
 * In particular H2O links to water of crystallization in, because a link to water is generally unnecessary.

You can link to any article even if chem2 is unaware of it:

To change the default link:

Examples and tests
(The first "→" in each example is not part of the output; it separates the example from its output.)










 * (chem:
 * (chem:

Special


 * (bad)
 * (bad)
 * (bad)
 * (bad)
 * (bad)










 * Unknown element.
 * Too many "(".
 * Too many ")".

TemplateData
{	"params": { "1": {},		"auto": {}, "link": {} } }