Amsmath and mathtools provides two macros to label terms of an equation:
\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amsfonts}
\newcommand{\E}[3][]{\mathbb{\operatorname{E}}_{#2}#1[#3#1]}
\newcommand{\KL}[2]{D_\mathrm{\operatorname{KL}}[#1\;\|\;#2]}
\begin{document}
\begin{align}
\underbrace{\E{q_\phi(\theta)}{\ln p(\mathcal{D}|\theta)}}_\text{expected likelihood}
-\underbrace{\KL{q_\phi(\theta)}{p(\theta)}}_\text{complexity} \\
\underbracket{\E{q_\phi(\theta)}{\ln p(\mathcal{D}|\theta)}}_\text{expected likelihood}
-\underbracket{\KL{q_\phi(\theta)}{p(\theta)}}_\text{complexity}
\end{align}
\end{document}
I'd like to get this behavior, except that the brace or bracket is just a thick straight line. Is this possible using these or other packages?