LaTeX forum ⇒ Graphics, Figures & TablesMolecular Energy Levels Topic is solved

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

Molecular Energy Levels

Postby MatthiasN » Tue Feb 12, 2013 2:13 pm

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 5880 times

Tags:

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

Postby svend_tveskaeg » Tue Feb 12, 2013 2:34 pm

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

Postby MatthiasN » Tue Feb 12, 2013 2:41 pm

Judging from the example that is exactly what I need. Thanks a lot!

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

Postby cgnieder » Tue Feb 12, 2013 9:42 pm

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
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Tue Feb 12, 2013 10:41 pm

A quick approach just for inspiration (perhaps in need of improvement). The output is attached.
  1. \documentclass[11pt]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[version=3]{mhchem}
  4. \usepackage{siunitx}
  5. \usepackage{tikz}
  6.  
  7. \begin{document}
  8. \begin{tikzpicture}[>=stealth,thick]
  9. \draw(0,5) -- (2,5) node[midway,above] {\ce{_{55}^{137}Cs}} node[right] {\num{30.2}\,y};
  10. \draw (3,2) -- (5,2) node[pos=0.75,above] {\ce{_{56}^{137m}Ba}};
  11. \draw (3,0) -- (5,0) node[pos=0.75,above] {\ce{_{56}^{137}Ba}};
  12. \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}};
  13. \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}};
  14. \draw[->] (3.5,2) -- (3.5,0);
  15. \node[right] at (5.2,1) {$y=\SI{0.66}{\MeV}$};
  16. \end{tikzpicture}
  17. \end{document}

Reading the manuals of the involved packages is recommendable.


Thorsten
Attachments
tmp.png
tmp.png (6.03 KiB) Viewed 5852 times
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

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

Postby svend_tveskaeg » Wed Feb 13, 2013 12:43 am

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: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Wed Feb 13, 2013 11:16 am

It can similarly be done by PSTricks. But some text nodes have to be positioned absolutely.
  1. \documentclass[11pt]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[version=3]{mhchem}
  4. \usepackage{siunitx}
  5. \usepackage{pstricks-add}
  6. \usepackage{auto-pst-pdf} % allow PSTricks code with PDFLaTeX
  7.  
  8. \begin{document}
  9. \begin{pspicture}[showgrid=true](-0.5,0)(7.5,5.5)
  10. \psline (0,5)(2,5) \rput(1,5.3){\ce{_{55}^{137}Cs}} \rput[l](2.2,5){$\num{30.2}\,y$}
  11. \psline (3,2)(5,2) \rput[r](5,2.3){\ce{_{56}^{137m}Ba}}
  12. \psline (3,0)(5,0) \rput[r](5,0.3){\ce{_{56}^{137}Ba}}
  13. \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}}
  14. \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}}
  15. \psline{->}(3.5,2)(3.5,0)
  16. \rput[l](5.2,1){$y=\SI{0.66}{\MeV}$}
  17. \end{pspicture}
  18. \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 5845 times
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

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

Postby svend_tveskaeg » Thu Feb 14, 2013 3:19 am

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: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Thu Feb 14, 2013 10:56 am

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.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 13 guests