Extension:Chemistry/ChemFunctions.php

From MediaWiki.org
Jump to: navigation, search

ChemFunctions.php contains some functions used for chemical identifiers:

Contents

[edit] chemform-tag

Chemical Formula in the wikipedia can be quite tedious to put into the text. By placing the plain formula (without sub/superscript) inbetween the chemform-tags results in a formula being formatted properly; all numericals in subscript, all charges in superscript (numericals before a + or a - are also put in superscript (see examples).

[edit] Usage

<chemform>H2O</chemform>

[edit] Options

link: the text between the tags will be a link to Special:Chemicalsources.
noprocess: the text between the tags will not be processed.
query: the link created will not generate the 'to-search-for' data from the text between the tags, but use the value of this field instead.
wikilink: the formula between the tags will be a wikilink to the page (not yet implemented).

[edit] Examples

  1. <chemform>H2SO4</chemform> will appear as H2SO4
  2. <chemform>HSO4-</chemform> will appear as HSO4-, hence use:
<chemform>[HSO4]-</chemform> (result: [HSO4]-)
<chemform noprocess>HSO<sub>4</sub><sup>-</sup></chemform> (result: HSO4-)
Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox