[Tex/LaTex] Resize vertical bars (absolute-value symbols)

math-modesymbols

I tried that \middle, \,\middle|\, and \mathrel{\Big|}. I read How to automatically scale `\mid` within delimiters and

\usepackage{mleftright}
\usepackage{amsmath}

\begin{document}

\begin{equation}
MASE = \frac{1}{n} \mathrel{\Big|} \sum_{i = 1}^{n} \hat{\Sigma}^{-1/2}\begin{pmatrix}
y_{ci} - \hat{y}_{ci}\\
y_{ri} - \hat{y}_{ri}
\end{pmatrix} \mathrel{\Big|},
\label{eq:mase}
\end{equation}

\end{document}

Best Answer

I believe you want the absolute value:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
\mathit{MASE} = \frac{1}{n}
\left|
  \sum_{i = 1}^{n} \hat{\Sigma}^{-1/2}
  \begin{pmatrix}
    y_{ci} - \hat{y}_{ci}\\
    y_{ri} - \hat{y}_{ri}
  \end{pmatrix}
\right|,
\label{eq:mase}
\end{equation}

\end{document}

enter image description here

I've often seen \mid misused as vertical bar; it indeed typesets a vertical bar, but considered as a binary relation.

For the absolute value you should use \lvert and \rvert, which can be abbreviated as \left| and \right| when automatic sizing is desired.