LaTeX forum ⇒ Math & Sciencechemistry 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

Postby TreeFuels15 » Tue Apr 14, 2015 4:30 pm

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:

User avatar
Johannes_B
Site Moderator
Posts: 3803
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Apr 14, 2015 6:02 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.

User avatar
cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Sun Jul 05, 2015 12:55 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…

  1. \documentclass{article}
  2. \usepackage{chemformula}
  3.  
  4. \begin{document}
  5.  
  6. % chemistry?
  7. \ch{P_{ch$\sb{4}$}}
  8.  
  9. \ch{P_{H$\sb2$}^4}
  10.  
  11. \ch[charge-hshift=0pt]{P_{H$\sb2$}^4}
  12.  
  13. % mathematics?
  14. $P_{ch_4}$
  15.  
  16. $P_{H_2}^4$
  17.  
  18. % mix?
  19. $P_{\ch{ch4}}$
  20.  
  21. $P_{\ch{H2}}^4$
  22.  
  23. \end{document}


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

User avatar
Johannes_B
Site Moderator
Posts: 3803
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sun Jul 05, 2015 1:59 pm

And finally the example i intended to post.

  1. \documentclass[border=10pt]{standalone}
  2. \usepackage{chemformula}
  3. \begin{document}
  4. \begin{tabular}{c}
  5. \ch{2 H2 + O2 <> 2 H2O}\\
  6. $\mathrm P_{\mathrm{ch_4}}$ \\
  7. $\mathrm P_{H_2}^4$ \\
  8. \end{tabular}
  9. \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.


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 6 guests