# ULdepth does not change space in equation

I am trying to underline a result within an equation environment. The result contains a Matrix. I use the ulem package with uline.

How can I add more space between my matrix and the line?

I tried ULdepth which did not change the space between my matrix and the line.

Code example:

\documentclass{scrartcl)
\usepackage{mathtools}
\usepackage{ulem}
\setlength{\ULdepth}{20pt}

\begin{document}
\begin{equation*}
\uline{A \cdot B =%
\begin{bmatrix*}[r]
6 & -12 \\
14 & 4
\end{bmatrix*}}
\end{equation*}

\end{document}


Thank you very much!

You can always \addstackgap befor ethe \uline. Here, macrofied as

\Uline[<extra depth>]{<math content>}.

\documentclass{scrartcl}
\usepackage{mathtools,stackengine}
\usepackage{ulem}
\setlength{\ULdepth}{20pt}
\begin{document}
\begin{equation*}
\Uline{A \cdot B =%
\begin{bmatrix*}[r]
6 & -12 \\
14 & 4
\Uline[6pt]{A \cdot B =%
\begin{bmatrix*}[r]
6 & -12 \\
14 & 4
\end{bmatrix*}}
\end{equation*}
\end{document}


Note: the argument to \Uline will be set in \textstyle unless \displaystyle is explicitly invoked (though I could automate it, were it vital to the answer).

\documentclass{scrartcl}
\usepackage{mathtools}
\usepackage{ulem}
\setlength\ULdepth{20pt}
\begin{document}
\begin{equation*}
\uline{A \cdot B =
\begin{bmatrix*}[r]
6 & -12 \\
14 & 4
\end{bmatrix*}\rule[-15pt]{0pt}{0pt}}
\end{equation*}

\end{document}


The definition of \uline is

% ulem.sty, line 43:
\def\uline{\relax \ifmmode\expandafter\underline
\else \bgroup\expandafter\ULset\fi}


Thus you see that in math mode, the result is the same as for \underline.

\documentclass{scrartcl}

\usepackage{mathtools}
\usepackage{array,booktabs}

\begin{document}

\begin{equation*}
\begin{array}{@{}>{\displaystyle}c@{}}
A\cdot B=
\begin{bmatrix*}[r]
6 & -12 \\
14 & 4
\end{bmatrix*}
\\