[Tex/LaTex] Bold math inside of absolute value gives error

boldmath-mode

This code

\begin{equation}
  \label{eq:test}
  | \mathbf{v} |
\end{equation}

gives me the error:

ERROR: LaTeX Error: \mathbf allowed only in math mode.

--- TeX said ---

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.430   | \mathbf
                 {v} |

My question is simply why? Is not equation math mode??

Best Answer

You already know that many packages redefine |. Thus I usually recommend using amsmath and its commands \lvert and \rvert for left and right pipe delimiters. Besides protection against redefinition of |, this also makes better spacing when | is indeed a delimiter.