Math & Sciencechemistry equations template

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

chemistry equations template

Post by TreeFuels15 »

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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: chemisty equations template

Post by Johannes_B »

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.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

chemistry equations template

Post by cgnieder »

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…

Code: Select all

\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
site moderator & package author
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

chemistry equations template

Post by Johannes_B »

And finally the example i intended to post.

Code: Select all

\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.
Post Reply