%% Group 1 - IA
  \node[name=H, Element] {\ElemH};
  \node[name=Li, below of=H,  Element] {\ElemLi};
  \node[name=Na, below of=Li, Element] {\ElemNa};
  \node[name=K, below of=Na, Element] {\ElemK};
  \node[name=Rb, below of=K, Element] {\ElemRb};
  \node[name=Cs, below of=Rb, Element] {\ElemCs};
  \node[name=Fr, below of=Cs, Element] {\ElemFr};

%% Group 2 - IIA
  \node[name=Be, right of=Li, Element] {\ElemBe};
  \node[name=Mg, below of=Be, Element] {\ElemMg};
  \node[name=Ca, below of=Mg, Element] {\ElemCa};
  \node[name=Sr, below of=Ca, Element] {\ElemSr};
  \node[name=Ba, below of=Sr, Element] {\ElemBa};
  \node[name=Ra, below of=Ba, Element] {\ElemRa};

%% Group 3 - IIIB
  \node[name=Sc, right of=Ca, Element] {\ElemSc};
  \node[name=Y, below of=Sc, Element] {\ElemY};
  \node[name=La, below of=Y, Element] {\ElemLa};
  \node[name=Ac, below of=La, Element]{\ElemAc};

%% Group 4 - IVB
  \node[name=Ti, right of=Sc, Element] {\ElemTi};
  \node[name=Zr, below of=Ti, Element] {\ElemZr};
  \node[name=Hf, below of=Zr, Element] {\ElemHf};

%% Group 5 - VB
  \node[name=V, right of=Ti, Element] {\ElemV};
  \node[name=Nb, below of=V, Element] {\ElemNb};
  \node[name=Ta, below of=Nb, Element] {\ElemTa};

%% Group 6 - VIB
  \node[name=Cr, right of=V, Element] {\ElemCr};
  \node[name=Mo, below of=Cr, Element] {\ElemMo};
  \node[name=W, below of=Mo, Element] {\ElemW};

%% Group 7 - VIIB
  \node[name=Mn, right of=Cr, Element] {\ElemMn};
  \node[name=Tc, below of=Mn, Element] {\ElemTc};
  \node[name=Re, below of=Tc, Element] {\ElemRe};

%% Group 8 - VIIIB
  \node[name=Fe, right of=Mn, Element] {\ElemFe};
  \node[name=Ru, below of=Fe, Element] {\ElemRu};
  \node[name=Os, below of=Ru, Element] {\ElemOs};

%% Group 9 - VIIIB
  \node[name=Co, right of=Fe, Element] {\ElemCo};
  \node[name=Rh, below of=Co, Element] {\ElemRh};
  \node[name=Ir, below of=Rh, Element] {\ElemIr};

%% Group 10 - VIIIB
  \node[name=Ni, right of=Co, Element] {\ElemNi};
  \node[name=Pd, below of=Ni, Element] {\ElemPd};
  \node[name=Pt, below of=Pd, Element] {\ElemPt};

%% Group 11 - IB
  \node[name=Cu, right of=Ni, Element] {\ElemCu};
  \node[name=Ag, below of=Cu, Element] {\ElemAg};
  \node[name=Au, below of=Ag, Element] {\ElemAu};

%% Group 12 - IIB
  \node[name=Zn, right of=Cu, Element] {\ElemZn};
  \node[name=Cd, below of=Zn, Element] {\ElemCd};
  \node[name=Hg, below of=Cd, Element] {\ElemHg};

%% Group 13 - IIIA
  \node[name=Ga, right of=Zn, Element] {\ElemGa};
  \node[name=Al, above of=Ga, Element] {\ElemAl};
  \node[name=B, above of=Al, Element] {\ElemB};
  \node[name=In, below of=Ga, Element] {\ElemIn};
  \node[name=Tl, below of=In, Element] {\ElemTl};

%% Group 14 - IVA
  \node[name=C, right of=B, Element] {\ElemC};
  \node[name=Si, below of=C, Element] {\ElemSi};
  \node[name=Ge, below of=Si, Element] {\ElemGe};
  \node[name=Sn, below of=Ge, Element] {\ElemSn};
  \node[name=Pb, below of=Sn, Element] {\ElemPb};

%% Group 15 - VA
  \node[name=N, right of=C, Element] {\ElemN};
  \node[name=P, below of=N, Element] {\ElemP};
  \node[name=As, below of=P, Element] {\ElemAs};
  \node[name=Sb, below of=As, Element] {\ElemSb};
  \node[name=Bi, below of=Sb, Element] {\ElemBi};

%% Group 16 - VIA
  \node[name=O, right of=N, Element] {\ElemO};
  \node[name=S, below of=O, Element] {\ElemS};
  \node[name=Se, below of=S, Element] {\ElemSe};
  \node[name=Te, below of=Se, Element] {\ElemTe};
  \node[name=Po, below of=Te, Element] {\ElemPo};

%% Group 17 - VIIA
  \node[name=F, right of=O, Element] {\ElemF};
  \node[name=Cl, below of=F, Element] {\ElemCl};
  \node[name=Br, below of=Cl, Element] {\ElemBr};
  \node[name=I, below of=Br, Element] {\ElemI};
  \node[name=At, below of=I, Element] {\ElemAt};

%% Group 18 - VIIIA
  \node[name=Ne, right of=F, Element] {\ElemNe};
  \node[name=He, above of=Ne, Element] {\ElemHe};
  \node[name=Ar, below of=Ne, Element] {\ElemAr};
  \node[name=Kr, below of=Ar, Element] {\ElemKr};
  \node[name=Xe, below of=Kr, Element] {\ElemXe};
  \node[name=Rn, below of=Xe, Element] {\ElemRn};


%% Lanthanide
  \node[name=Ce, below of=Hf, Element,
            xshift=35mm, yshift=-35mm] {\ElemCe};
  \node[name=Pr, right of=Ce, Element] {\ElemPr};
  \node[name=Nd, right of=Pr, Element] {\ElemNd};
  \node[name=Pm, right of=Nd, Element] {\ElemPm};
  \node[name=Sm, right of=Pm, Element] {\ElemSm};
  \node[name=Eu, right of=Sm, Element] {\ElemEu};
  \node[name=Gd, right of=Eu, Element] {\ElemGd};
  \node[name=Tb, right of=Gd, Element] {\ElemTb};
  \node[name=Dy, right of=Tb, Element] {\ElemDy};
  \node[name=Ho, right of=Dy, Element] {\ElemHo};
  \node[name=Er, right of=Ho, Element] {\ElemEr};
  \node[name=Tm, right of=Er, Element] {\ElemTm};
  \node[name=Yb, right of=Tm, Element] {\ElemYb};
  \node[name=Lu, right of=Yb, Element] {\ElemLu};

%% Actinide
  \node[name=Th, below of=Ce, Element] {\ElemTh};
  \node[name=Pa, right of=Th, Element] {\ElemPa};
  \node[name=U, right of=Pa, Element] {\ElemU};
  \node[name=Np, right of=U, Element] {\ElemNp};
  \node[name=Pu, right of=Np, Element] {\ElemPu};
  \node[name=Am, right of=Pu, Element] {\ElemAm};
  \node[name=Cm, right of=Am, Element] {\ElemCm};
  \node[name=Bk, right of=Cm, Element] {\ElemBk};
  \node[name=Cf, right of=Bk, Element] {\ElemCf};
  \node[name=Es, right of=Cf, Element] {\ElemEs};
  \node[name=Fm, right of=Es, Element] {\ElemFm};
  \node[name=Md, right of=Fm, Element] {\ElemMd};
  \node[name=No, right of=Md, Element] {\ElemNo};
  \node[name=Lr, right of=No, Element] {\ElemLr};

% Title, subtitle, key
  \node at ($(H.west -| Co.north) + (0mm, 15mm)$) [name=diagramTitle, TitleLabel]
    {X-ray Absorption and Emission Energies of the Elements};

  \node at ($(Na.west -| V.north) + (-7em, 7em)$) [name=diagramTitle, SubTitleLabel]
  {\small{\textsf{
      \begin{tabular*}{5mm}{l}
        Atomic Data and Energies from \\%
        W. T. Elam, B. D. Ravel and  J. R. Sieber, \hfil\\%
        {\emph{Radiation Physics and Chemistry}}
        {\bf{63}}, pp 121-128 (2002)  \\%
        \noalign{\smallskip} \\%
        Common oxidation states from wikipedia.org, after\\%
        N. N. Greenwood and A. Earnshaw, \\
      {\emph{Chemistry of the Elements}}, 2nd  ed. (1997).\\%
        \noalign{\smallskip} \\%
        {All energies in eV.} \hfil\\%
        {Emission line strengths are approximate, and vary with element.} \hfil\\%
      \end{tabular*}
    }}};

 \node at ($(Mg.west -| Ti.north) + (0em,7em)$) [name=elementKey, Element]{\ElemKey};

%% add some extra space around table
  \node at ($(Lr.south -| Rn.east) + (2em, -2em)$)  [name=Space1, Space]{ };
  \node at ($(H.north  -|  H.west) - (2em, -2em)$)  [name=Space2, Space]{ };


\node at ($(Th.south -| Fr.west) + (35mm, 7mm)$) [name=diagramTitle,
SubTitleLabel]{  {\small{\textsf{ \begin{tabular}{c}  \ScientistPhoto \end{tabular} }}}  };

   \node at ($(Ce.south -| Ac.west) + (15mm, 5mm)$) [name=diagramTitle,
   SubTitleLabel]{
     {\small{\textsf{
           \begin{tabular}{l}
             https://xrayabsorption.org/xraytable \hfil \\
             \noalign{\smallskip}
             Version 4,  2020-April-19\\
             \noalign{\smallskip}
             \hspace{25mm} \pgfbox[center,top]{\pgfuseimage{qrcode}}\\
           \end{tabular}
           }}}};
