As you've discovered, the symbols generated by \vert
(equivalently: |
) and \Vert
(equivalently: \|
) have status "math-ordinary". Hence, TeX interprets the -
symbol as a binary operator, since the -
symbol is sandwiched between two symbols (\Vert
and a numeral) with status "math-ordinary". (This is, of course, the correct default behavior for expressions such as $a-b$
.) To get TeX to treat the -
symbol as a unary operator, it's advisable to use \lVert
and \rVert
, which have status "math-open" and "math-close", respectively, instead of just \Vert
.
Better still, define a LaTeX macro called, say, \norm
, which automatically uses the correct math status values for the opening and closing fences. In the code below, the macro \norm
is set up in such a way that \norm*
is defined as well; the latter lets the size of the "fences" grow automatically, as needed.
\documentclass[12pt,a4paper]{article}
\usepackage{mathtools} % for '\DeclarePairedDelimiter' macro
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}
\begin{document}
Original form:
$
-1, -2, -3, \dots, \| -1 \|, \| -2 \|, \| -3 \|
$
\medskip
Better:
$
-1, -2, -3, \dots, \lVert -1 \rVert, \lVert -2 \rVert, \lVert -3 \rVert
$
\medskip
Best:
$
-1, -2, -3, \dots, \norm{-1}, \norm{-2}, \norm{-3}
$
\end{document}
\|
on the wild.\|
on the wild is an ord atom, you need to ensure that the first\|
gets open atom, and the last one close atom. Use\lVert
and\rVert
, or\bigl\|
and\bigr\|
(or any other size,\Big(l|r)
,\bigg(l|r)
,\Bigg(l|r)
); or use\DeclarePairedDelimiter
(frommathtools
) to define\norm{-1}
or\norm[\Big]{-2}
to get different sizes.(
and)
, that is to say, I don't need to use\left(
and\right)
to avoid this issue. I'm curious why I have to use\lVert
and\rVert
here.\[
…\]
preferable to$$
?