使用方法/chem:修订间差异
来自康健生活
< 使用方法
无编辑摘要 |
无编辑摘要 |
||
| (未显示同一用户的19个中间版本) | |||
| 第3行: | 第3行: | ||
==Chemistry== | ==Chemistry== | ||
有三种方式呈现在使用的化学式和化学方程式: | |||
* <nowiki><chem>...</chem></nowiki>(是已弃用的别名)<nowiki><ce>...</ce></nowiki> | |||
* <nowiki><math chem>...</math></nowiki> | |||
* <nowiki>{{chem}}</nowiki> 和 <nowiki>{{chem2}}</nowiki>,需要模板支持 | |||
{{Warning| | |||
请注意,MediaWiki中的mhchem支持仍然存在主要问题。通过启用扩展功能并使用格式化单个项目,可以解决某些问题。例如, <nowiki><math chem>\ce</nowiki> | |||
{{Double-columns| | |||
<pre> | |||
<math chem>\ce{pIC_{50}} = -\log_{10} \ce{(IC_{50})}</math></pre> | |||
| | |||
<math chem>\ce{pIC_{50}} = -\log_{10} \ce{(IC_{50})}</math> | |||
}} | |||
}} | |||
===Molecular and condensed formula=== | |||
{|class="wikitable" style="text-align:center" | {|class="wikitable" style="text-align:center" | ||
! mhchem !! { | ! mhchem !! Equivalent HTML | ||
|- | |||
| | |||
{| class="wikitable" | |||
|- | |||
! Markup !! Renders as | |||
|- | |||
| <nowiki><chem>H2O</chem></nowiki>|| <chem>H2O</chem> | |||
|- | |||
| <nowiki><chem>Sb2O3</chem></nowiki>|| <chem>Sb2O3</chem> | |||
|- | |||
| <nowiki><chem>(NH4)2S</chem></nowiki>|| <chem>(NH4)2S</chem> | |||
|} | |||
| | |||
{| class="wikitable" | |||
|- | |- | ||
| | ! Markup !! Renders as | ||
|- | |||
| <nowiki>H<sub>2</sub>O</nowiki> || H<sub>2</sub>O | |||
|- | |||
| <nowiki>Sb<sub>2</sub>O<sub>3</sub></nowiki> || Sb<sub>2</sub>O<sub>3</sub> | |||
|- | |||
| | | <nowiki>(NH<sub>4</sub>)<sub>2</sub>S</nowiki> || (NH<sub>4</sub>)<sub>2</sub>S | ||
|} | |||
|} | |} | ||
===Bonds=== | ===Bonds=== | ||
{|class="wikitable" | |||
! | {| class="wikitable" | ||
|- | |||
! Markup !! Renders as | |||
|- | |||
| <nowiki><chem>C6H5-CHO</chem></nowiki> || <chem>C6H5-CHO</chem> | |||
|- | |- | ||
| <nowiki><chem>A-B=C#D</chem></nowiki> || <chem>A-B=C#D</chem> | |||
|} | |} | ||
===Charges=== | ===Charges=== | ||
{|class="wikitable" | {| class="wikitable" | ||
|- | |||
| <nowiki><chem>H+</chem></nowiki> || <chem>H+</chem> | |||
|- | |||
| <nowiki><chem>NO3-</chem></nowiki> || <chem>NO3-</chem> | |||
|- | |||
| <nowiki><chem>CrO4^2-</chem></nowiki> || <chem>CrO4^2-</chem> | |||
|- | |||
| <nowiki><chem>AgCl2-</chem></nowiki> || <chem>AgCl2-</chem> | |||
|- | |||
| <nowiki><chem>[AgCl2]-</chem></nowiki> || <chem>[AgCl2]-</chem> | |||
|- | |||
| <nowiki><chem>Y^99+</chem></nowiki> || <chem>Y^99+</chem> | |||
|- | |- | ||
| <nowiki><chem>Y^{99+}+</chem></nowiki> || <chem>Y^{99+}+</chem> | |||
<nowiki><chem>Y^{99+}</chem></nowiki>| | |||
|} | |} | ||
===Addition compounds and stoichiometric numbers=== | ===Addition compounds and stoichiometric numbers=== | ||
{|class="wikitable" | {| class="wikitable" | ||
! | |- | ||
| <nowiki><chem>MgSO4.7H2O</chem></nowiki> || <chem>MgSO4.7H2O</chem> | |||
|- | |||
| <nowiki><chem>KCr(SO4)2*12H2O</chem></nowiki> || <chem>KCr(SO4)2*12H2O</chem> | |||
|- | |||
| <nowiki><chem>CaSO4.1/2H2O + 1\!1/2 H2O -> CaSO4.2H2O</chem></nowiki> || <chem>CaSO4.1/2H2O + 1\!1/2 H2O -> CaSO4.2H2O</chem> | |||
|- | |- | ||
| <nowiki><chem>25/2 O2 + C8H18 -> 8 CO2 + 9 H2O</chem></nowiki> || <chem>25/2 O2 + C8H18 -> 8 CO2 + 9 H2O</chem> | |||
|} | |} | ||
===Wiki linking=== | ===Wiki linking=== | ||
===(Italic) Math=== | ===(Italic) Math=== | ||
{|class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| <nowiki><chem>{C_\mathit{x}H_\mathit{y}} + \mathit{z}O2 -> {\mathit{x}CO2} + \frac{\mathit{y}}{2}H2O</chem></nowiki> || <chem>{C_\mathit{x}H_\mathit{y}} + \mathit{z}O2 -> {\mathit{x}CO2} + \frac{\mathit{y}}{2}H2O</chem> | |||
|} | |} | ||
===Oxidation states=== | ===Oxidation states=== | ||
{|class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| <nowiki><chem>Fe^{II}Fe^{III}2O4</chem></nowiki> || <chem>Fe^{II}Fe^{III}2O4</chem> | |||
|} | |} | ||
===Greek characters=== | ===Greek characters=== | ||
{|class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| <nowiki><chem>\mu-Cl</chem></nowiki> || <chem>\mu-Cl</chem> | |||
|- | |||
| <nowiki><chem>[Fe(\eta^5-C5H5)2]</chem></nowiki> || <chem>[Fe(\eta^5-C5H5)2]</chem> | |||
|} | |} | ||
===Isotopes=== | ===Isotopes=== | ||
{|class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| <nowiki><chem>^{227}_{90}Th+</chem></nowiki> || <chem>^{227}_{90}Th+</chem> | |||
|- | |||
| <nowiki><chem>^0_{-1}n-</chem></nowiki> || <chem>^0_{-1}n-</chem> | |||
|} | |} | ||
===States=== | ===States=== | ||
States subscripting is not IUPAC recommendation. | States subscripting is not IUPAC recommendation. | ||
{|class="wikitable" | {| class="wikitable" | ||
|- | |||
| <nowiki><chem>H2_{(aq)}</chem></nowiki> || <chem>H2_{(aq)}</chem> | |||
|- | |- | ||
| <nowiki><chem>CO3^{2-}(aq)</chem></nowiki> || <chem>CO3^{2-}(aq)</chem> | |||
</nowiki>|<chem>CO3^{2-}(aq)</chem> | |||
|} | |} | ||
=== | === Precipitate === | ||
{|class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| <nowiki><chem>Ba^2+ + SO4^{2-} -> BaSO4(v)</chem></nowiki> || <chem>Ba^2+ + SO4^{2-} -> BaSO4(v)</chem> | |||
} | |||
|} | |} | ||
===Reaction arrows=== | ===Reaction arrows=== | ||
{ | {| class="wikitable" | ||
|- | |||
|<nowiki><chem>A ->B</chem></nowiki> | |<nowiki><chem>A ->B</chem></nowiki> | ||
|<chem>A -> B</chem> | |<chem>A -> B</chem> | ||
|- | |||
|<nowiki><chem>A <- B</chem></nowiki> | |<nowiki><chem>A <- B</chem></nowiki> | ||
|<chem>A <- B</chem> | |<chem>A <- B</chem> | ||
|- | |||
|<nowiki><chem>A <=> B</chem></nowiki> | |<nowiki><chem>A <=> B</chem></nowiki> | ||
|<chem>A <=> B</chem> | |<chem>A <=> B</chem> | ||
|- | |||
|<nowiki><chem>A <=>> B</chem></nowiki> | |<nowiki><chem>A <=>> B</chem></nowiki> | ||
|<chem>A <=>> B</chem> | |<chem>A <=>> B</chem> | ||
|- | |||
|<nowiki><chem>A <<=> B</chem></nowiki> | |<nowiki><chem>A <<=> B</chem></nowiki> | ||
|<chem>A <<=> B</chem> | |<chem>A <<=> B</chem> | ||
|- | |||
|<syntaxhighlight lang="latex" inline><chem>A ->[{}\atop x] B</chem></syntaxhighlight> | |<syntaxhighlight lang="latex" inline><chem>A ->[{}\atop x] B</chem></syntaxhighlight> | ||
|<chem>A ->[{}\atop x] B</chem> | |<chem>A ->[{}\atop x] B</chem> | ||
|- | |||
|<syntaxhighlight lang="latex" inline><chem>A ->[\text{text above}][\text{text below}] B</chem></syntaxhighlight> | |<syntaxhighlight lang="latex" inline><chem>A ->[\text{text above}][\text{text below}] B</chem></syntaxhighlight> | ||
|<chem>A ->[\text{text above}][\text{text below}] B</chem> | |<chem>A ->[\text{text above}][\text{text below}] B</chem> | ||
|- | |||
|<syntaxhighlight lang="latex" inline><chem>A ->[{}\atop\ce{+H2O}] B</chem></syntaxhighlight> | |<syntaxhighlight lang="latex" inline><chem>A ->[{}\atop\ce{+H2O}] B</chem></syntaxhighlight> | ||
|<chem>A ->[{}\atop\ce{+H2O}] B</chem> | |<chem>A ->[{}\atop\ce{+H2O}] B</chem> | ||
|} | |||
==== Comparison of arrow symbols ==== | ==== Comparison of arrow symbols ==== | ||
{ | |||
|<nowiki><math>\rightarrow</math></nowiki>|<math>\rightarrow</math> | {| class="wikitable" | ||
|<nowiki><math>\rightleftarrows</math></nowiki>|<math>\rightleftarrows</math> | |- | ||
|<nowiki><math>\rightleftharpoons</math></nowiki>|<math>\rightleftharpoons</math> | |<nowiki><math>\rightarrow</math></nowiki> | ||
|<nowiki><math>\leftrightarrow</math></nowiki>|<math>\leftrightarrow</math> | |<math>\rightarrow</math> | ||
|- | |||
|<nowiki><math>\rightleftarrows</math></nowiki> | |||
|<math>\rightleftarrows</math> | |||
|- | |||
|<nowiki><math>\rightleftharpoons</math></nowiki> | |||
|<math>\rightleftharpoons</math> | |||
|- | |||
|<nowiki><math>\leftrightarrow</math></nowiki> | |||
|<math>\leftrightarrow</math> | |||
|- | |||
|<nowiki><math>\longrightarrow</math> | |<nowiki><math>\longrightarrow</math> | ||
<chem>-></chem></nowiki>|<math>\longrightarrow</math><br/><chem>-></chem> | <chem>-></chem></nowiki> | ||
|<math>\longrightarrow</math><br/><chem>-></chem> | |||
|- | |||
|<nowiki><math>\rightleftharpoons</math></nowiki> | |<nowiki><math>\rightleftharpoons</math></nowiki> | ||
<nowiki><chem><=></chem></nowiki>|<math>\rightleftharpoons</math><br/><chem><=></chem> | <nowiki><chem><=></chem></nowiki> | ||
|<math>\rightleftharpoons</math><br/><chem><=></chem> | |||
|- | |||
|<nowiki><math>\longleftrightarrow</math> | |<nowiki><math>\longleftrightarrow</math> | ||
<chem><-></chem></nowiki>|<math>\longleftrightarrow</math><br/><chem><-></chem> | <chem><-></chem></nowiki> | ||
|<math>\longleftrightarrow</math><br/><chem><-></chem> | |||
|} | |||
===Further examples using ordinary LaTeX tags=== | ===Further examples using ordinary LaTeX tags=== | ||
| 第312行: | 第203行: | ||
\underbrace{\ce{2Fe3O4}}_{\text{magnetite}} + \ce{1/2 O2 ->}\ &{\color{BrickRed}\underbrace{\ce{3(\alpha{-}Fe2O3)}}_{\text{hematite}}} | \underbrace{\ce{2Fe3O4}}_{\text{magnetite}} + \ce{1/2 O2 ->}\ &{\color{BrickRed}\underbrace{\ce{3(\alpha{-}Fe2O3)}}_{\text{hematite}}} | ||
\end{align}</math> | \end{align}</math> | ||
2026年11月26日 (四) 04:56的最新版本
有关显示化学符号的MediaWiki 解析器扩展标签 <ce>(重命名为<chem>),显示公式 Chemistry”。
Chemistry
有三种方式呈现在使用的化学式和化学方程式:
- <chem>...</chem>(是已弃用的别名)<ce>...</ce>
- <math chem>...</math>
- {{chem}} 和 {{chem2}},需要模板支持
Molecular and condensed formula
| mhchem | Equivalent HTML | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Bonds
| Markup | Renders as |
|---|---|
| <chem>C6H5-CHO</chem> | |
| <chem>A-B=C#D</chem> |
Charges
| <chem>H+</chem> | |
| <chem>NO3-</chem> | |
| <chem>CrO4^2-</chem> | |
| <chem>AgCl2-</chem> | |
| <chem>[AgCl2]-</chem> | |
| <chem>Y^99+</chem> | |
| <chem>Y^{99+}+</chem> |
Addition compounds and stoichiometric numbers
| <chem>MgSO4.7H2O</chem> | |
| <chem>KCr(SO4)2*12H2O</chem> | |
| <chem>CaSO4.1/2H2O + 1\!1/2 H2O -> CaSO4.2H2O</chem> | |
| <chem>25/2 O2 + C8H18 -> 8 CO2 + 9 H2O</chem> |
Wiki linking
(Italic) Math
| <chem>{C_\mathit{x}H_\mathit{y}} + \mathit{z}O2 -> {\mathit{x}CO2} + \frac{\mathit{y}}{2}H2O</chem> |
Oxidation states
| <chem>Fe^{II}Fe^{III}2O4</chem> |
Greek characters
| <chem>\mu-Cl</chem> | |
| <chem>[Fe(\eta^5-C5H5)2]</chem> |
Isotopes
| <chem>^{227}_{90}Th+</chem> | |
| <chem>^0_{-1}n-</chem> |
States
States subscripting is not IUPAC recommendation.
| <chem>H2_{(aq)}</chem> | |
| <chem>CO3^{2-}(aq)</chem> |
Precipitate
| <chem>Ba^2+ + SO4^{2-} -> BaSO4(v)</chem> |
Reaction arrows
| <chem>A ->B</chem> | |
| <chem>A <- B</chem> | |
| <chem>A <=> B</chem> | |
| <chem>A <=>> B</chem> | |
| <chem>A <<=> B</chem> | |
<chem>A ->[{}\atop x] B</chem>
|
|
<chem>A ->[\text{text above}][\text{text below}] B</chem>
|
|
<chem>A ->[{}\atop\ce{+H2O}] B</chem>
|
Comparison of arrow symbols
| <math>\rightarrow</math> | |
| <math>\rightleftarrows</math> | |
| <math>\rightleftharpoons</math> | |
| <math>\leftrightarrow</math> | |
| <math>\longrightarrow</math> <chem>-></chem> | |
| <math>\rightleftharpoons</math>
<chem><=></chem> |
|
| <math>\longleftrightarrow</math> <chem><-></chem> |
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>
No categories