Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

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

share|improve this question
    
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
2  
@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
1  
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
show 4 more comments

2 Answers

up vote 13 down vote accepted

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.

share|improve this answer
    
Thanks! This fixed it. I should have thought of it myself! –  Peter Smit Aug 27 '10 at 7:04
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.