LaTex (4) Display Chemical Formulas

1, LaTex import plug-in

$$ \ce{Ba^2+ + SO4^2- =BaSO4 v} \\\\ \ce{S2O3^2- +2H+ =S v +SO2 ^ +H2O}\\\\ \ce{N2 + 3H2 <=>T[high temperature, pressurized][catalyst] 2NH3}\\\\ \ce{2H2 + O2 ->[\text{burning}] 2H2O}\\\\ \ce{CH4 + 2O2 ->[\text{FIRE}] CO2 + 2H2O} $$

Above is the classic mhchem.js plugin example equation.

In the previous articles, we learned to enter mathematical formulas using LaTex. In the web page, MathJax can input inorganic chemical formulas and equations by introducing the mhchem.js plug-in, and import symbols such as long equal signs by introducing autoload-all.js.

Import method:

html
1
2
3
4
5
6
7
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
     TeX: {
         extensions: ["mhchem.js", "autoload-all.js"]
     }
});
</script>

For organic chemistry practitioners, related programs (such as chemfig) are too complex to be implemented as plugins by MathJax.

2. Use

After importing the plugin, use \ce as the beginning of chemical formulas and equations.

In addition, chemical formulas of the form \(\ce{H2SO4}\) no longer need to use ^ and _ to indicate subscripts and subscripts, but can be directly written as H2SO4. **However, if it is an ion symbol, pay attention to the writing of the plus and minus signs, as well as spaces. These will be mentioned in later tutorials.

LaTex (4) Display Chemical Formulas

https://blog.tsinbei.com/en/archives/672/

Author
Hsukqi Lee
Posted on

2022-12-13

Edited on

2022-12-13

Licensed under

CC BY-NC-ND 4.0

Comments

Name
Mail
Site
None yet