使用方法/chem

来自康健生活
Kangkk​(留言 | 贡献)2020年2月20日 (四) 14:30的版本

有关显示化学符号的MediaWiki 解析器扩展标签 <ce>(重命名为<chem>),显示公式 Chemistry”。


Chemistry

模板:Shortcut There are three ways to render chemical sum formulae as used in chemical equations:

模板:Xtag is short for <math chem>\ce{X}</math> (where X is a chemical sum formula)

Technically, 模板:Xtag is a math tag with the extension mhchem enabled, according to the MathJax documentation.

Note, that the commands \cee and \cf are disabled, because they are marked as deprecated in the mhchem LaTeX package documentation.

If the formula reaches a certain "complexity", spaces might be ignored (<chem>A + B</chem> might be rendered as if it were <chem>A+B</chem> with a positive charge). In that case, write <chem>A{} + B</chem> (and not <chem>{A} + {B}</chem> as was previously suggested). This will allow auto-cleaning of formulae once the bug will be fixed and/or a newer mhchem version will be used.

Please note that there are still major issues with mhchem support in MediaWiki. Some issue can be solved by enabling the extension using 模板:Xtag and formatting individual items with \ce. For example, 模板:Markup2

Molecular and condensed formula

mhchem {{chem}} {{chem2}} Equivalent HTML

模板:Markup

模板:Automarkup

模板:Automarkup

模板:Automarkup

Bonds

mhchem Equivalent {{chem}} and HTML {{chem2}}

模板:Markup

模板:Markup

模板:Markup

Charges

mhchem {{chem}} Equivalent HTML

模板:Markup

模板:Automarkup

模板:Automarkup

Addition compounds and stoichiometric numbers

mhchem {{chem}} {{chem2}}

模板:Markup

模板:Markup

模板:Markup

Wiki linking

{{chem}} 模板:Markupv
{{chem2}} 模板:Markupv

(Italic) Math

mhchem 模板:Markupv
{{chem}} 模板:Markupv

Oxidation states

mhchem

模板:Markupv

{{chem}} with 模板:Tag 模板:Markupv

Greek characters

mhchem Equivalent {{chem}} and HTML

模板:Markup

模板:Markup

Isotopes

mhchem Equivalent {{chem}} and HTML

模板:Markup

模板:Markup

States

States subscripting is not IUPAC recommendation.

mhchem {{chem}}

模板:Markup

模板:Automarkup

mhchem 模板:Markupv
{{chem}} 模板:Markupv
{{chem2}} 模板:Markupv
Equivalent HTML 模板:Markupv

Reaction arrows

模板:Markup

Comparison of arrow symbols

模板:Markup

Further examples using ordinary LaTeX tags

<math chem>\begin{align}
\overbrace{\ce{2Fe3O4}}^{\text{magnetite}} + \ce{1/2 O2 ->}\ &{\color{Brown}\overbrace{\ce{3(\lambda{-}Fe2O3)}}^{\text{maghemite}}}\\
\underbrace{\ce{2Fe3O4}}_{\text{magnetite}} + \ce{1/2 O2 ->}\ &{\color{Red}\underbrace{\ce{3(\alpha{-}Fe2O3)}}_{\text{hematite}}}
\end{align}</math>
2FeA3OA4⏞magnetite+12OA2⟶ 3(λ-FeA2OA3)⏞maghemite2FeA3OA4⏟magnetite+12OA2⟶ 3(α-FeA2OA3)⏟hematite

To align the equations or color them, use 模板:Xtag and 模板:Code. 模板:-