1

If one uses \left( and \right) to set functions an extra space is created between the function name and the brackets. How does one correctly set functions?

Here is an example:

\documentclass{article}

\begin{document}
  Compare \[f(\frac{1}{2})\] and \[f\left(\frac{1}{2}\right)\].
\end{document}

Edit

Here is a (probably too easy) solution by using a negative space:

f\!\left(\frac{1}{2}\right)
Daniel
  • 1,787
  • 1
    How is this really different from your other question http://tex.stackexchange.com/questions/309829/how-to-correctly-set-functions-using-left-and-right, which was closed as duplicate? –  May 16 '16 at 12:28
  • Note if you think the closed question isn't a duplicate, you can edit it and it may be re-opened, please don't just re-ask the same question – David Carlisle May 16 '16 at 12:31
  • I did for a while. But it wasn't changed. So I opened another question. Notice also that the content is different. – Daniel May 16 '16 at 12:39
  • 1
    I did not close the other question as a duplicate and don't agree that it is. The answer to my question here is also evidence that it is not. – Daniel May 16 '16 at 12:45
  • Daniel the answer here could apply to the older questions too I don't see anything different here really? – David Carlisle May 16 '16 at 14:12
  • David, Agreed. So just remove the duplicate reference in this question to the other question so I can delete the other and all can be happy. – Daniel May 16 '16 at 15:49

1 Answers1

4

\mleft and \mright of package mleftright avoid the additional space. Also often a slightly smaller version can be set manually improving the output. In this case, I would reduce the size of the fraction.

\documentclass{article}
\usepackage{mleftright}

\begin{document}
  Compare: \[f(\frac{1}{2})\]
  \[f\left(\frac{1}{2}\right)\]
  \[f\mleft(\frac{1}{2}\mright)\]
  \[f\Bigl(\frac{1}{2}\Bigr)\]
  \[f\mleft(\tfrac{1}{2}\mright)\]
\end{document}

Result

Heiko Oberdiek
  • 271,626
  • Great. Thanks a lot. Yes, I see how the space is better with \mleft and \mright. It seems still a bit further away. But I guess that is as good as it get without manually fiddling with the spaces, right? – Daniel May 16 '16 at 12:43
  • 1
    @Daniel The larger parentheses also have larger side bearings. – Heiko Oberdiek May 16 '16 at 12:50
  • I see. But it just looks so slight that it should not make such a big difference. Well, I guess anyway, it is the best one gets. – Daniel May 16 '16 at 13:06