# How to get rid of the space in between name of the function and the parenthesis e.g. in $f\left(\frac{1}{x}\right)$? [duplicate]

I want to get rid of the space between name of the function and the parenthesis argument as in $$f\left(\frac{1}{x}\right)$$.

This space feels unnatural to me. I know a solution to get around this but I am not satisfied with it.

\DeclareMathOperator{\f}{f}
\f\left(\frac{1}{x}\right)


This renders $$\DeclareMathOperator{\f}{f}\f\left(\frac{1}{x}\right)$$. Notice the space is removed but $$f$$ is changed to $$\f$$.

How to get rid of the space while maintaining the $$f$$ in this font?

I am not nitpick; I don't want to use $$f$$ in a different font to keep my answers consistent with original posts.

• This is a "fussy spacing issue", and should have been covered in the MathJax guide. I have added it to this answer.
– Xander Henderson Mod
Commented Apr 10 at 12:31
• I don't understand the downvotes... My question isn't opinion based, so what's the disagreement? IMO, it's an important question and it was not covered in the MathJax guide at the time I posted this... Commented Apr 11 at 10:34
• Just a guess, probably some users don't feel the extra space as a problem and hence they don't agree to your proposal.
– Paramanand Singh Mod
Commented Apr 12 at 6:30

You may try the negative spacing operator \!  like $f\! \left(\frac{1}{x}\right)$ to get $$f\! \left(\frac{1}{x}\right)$$.

However I think the extra space is due to left right commands and they are needed to resize the parentheses based on their argument. Without left right like $f(x)$ we get $$f(x)$$.

$$f(x)$$ $$f(\frac1{x})$$ $$f\left(\frac1{x}\right)$$ $$f\LARGE{(\small{\frac1{x}}\Large)}$$ $$\vcenter{\Large{f}}\Huge{({\vcenter{\small{\frac1{x}}}}\Huge)}$$

$$f(\frac1{x})$$
$$f\left(\frac1{x}\right)$$
$$f\LARGE{(\small{\frac1{x}}\Large)}$$
$$\vcenter{\Large{f}}\Huge{({\vcenter{\small{\frac1{x}}}}\Huge)}$$


Also, see the Stack Exchange Meta article: "Changing mathjax's font size"

• I don't understand the inconsistent use of \Large. That looks even worse. Commented Apr 10 at 8:49
• @Nothingspecial: Click on the link to Changing mathjax's font size. The strategy is to recognize that simple parenthesis like $f(x)$ do not have extra space. But for $f(\frac1{x})$, the only difficulty is that the parenthesis are too small. So, following the link, the parenthesis size is adjusted using \LARGE{(...)} as $\LARGE{(...)}$ . From the link, the could be increased even more using \Huge(...)} as in $\Huge{(...)}$. But then the inside fraction needs to be set small so it fits. Commented Apr 10 at 8:59
• The inside fraction does not need to be set small to fit, e.g. \Large f\!\left(\frac{1}{x}\right) is typeset as $$\Large f\!\left(\frac{1}{x}\right).$$ Or write \Large f\!\left(\tfrac{1}{x}\right) to get $$\Large f\!\left(\tfrac{1}{x}\right).$$
– Xander Henderson Mod
Commented Apr 10 at 12:25