2

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}
7
  • Try with \biggl ( and biggr ) ...
    – juanuni
    Jun 4, 2015 at 2:17
  • @juanuni Well, it makes the parenthesis larger, but that's not beautiful either...
    – anderstood
    Jun 4, 2015 at 2:19
  • 2
    Beatiful concept is subjetive ...
    – juanuni
    Jun 4, 2015 at 2:31
  • 4
    WIthout knowing the specific context in wihich you intend to use the fractions, I would probably go with either f(r/h) or f(\tfrac{r}{h}). Jun 4, 2015 at 4:23
  • 3
    the main reason it looks odd is that you are using the display fraction in inline math so generating excessive space, why not \frac rather than \dfrac Jun 4, 2015 at 8:22

2 Answers 2

8

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.

5
  • But don't you find it strange that the space between the $r$ and the fraction bar is larger than the one between $h$ and the fraction bar, in the left-hand side? I suppose the bar is in the middle of the upper and lower baseline though... But still I'm not convinced.
    – anderstood
    Jun 4, 2015 at 2:29
  • 1
    @anderstood This is the "displayed" version of the fraction without decreased size and more vertical space (for indices, ...). Also r is a small letter, With \vphantom{h}, the parentheses would probably look more symmetrical, but would also be larger. Jun 4, 2015 at 2:39
  • Maybe you can controle the vertical space with \smash command.
    – juanuni
    Jun 4, 2015 at 2:52
  • 3
    Per ftp.ams.org/pub/author-info/documentation/howto/mit-2.pdf for in-line text usage f(r/h) is preferred and for display either the previous form or use one of f\mleft(\frac{r}{h}\mright) or f(\tfrac{r}{h}). The priority guideline for choice is clarity for the reader and not beauty. Jun 4, 2015 at 3:02
  • @R.Schumacher Concerning the last sentence: sure, but I consider all the suggestions as equality clear. Anyway, you all agree on that point: keep the default vertical space when using $\frac$ or its variants.
    – anderstood
    Jun 4, 2015 at 14:44
3

The solution I adopt is usually to use \mfrac (medium-sized fractions, ~80% of displaystyle), from nccmath:

 \documentclass[a4paper, 11pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts, amssymb}
\usepackage{nccmath}

\usepackage{mathtools}

\begin{document}

\verb+With \dfrac:+\enspace Text text text text text text $f\Bigl(\dfrac{r}{h}\Bigr)$ more text more text more text more text more text more text more text more text…\medskip

\verb+With \mfrac:+\enspace Text text text text text text $f\bigl(\mfrac{r}{h}\bigr)$ more text more text more text more text more text more text more text more text…\medskip

\verb+With \frac:+\enspace Text text text text text text $f(\frac{r}{h})$ more text more text more text more text more text more text more text more text…
\end{document} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .