使用此代码块生成级别
\documentclass[]{article}
\usepackage{tikz}
\usepackage{pgf}
\usetikzlibrary{shapes.callouts}
\tikzset{
level/.style = { ultra thick, blue },
notice/.style = { draw, rectangle callout, callout relative pointer={#1} },
label/.style = { text width=2cm }
}
\usepgflibrary{shadings}
\begin{document}
\begin{tikzpicture}
% Draw all levels
\foreach \i/\j in {1h_{11/2}/4.5, 3s_{1/2}/4, 2d{3/2}/3.5} {
\draw[level] (6,\j) -- (8,\j) node[right] {\scriptsize $\i$};
}
\foreach \i/\j in {2d_{5/2}/2.5, 1g_{7/2}/2} {
\draw[level] (6,\j) -- (8,\j) node[right] {\scriptsize $\i$};
}
\foreach \i/\j in {1h_{11/2}/4.5, 3s_{1/2}/4, 2d{3/2}/3.5} {
\draw[level] (9,\j) -- (11,\j) node[right] {\scriptsize $\i$};
}
\foreach \i/\j in {2d_{5/2}/2.5, 1g_{7/2}/2} {
\draw[level] (9,\j) -- (11,\j) node[right] {\scriptsize $\i$};
}
% Draw labels
\node[label] at (9,0.5) {[$^{132}Sn$]};
\node[label] at (7.5,1.5) {Neutrons};
\node[label] at (10.5,1.5) {Protons};
\end{tikzpicture}
\end{document}