# Electron Configuration

I have seen some other postings about related electron configurations, but nothing that matched what I was looking for. I'm wanting to create the following image:

• Welcome to TeX.SE! It is straightforward to draw this, e.g. using the matrix library of TikZ or using tikzmark and an ordinary table. Note, however, that generally users here are not too eager to punch in the texts from a screen shot. – user121799 Feb 20 '19 at 20:26
• Welcome to TeX.SX! On this site, a question should typically revolve around an abstract issue (e.g. "How do I get a double horizontal line in a table?") rather than a concrete application (e.g. "How do I make this table?"). Questions that look like "Please do this complicated thing for me" tend to get closed because they are either "off topic", "too broad", or "unclear". Please try to make your question clear and simple by giving a minimal working example (MWE): you'll stand a greater chance of getting help. – dexteritas Feb 20 '19 at 20:39

## 1 Answer

One out of many ways to do something of this sort.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{matrix,intersections,calc}
\begin{document}
\begin{tikzpicture}[font=\sffamily]
\matrix (mat) [matrix of nodes,column sep=0.2cm,row sep=2mm,
nodes={align=left},nodes in empty cells,
row 1/.append style={nodes={font=\footnotesize\sffamily}},
]{
& 1 & 6 & 10 & 14 \\
& 1s & & & \\
& 2s & 2p & & \\
& 3s & 3p & 3d & \\
& 4s & 4p & 4d & 4f\\
& 5s & 5p & 5d & 5f\\
& 6s & 6p & 6d & \\
& 7s & 7p & 7d & \\
};
\path[name path=boundary] (mat-1-1.south) -- (mat-1-3.south)
to[bend right] (mat-2-4.south) -- ([xshift=15mm]mat-5-5.south)
-- (mat.south east);
\foreach \X [remember=\X as \LastX] in {2,...,10}
{\ifnum\X<8
\path[overlay,name path=\X-line] (mat-\X-1.south west) coordinate(\X-start)
-- ++ ($5*($(mat-2-5.south west)- (mat-6-1.south west)$)$);
\else
\pgfmathtruncatemacro{\Xprime}{\X-7}
\path[overlay,name path=\X-line]
([xshift={-ifthenelse(\X==10,2,1)*1mm}]mat-8-\Xprime.south east)
coordinate(\X-start) -- ++ ($5*($(mat-2-5.south west)- (mat-6-1.south west)$)$);
\fi
\draw[blue!50,latex-,shorten <=2pt,name intersections={of=\X-line and boundary,by=i-\X}]
(\X-start)--(i-\X);
\ifnum\X>2
\draw[blue!50,dashed] (i-\X) to[out=160+3*\X,in=5] (\LastX-start);
\fi
}
\end{tikzpicture}
\end{document}


Or with somewhat more compelling arrows.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{matrix,intersections,calc}
\begin{document}
\begin{tikzpicture}[font=\sffamily]
\matrix (mat) [matrix of nodes,column sep=0.2cm,row sep=2mm,
nodes={align=left},nodes in empty cells,
row 1/.append style={nodes={font=\footnotesize\sffamily}},
]{
& 1 & 6 & 10 & 14 \\
& 1s & & & \\
& 2s & 2p & & \\
& 3s & 3p & 3d & \\
& 4s & 4p & 4d & 4f\\
& 5s & 5p & 5d & 5f\\
& 6s & 6p & 6d & \\
& 7s & 7p & 7d & \\
};
\path[name path=boundary] (mat-1-1.south) -- (mat-1-3.south)
to[bend right] (mat-2-4.south) to[bend left] ([xshift=6mm]mat-5-5.south)
-- (mat.south east);
\foreach \X [remember=\X as \LastX] in {2,...,10}
{\ifnum\X<8
\path[overlay,name path=\X-line]
($(mat-\X-2.south west)-0.1*($(mat-2-5.south west)- (mat-6-1.south west)$)$) coordinate(\X-start)
-- ++ ($5*($(mat-2-5.south west)- (mat-6-1.south west)$)$);
\else
\pgfmathtruncatemacro{\Xprime}{\X-6}
\path[overlay,name path=\X-line]
($(mat-8-\Xprime.south west)-0.1*($(mat-2-5.south west)- (mat-6-1.south west)$)$)
coordinate(\X-start) -- ++ ($5*($(mat-2-5.south west)- (mat-6-1.south west)$)$);
\fi
\draw[blue!50,latex-,shorten <=2pt,name intersections={of=\X-line and boundary,by=i-\X}]
(\X-start)--(i-\X);
\ifnum\X>2
\draw[blue!50,dashed,overlay]
let \p1=($(mat-2-5.south west)- (mat-6-1.south west)$),\n1={atan2(\y1,\x1)} in
(i-\X) to[out=\n1,in=180+\n1] (\LastX-start);
\fi
}
\end{tikzpicture}
\end{document}


• I should remember remember=\X as \LastX. – Sigur Feb 20 '19 at 22:21