Interesting LaTeX Packages – Bohr and Element – electronic orbits and atomic structure

One of the USPs of using LaTeX is the variety of packages that are available to get things done. Some packages will give you special environments to make your documents better, some will help in typesetting or some will help you create graphics or some just provide you with commands for specific symbols. Of course, all these can be done manually by creating your own command, but why reinvent the wheel? There are hundreds of packages at the Comprehensive TeX Archive Network. I have come across many packages that were useful via browsing the packages at CTAN. In this series of posts we will see some packages that are interesting and might be useful. This series of posts is also a sort of personal bookmarking scheme for me. It has happened in the past that I have discovered some interesting LaTeX package, only to forget its existence when I needed its functionality in a project.
In this first post, we will look at two related packages bohr and elements by Clemens Niederberger. The bohr package provides you with a simple functionality to draw the Bohr diagrams for different elements along with electronic configurations.
Load the bohr package by \usepackage{bohr} in the preamble
To use the package simple type the number of electrons and the element symbol. For example, Lithium \bohr{3}{Li} will simply give you

Similarly for other elements
Lithium \bohr{3}{Li}Oxygen \bohr{8}{O}Carbon \bohr{12}{C}Mercury \bohr{80}{Hg}

Now another very useful option in the vohr package is to print the shell-wise electronic configuration for a given element. For example Oxygen \bohr{8}{O} \elconf{O} will give you

This will be a very useful feature when you are writing chemistry or atomic physics texts. Of course you can change the way the shells look.
\setbohr{ shell-options-add = dashed, shell-options-add = red, shell-dist = .75em, nucleus-options-set = {draw=black,fill=orange,opacity=0.5}, electron-options-set = {color=green}, insert-missing}
Mercury\bohr{80}{Hg} \elconf{Hg}

The insert-missing option will give you either the correct number of electrons when the element symbol is given, or  will give you the element symbol when the number of electrons is given. There are more options to explore in the documentation.
Now let us look at the elements package.

This package provides means for retrieving properties of chemical elements like atomic number, element symbol, element name, electron distribution or isotope number.

The package provides atomic number, symbol, name, main isotope and electronic configuration for elements upto 118. For example, just using the atomic number 35 I can get \elementname{35} \elementsymbol{35} \elconf{35}

Having the data accessible in the form of number can be very useful especially if you want to generate tables. The table below from the package documentation was generated by iteratively looping atomic number and invoking commands

\theelement
\elementsymbol{\arabic{element}}
\elementname{\arabic{element}}
\mainelementisotope{\arabic{element}}
\elconf{\arabic{element}}