3

Why does f\left(x\right) result in more space before the ( than f{\left(x\right)}?

i.e. Why does putting extra braces suppress the space?

yo'
  • 51,322
user541686
  • 9,547
  • I'm not sure why it does that but for your particular example, you should just use f(x). – Svend Tveskæg Feb 23 '14 at 21:56
  • @SvendTveskæg: That comment completely missed the point of my question. – user541686 Feb 23 '14 at 21:57
  • With the braces, the mathematical properties (\mathrel, \mathop, etc.) of the parens are lost outside the braces. Similar to $a - b$ versus $a {- b}$. – Steven B. Segletes Feb 23 '14 at 21:57
  • I did not know that! Would you mind please posting those as answers? – user541686 Feb 23 '14 at 21:58
  • @Mehrdad Svend's comment is right: you shouldn't be using \left and \right there. – egreg Feb 23 '14 at 22:02
  • @egreg: Do you really think my ultimate goal here was to produce a document saying "f(x)"? Or do you think I distilled something more complicated into a simpler example to make the problem easier to understand for you? – user541686 Feb 23 '14 at 22:03
  • related: http://tex.stackexchange.com/questions/104004/xy2-or-xy2 – jub0bs Feb 23 '14 at 22:04
  • You should only use \left/\right contructions if they'll change soemthing for the better. Here, it only adds unnecessary horizontal space. – Svend Tveskæg Feb 23 '14 at 22:06
  • 3
    @Mehrdad I don't think that typing $f\left(\frac{1}{2}\right)$ would have been so far from minimal and it would have better explained the issue. Why are you taking it so personally? – egreg Feb 23 '14 at 22:16
  • 2
    @Mehrdad I think you actually missed the point of the comments, which is, in fact, comment. If someone asks why {\it sniff} and cry eats some space between sniff and and he will probably get some comments asking why isn't he using \textit{sniff} (which, in my opinion, are beneficial), rather than explaining the italic correction (that would probably be an answer). In short: “I really freaking hate* comments like yours*”. – Manuel Feb 23 '14 at 22:27

1 Answers1

4

\left and \right create a "inner formula" with additional spaces around except in scriptsize or smaller or after an opening delimiter or before a closing delimiter. The curly braces put the inner formula into a sub formula with the same spacing rules as an ordinary math atom (\mathord).

See package mleftright, if you want a solution without additional spacing:

\documentclass{article}
\usepackage{mleftright}
\begin{document}
\[
  f \left(\frac xy\right) g =
  f {\left(\frac xy\right)} g =
  f \mleft(\frac xy\mright) g
\]
\end{document}

Result

Heiko Oberdiek
  • 271,626