## LaTeX forum ⇒ Math & Science ⇒ chemistry equations template

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
TreeFuels15
Posts: 1
Joined: Tue Apr 14, 2015 4:21 pm

### chemistry equations template

Looking for a software package that will allow me to create chemical equations in all of their complexity. Subscripts going down two levels not just one (Pch4 for example with the ch sub the P and the 4 sub the ch). Also need two levels of superscript: PH2,e with the numeral 4 over the H2 (the H is sub to the P and the 2 is sub to the H). So it would read P(sub H) (sub 2) and superscript 3 over the H. I'm using MS Word 2013 and it only allows one level of super and subscripting. I have very complex formulas with complex fractions. Can you help? (PS: not a chemist or scientist or math wizard; an exec. assistant!) Thanks - Kay
Last edited by cgnieder on Wed Aug 24, 2016 9:07 pm, edited 1 time in total.
Reason: Corrected typo in title

Tags:

Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm
Hi and welcome,

i think you came just to the right place. One of the great strengths of LaTeX is its capability of mathematical typesetting.

There are packages for chemical equations in specific, but i can't really imagine what you are trying to do. You split everything in atoms describing where each piece is supposed to go and it sounds a bit unusual to me.

Can you provide some image of what you want to set?

Here is a short example of the chemical and mathematical capabilities. As chemistry is a subset of maths, the preset magic is limited.

You can see the output directly by clicking on »Open in Writelatex« (which is now called overleaf).
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm
PH2,e with the numeral 4 over the H2 (the H is sub to the P and the 2 is sub to the H). So it would read P(sub H) (sub 2) and superscript 3 over the H

This is kind of a confusing sentence: which »numeral 4«? And where does »superscript 3« suddenly come from?

Unfortunately it is rather unclear what exactly you need…

\documentclass{article}\usepackage{chemformula} \begin{document} % chemistry?\ch{P_{ch$\sb{4}$}} \ch{P_{H$\sb2$}^4} \ch[charge-hshift=0pt]{P_{H$\sb2$}^4} % mathematics?$P_{ch_4}$ $P_{H_2}^4$ % mix?$P_{\ch{ch4}}$ $P_{\ch{H2}}^4$ \end{document}

Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm
And finally the example i intended to post.

\documentclass[border=10pt]{standalone}\usepackage{chemformula}\begin{document}\begin{tabular}{c}\ch{2 H2 + O2 <> 2 H2O}\\$\mathrm P_{\mathrm{ch_4}}$ \\$\mathrm P_{H_2}^4$ \\\end{tabular}\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.