[Tex/LaTex] How to make this simple expression $f(\dfrac{r}{h})$ look nice

fractionsmath-mode

How to make this very simple expression nice?

enter image description here

I am not convinced by the parenthesis and the vertical spaces among the fraction. Feel free to share how you would have written it.

\documentclass[]{article}
\usepackage{amsmath}
\usepackage{nicefrac}

\begin{document}
\thispagestyle{empty}
\begin{equation*}
f\big(\,\dfrac{r}{h}\,\big)\quad f\Big(\,\dfrac{r}{h}\,\Big) \quad f\left(\,\dfrac{r}{h}\,\right) \quad f\big(\,\cfrac{r}{h}\,\big)
\end{equation*}
\end{document}

Best Answer

The additional spaces look odd to me. I would not add spaces in the inside. The spaces by \left and \right can be removed by using \mleft and \mright of package mleftright.

Depending on the remaining part of the equation or the other equations, \tfrac might be an option. Then the parentheses do not need to be enlarged.

Also the slash variant for the division can be used here instead of the fraction. You have loaded package nicefrac. The following example also shows the \nicefrac version:

\documentclass[]{article}
\usepackage{amsmath}
\usepackage{mleftright}
\usepackage{nicefrac}

\begin{document}
\thispagestyle{empty}
\begin{equation*}
  f\mleft(\frac{r}{h}\mright) = f(\tfrac{r}{h})
  = f(r/h) = f(\nicefrac{r}{h})
\end{equation*}
\end{document}

Result

Of course the placement of the numerator can also be "optimized" by hand using \raisebox to lower the numerator. But, IMHO, it only optimizes the lookout of one combination of symbols. Symbols with descenders or subscripts will then have different base lines, which look worse:

\documentclass[]{article}
\usepackage{amsmath}
\usepackage{mleftright}

\begin{document}
\[
   f\mleft( \frac{\raisebox{-2pt}{$r$}}{h} \mright) \neq
   f\mleft( \frac{\raisebox{-2pt}{$g$}}{h} \mright) \neq
   f\mleft( \frac{\raisebox{-2pt}{$r_g$}}{h} \mright)
\]
\end{document}

Result

IMHO, the reader will benefit much more, when the available time is used more to improve the mathematics and their explanation in the text.