使用方法/chem

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

有关显示化学符号的MediaWiki 解析器扩展标签 <ce>(重命名为解析失败 (语法错误): {\displaystyle \ce{),显示公式 Chemistry”。 ==Chemistry== <!-- this is linked from [[Template:Xtag]] -->{{shortcut|WP:MATHCHEM}} There are three ways to render chemical sum formulae as used in [[chemical equation]]s: *{{xtag|chem|p}} ({{xtag|ce|p}} is a deprecated alias for it) *{{xtag|math|p|params=chem}} *{{tlx|chem}} and {{tlx|chem2}} {{xtag|chem|p|content=X}} is short for <syntaxhighlight lang="xml" inline><math chem>\ce{X}</math></syntaxhighlight> (where <code>X</code> is a chemical sum formula) Technically, {{xtag|math|params=chem}} is a <code>math</code> tag with the extension <code>mhchem</code> enabled, according to the [http://mathjax.readthedocs.org/en/latest/tex.html#mhchem MathJax documentation]. Note, that the commands <code>\cee</code> and <code>\cf</code> are disabled, because they are marked as deprecated in the [http://www.ctan.org/pkg/mhchem mhchem LaTeX package documentation]. If the formula reaches a certain "complexity", spaces might be ignored (<code><nowiki><chem>A + B}} </nowiki> 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. 模板:-