# Why is there a space in this equation

I have the following equation: $\|\text{DFT}\left( f_t (n) \right)\|^2$ ()

This equation is rendered with a space before the second $\|$. Why is this and how can I fix it?

-
It seems latex processing isn't working. Did I do something wrong? –  Peter Smit Aug 27 '10 at 6:27
Could you try \providecommand\norm[1]{\lVert#1\rVert}? –  Leo Liu Aug 27 '10 at 6:53
@Leo I like to try things, but only if I understand what it does. Where should I put that, and what should it solve? –  Peter Smit Aug 27 '10 at 7:03
@Peter Smith: What Leo is suggesting is basically what I answered below. \lVert and \rVert are basically the same as \left\| and \right\|. You put his code into the preamble and use $\norm{\text{DFT}\left( f_t (n) \right)}^2$. "\providecommand" is like "\newcommand", so his code defines a new command named "\norm". It will save you typing if you need to use the same norm several times. It will also make your life much easier if you ever decide to use |...| or say ||...||_p for norm instead. You will only need to change one place. –  Jan Hlavacek Aug 27 '10 at 11:40
I would also suggest that you place \DeclareMathOperator\DFT{DFT} in your preamble, and use \DFT\left(f_t(n)\right) instead of \text{DFT}\left(... (I am assuming that you use the amsmath package, since you use \text.) –  Jan Hlavacek Aug 27 '10 at 11:49

Use $\left\|\text{DFT}\left( f_t (n) \right)\right\|^2$. Otherwise LaTeX does not know that the first \| is supposed to be a left delimiter and the second \| a right one.

-
Thanks! This fixed it. I should have thought of it myself! –  Peter Smit Aug 27 '10 at 7:04

This is due to some weird design choices by Knuth. Notice that there's also an extra space after \text{DFT}. They are produced because \left and \right follow different spacing rules.

To obtain the expected spacing, use

$\|\text{DFT}\mathopen{}\left( f_t (n) \right)\mathclose{}\|^2$


For a more complete discussion, see this answer.

-