Graphics, Figures & TablesMolecular Energy Levels

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
MatthiasN
Posts: 41
Joined: Sun Mar 11, 2012 1:21 pm

Molecular Energy Levels

Post by MatthiasN »

Hi everyone,

I was wondering if it would be possible to draw molecular energy levels? To clarify what I mean I've attached a file that displays the radioactive decay of 137-Cs. If it is possible, which package should I try to master and are there any templates available?

This would be really helpful for me. Thanks for reading,
Matthias
Attachments
Radioactive_decay_of_cesium137.png
Radioactive_decay_of_cesium137.png (32.24 KiB) Viewed 10579 times

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Molecular Energy Levels

Post by svend_tveskaeg »

It seems to me that tikZ is the way to go; I found this example. A look at Cle­mens Nieder­berger's chemistry packages on CTAN might to of some use but I am not sure of this.

P.S. I don't use tikZ myself so I cannot help you further here, unfortunately.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
MatthiasN
Posts: 41
Joined: Sun Mar 11, 2012 1:21 pm

Re: Molecular energy levels

Post by MatthiasN »

Judging from the example that is exactly what I need. Thanks a lot!
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Molecular Energy Levels

Post by cgnieder »

svend_tveskaeg wrote:A look at Cle­mens Nieder­berger's chemistry packages on CTAN might to of some use but I am not sure of this.
No, none of my packages provides an interface for such diagrams. However, as you've noticed, the task is an easy one with TikZ. Shouldn't be too hard with PSTricks either, I would think...

Regards
site moderator & package author
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Molecular Energy Levels

Post by localghost »

A quick approach just for inspiration (perhaps in need of improvement). The output is attached.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[version=3]{mhchem}
\usepackage{siunitx}
\usepackage{tikz}

\begin{document}
  \begin{tikzpicture}[>=stealth,thick]
    \draw(0,5) -- (2,5) node[midway,above] {\ce{_{55}^{137}Cs}} node[right] {\num{30.2}\,y};
    \draw (3,2) -- (5,2) node[pos=0.75,above] {\ce{_{56}^{137m}Ba}};
    \draw (3,0) -- (5,0) node[pos=0.75,above] {\ce{_{56}^{137}Ba}};
    \draw[->] (0.5,5) -- (3.25,0) node[midway,below left] {$\beta^-$ \SI{1.2}{\MeV}} node[pos=0.2,left] {\scriptsize\SI{6.5}{\percent}};
    \draw[->] (1.5,5) -- (3.5,2) node[midway,above right] {$\beta^-$ \SI{0.5}{\MeV}} node[pos=0.2,right] {\scriptsize\SI{93.5}{\percent}};
    \draw[->] (3.5,2) -- (3.5,0);
    \node[right] at (5.2,1) {$y=\SI{0.66}{\MeV}$};
  \end{tikzpicture}
\end{document}
Reading the manuals of the involved packages is recommendable.


Thorsten
Attachments
tmp.png
tmp.png (6.03 KiB) Viewed 10551 times
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Molecular Energy Levels

Post by svend_tveskaeg »

cgnieder wrote:Shouldn't be too hard with PSTricks either, I would think.
You are probably right but it is not as easy as with TikZ (assuming you can use this ;)), I think.
localghost wrote:A quick approach ...
Wauw! Very elegant. :)
Last edited by svend_tveskaeg on Wed Feb 13, 2013 12:47 am, edited 1 time in total.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Molecular Energy Levels

Post by localghost »

It can similarly be done by PSTricks. But some text nodes have to be positioned absolutely.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[version=3]{mhchem}
\usepackage{siunitx}
\usepackage{pstricks-add}
\usepackage{auto-pst-pdf}  % allow PSTricks code with PDFLaTeX

\begin{document}
  \begin{pspicture}[showgrid=true](-0.5,0)(7.5,5.5)
    \psline (0,5)(2,5) \rput(1,5.3){\ce{_{55}^{137}Cs}} \rput[l](2.2,5){$\num{30.2}\,y$}
    \psline (3,2)(5,2) \rput[r](5,2.3){\ce{_{56}^{137m}Ba}}
    \psline (3,0)(5,0) \rput[r](5,0.3){\ce{_{56}^{137}Ba}}
    \psline{->}(0.5,5)(3.25,0) \rput[r](1.5,2.5){$\beta^-$ \SI{1.2}{\MeV}} \rput[r](0.8,4){\scriptsize \SI{6.5}{\percent}}
    \psline{->}(1.5,5)(3.5,2)  \rput[l](3,3.5){$\beta^-$ \SI{0.5}{\MeV}} \rput[l](2.2,4.5){\scriptsize \SI{93.5}{\percent}}
    \psline{->}(3.5,2)(3.5,0)
    \rput[l](5.2,1){$y=\SI{0.66}{\MeV}$}
  \end{pspicture}
\end{document}
Since I nowadays rarely use PSTricks, I didn't find a more elegant way.
Attachments
tmp.png
tmp.png (5.81 KiB) Viewed 10544 times
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Re: Molecular Energy Levels

Post by svend_tveskaeg »

Very nice! (My "objection" was indeed regarding the absolute positioning; I don't know of a more elegant method myself.)

<Rest of post deleted>
Last edited by svend_tveskaeg on Thu Feb 14, 2013 3:57 pm, edited 1 time in total.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Molecular Energy Levels

Post by localghost »

svend_tveskaeg wrote:[…] P.S. I think I read somewhere (maybe Herbert told me...) that it is a good idea to load auto-pst-pdf before any of the PSTricks packages but I am not sure.

Update
Hmm! In this post, auto-pst-pdf is loaded after the PSTricks packages. :?

If someone know what the best practice is, it would be nice to hear from you.
That would be off topic here. I suggest to ask him directly.
Post Reply