1
$\begingroup$

In MathJax, the cube root of a displayed fraction comes out like $$\sqrt[3]\frac ab .$$ Typographically, there are four things wrong with this. The main one is that the $3$ is too low. It should at the top of the surd symbol, not near the middle. Is there a workaround for this?

The other issues, which I do not expect a workaround for, are:

(1)$\;$ the $3$ is too small

(2)$\;$ the bottom of the surd symbol is too deep

(3)$\;$ the fraction symbols are not well balanced about the fraction bar (i.e. the fraction bar is too low)

(4)$\;$ the vinculum is redundant (of course, the \sqrt instruction calls for a vinculum, but there is no option to use the \surd instruction for a display fraction or with a pre-index).

$\endgroup$
4
  • $\begingroup$ Related: math.meta.stackexchange.com/questions/32988/… and math.meta.stackexchange.com/questions/32986/…. But I don't know what the root of the problem is. $\endgroup$
    – Asaf Karagila Mod
    Commented Jan 14, 2021 at 14:33
  • $\begingroup$ I've edited your post as I find that your points can be displayed better using the numbered list structure. $\endgroup$ Commented Jan 14, 2021 at 15:33
  • 2
    $\begingroup$ ;D There's always $$\left(\frac ab\right)^{\frac 13}$$ or $$\left(\frac ab\right)^{\Large\frac 13}$$ $\endgroup$
    – amWhy
    Commented Jan 14, 2021 at 20:00
  • 1
    $\begingroup$ @amWhy The section "fuzzy spacing issues" suggests that the use of fractions in subscripts/superscripts are "bad". Here's a table directed quoted from math.meta.stackexchange.com/a/5057/290189 $$\begin{array}{cc} \mathrm{Bad} & \mathrm{Better} \\ \hline \\ e^{i\frac{\pi}2} \quad e^{\frac{i\pi}2}& e^{i\pi/2} \\ \int_{-\frac\pi2}^\frac\pi2 \sin x\,dx & \int_{-\pi/2}^{\pi/2}\sin x\,dx \\ \end{array}$$ I would prefer using a Markdown table in the linked answer though, but that's another topic. $\endgroup$ Commented Jan 15, 2021 at 8:25

3 Answers 3

11
$\begingroup$

While there are certainly different philosophies about what is the most aesthetic typesetting layout, MathJax attempts to reproduce as closely as it can the results that you would get from actual $\rm\LaTeX$. It is certainly imperfect in that, but the measure of what is "correct" for MathJax output (on $\rm\LaTeX$ input) is actual $\rm\LaTeX$ output.

With that criterion, I would say all four of your complaints are incorrect.

Here is the $\rm\LaTeX$ output for your expression:

enter image description here

and this is the MathJax output in Firefox with HTML-CSS output (the results can vary across browsers and operative systems, and the CSS involved in the page).

enter image description here

While not identical, these are very close, and indicate that all the things you complain about are in the actual $\rm\LaTeX$ output, and MathJax is reproducing those properly. The main difference is actually in the font used for the "3" (not the size or vertical placement). $\rm\TeX$ uses different fonts for each of the text, script, and script-script sizes (the smaller sizes are a bit wider than the standard sized font), while MathJax uses scaled versions of the main text-sized font instead (to reduce the number of fonts that need to be sent over the network to your browser). There is also a slight horizontal position difference horizontally here, but not the vertical difference that you are looking for. That has to do with the fact that MathJax doesn't have all the internal information that $\rm\LaTeX$ does, so the positioning algorithm in MathJax is not actually the same as in $\rm\LaTeX$; some improvement may be possible there.

As for (2), the surds come in five fixes sizes, plus pieces that can be used to construct arbitrarily large ones when the content is larger than the largest available fixed size. When the content of the root is between two of the fixed sizes, the larger size is selected, and that surd is centered on the content. That may mean that the surd extends below the bottom of the fraction, as it does in this case. In the image below, I have put a red bounding box around the fraction and a green one around the root (and drawn the root in green as well, so it is easier to see the relationship between the red and green boxes). Note that the green is reasonably centered on the red.

enter image description here

As for your third point, the placement of the numerator and denominator are as in $\rm\TeX$. The reason it seems unbalanced to you is that the $a$ has no descender while the $b$ has an ascender. That does not mean the $a$ should be closer to the fraction bar. Because fractions may appear next to each other (when multiplied, for example), $\rm\TeX$ goes to great pains to make sure the baselines of the numerators and denominators of adjacent fractions are the same. That is,

$$\Large \frac{a}{b} + \frac{y}{z}$$

should have that $a$ and $y$ on the same baseline, and the $b$ and $z$ on the same baseline. So the fraction bar is not necessarily in the middle of the empty space between the actual "ink" of the numerator and denominator.

Finally, for your fourth point, $\rm\LaTeX$ uses the vinculum, as you point out, so MathJax does as well. I suppose you could do $$\sqrt[3]{\vphantom{\frac{a}{b}}}\frac{a}{b}$$, to get

$$\sqrt[3]{\vphantom{\frac{a}{b}}}\frac{a}{b}$$

but I wouldn't recommend it, as it will be less accessible to those with assistive technology.

The upshot is, the MathJax output correctly mirrors the $\rm\LaTeX$ output, as it is intended to. Your own choices are personal preferences, but they are not the choices that Donald Knuth made for $\rm\LaTeX$. To claim that they are not "typographically correct" is to disregard the fact that $\rm\LaTeX$ is a publishing industry standard, and has been for decades.

$\endgroup$
3
$\begingroup$

There is $\root{\displaystyle{3}}\of{\frac{a}{b}}$ that will make the $3$ larger:

$$\root{\displaystyle{3}}\of{\frac{a}{b}}.$$

Don't know if this substantially better. If your custom is to use the \sqrt[#1]{#2} construction instead of my preferred (straight from the $\TeX$book) \root{#1}\of{#2} that probably works too.

Undoubtedly other finetuning is also possible.


Experimenting with the \raise[n pt]{} construct:

\root{\raise2pt{\displaystyle{3}}}\of{\frac{a}{b}}

$$\root{\raise2pt{\displaystyle{3}}}\of{\frac{a}{b}},$$

\root{\raise4pt{3}}\of{\frac{a}{b}}

$$\root{\raise4pt{3}}\of{\frac{a}{b}}.$$

$\endgroup$
2
  • $\begingroup$ Normally the $3$ of a cube root is in sub/superscript size, but \displaystyle gives its normal in-line size. Exactly like the difference between \frac and \dfrac when typesetting fractions in-line. I'm fairly sure that extra 'd' stands for 'display'. It should be possible to specify a different font size (if one is available), but that becomes kludgier. Don't know how to lower/raise the surd, and that may have other side effects. I would not worry about it too much here. When producing a document I might dig deeper, or ask at Tex.SE- there are very competent people there :-) $\endgroup$ Commented Jan 14, 2021 at 17:02
  • $\begingroup$ Well, it's gone from $$\sqrt[?]{\frac ab}$$ (for those with poor eyesight) to a compressed version of $$3\sqrt{\frac ab}.$$ But anyway, the primary issue (which I can't illustrate) was the elevation of the $3$, not its size. $\endgroup$ Commented Jan 14, 2021 at 17:25
0
$\begingroup$

From robjohn's answer to a related question, I found a workaround that solved the main issue and the first of the secondary issues. Using $$\sqrt[\raise{7pt}\Large3]{\frac ab}$$, we get $$\sqrt[\raise{7pt}\Large3]{\frac ab}.$$

$\endgroup$
1
  • 4
    $\begingroup$ Good digging! (+1) That $3$ is too high for my taste, but if that's what you want :-). The box created by a displayed fraction is fairly tall, and the surd needs to cover that. I don't think it dips too low, but, degustibus non est disputandum. $\endgroup$ Commented Jan 14, 2021 at 22:10

You must log in to answer this question.

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