I am trying to produce Bohr style diagrams of the elements. I have tried to use the Bohr package but although this produces something almost what I want, but does not show the orbit shapes or the makeup of the nucleus.
\documentclass{standalone}
\usepackage{tikz,graphicx}
\usetikzlibrary{decorations.markings}
\definecolor{myyellow}{RGB}{254,241,24}
\definecolor{myorange}{RGB}{234,125,1}
\def\proton(#1,#2){%
\fill[shading=ball,ball color=myyellow, opacity=0.75] (#1,#2) circle (10pt);
\node at (#1,#2) {\texttt{+}};
}
\def\neutron(#1,#2){%
\fill[shading=ball,ball color=myorange, opacity=0.75] (#1,#2) circle (10pt);
}
\def\electron{%
\fill[shading=ball,ball color=gray!30] (0,0) circle (5pt);
\node at (0,0) {\texttt{-}};
}
\def\sorbit(#1,#2){%
\draw[
color=violet,
rotate=#1,
postaction=decorate,
decoration={markings,
mark=at position #2 with {\electron},
}]
(0,0) ellipse (1.5 and 3.5);
}
\def\porbit(#1,#2){%
\draw[
color=violet,
rotate=#1,
postaction=decorate,
decoration={markings,
mark=at position #2 with {\electron},
}]
(0,0) ellipse (4 and 6);
}
\begin{document}
Hydrogen
\begin{tikzpicture}
%H Nucleons
\proton(0.2,-0.2)
%H orbits
\sorbit(40,.9)
\end{tikzpicture}
Helium
\begin{tikzpicture}
%He Nuclius
\neutron(-0.1,0.1)
\proton(0.2,-0.2)
\neutron(-0.25,-0.5)
\proton(-0.3,0.1)
%He Orbit
\sorbit(100,.3)
\sorbit(50,0.8)
\end{tikzpicture}
\end{document}
Does anybody know of a package which produces this so Ideally I could just type something like \H inside my tikz picture.
Also if any help on automating the location of the protons and neutrons so I don't have to do each one, one by one.
Have tried to use something like How to create nice-looking nuclei in TikZ? to produce the nucleus but just don't seem to make it work.




shading=ballrather thanshade=ball? – mbert Nov 02 '22 at 23:07