Difference between revisions of "Template:Format molecular formula"

From blackwiki
Jump to navigation Jump to search
test>Crissov
(support x and y indices as in NOx, <sub style="font-variant-position:sub">)
m (8 revisions imported)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{{{{|safesubst:}}}#invoke:String|replace|{{{1|'''This template requires an unnamed parameter (plain text molecule representation to format as wikitext).'''}}}|(%u%l?)([%dxy]+)|%1<sub style="font-variant-position:sub">%2</sub>|plain=0}}<noinclude>{{Documentation}}</noinclude>
+
{{{{{|safesubst:}}}#invoke:String|replace|{{{1|'''This template requires an unnamed parameter (plain text molecule representation to format as wikitext).'''}}}|(%u%l?)([%dxy]+)|%1<sub>%2</sub>|plain=0}}<noinclude>{{Documentation}}</noinclude>

Latest revision as of 14:58, 9 September 2020

This template requires an unnamed parameter (plain text molecule representation to format as wikitext).

50px Template documentation[view] [edit] [history] [purge]

Usage

{{Format molecular formula|H2O}} gives the molecular formula for water (H2O).

Example arguments: H2O (above), CO2 (CO2), H6C2O (H6C2O), H2SO4 (H2SO4).

The Lua module just puts "<sub></sub>" tags in the wanted spots.

Similar templates

{{Format ion formula}}, for ion chemical formulas.