4

When I write the following:

\documentclass[12pt,a4paper]{article} 
\begin{document}  

$$
-1, -2, -3, \dots \| -1 \|, \| -2 \|, \| -3 \|
$$

\end{document}  

It produces the following: Problem

As you can see, the negative signs are more closely coupled with the constants in the first three numbers, but this fails to be the case when surrounded by norm signs, which I find aesthetically displeasing. How can I fix this?

4
  • 3
    Don't use \| 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 (from mathtools) to define \norm{-1} or \norm[\Big]{-2} to get different sizes.
    – Manuel
    Commented Feb 25, 2016 at 2:09
  • Thanks, that fixes it. However, this problem doesn't arise when using ( 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.
    – cemulate
    Commented Feb 25, 2016 at 2:17
  • 3
    the parentheses are defined at the outset to be open and close atoms, as are other "naturally" paired delimiters. the vert bars have no "natural" orientation, so that must be indicated specifically when they are used as delimiters. Commented Feb 25, 2016 at 3:15
  • See Why is \[\] preferable to $$?
    – Werner
    Commented Feb 25, 2016 at 7:02

2 Answers 2

4

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.

enter image description here

\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}  
2

The minus sign sees the left delimiter as the first argument of a subtraction operation and sets the space as such. Enclosing the - in braces forces it to treat the minus as a unary operator (a negation on the following number). (Likewise, I could enclose the whole number in braces as \| {-1} \|)

\documentclass{article} 
\begin{document}  

\[
  -1, -2, -3, \dots \| {-}1 \|, \| {-}2 \|, \| {-}3 \|
\]

\end{document}  

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .