#3605·MathJax

Radical is not stretched to its radicand when \dfrac restores display style inside a scaled context

Author: terragonaCreated Aug 27, 2026Updated Aug 27, 2026
LabelsCannot Reproducev4

Issue Summary

When a \sqrt / \sqrt[n] sits in a script-level (scaled) context and its radicand contains a \dfrac (or \displaystyle), the radical sign is stretched for the scaled height, but the radicand is rendered back at full size. The radical then overlaps its own content.

The nesting that triggers it is \dfrac\frac\dfrac, i.e. the radical has to end up two levels down so that it is laid out at script level, while the \dfrac inside it restores display style.

Reproduced on Windows 11 with Chromium 149 and with Node 22 (liteAdaptor), in both SVG and CHTML output.

Steps to Reproduce:

  1. Typeset the following expression in display mode:

    tex
    \dfrac{a}{\frac{\sqrt{\dfrac{1}{2}}}{3}}
  2. Look at the radical sign and the fraction inside it.

  3. The radical is roughly 30 % too short — its top bar cuts through the numerator of the inner \dfrac instead of sitting above it.

Expected: the radical is stretched to cover its radicand, as it is at top level.

Actual: the radical is stretched to the height the radicand would have at the surrounding script level. Because \dfrac restores display style, the radicand is drawn about 1.414× taller than that, so the two overlap.

Why I consider this a bug: the same radicand renders correctly when the radical is not in a scaled context, so the radical's stretch target is evidently computed before the inner mstyle script-level reset is taken into account.

Cases that do reproduce (radical scale vs. radicand scale, from the generated SVG):

TeX radical radicand
\dfrac{a}{\frac{\sqrt{\dfrac{1}{2}}}{3}} 0.707 1.000
\dfrac{a}{\frac{\sqrt[3]{\dfrac{233}{33}}}{323}} 0.707 1.000

Both msqrt and mroot are affected.

Cases that do not reproduce (one nesting level is not enough):

TeX radical radicand
\sqrt{\dfrac{1}{2}} 1.000 1.000
\frac{\sqrt{\dfrac{1}{2}}}{3} 1.000 1.000
\dfrac{\sqrt{\dfrac{1}{2}}}{3} 1.000 1.000

Technical details:

  • MathJax Version: 4.1.3 (@mathjax/src 4.1.3, @mathjax/mathjax-newcm-font 4.1.3)
  • Client OS: Windows 11 (also reproduced headless on Node 22)
  • Browser: Chromium 149.0.7827.55

I am using the following MathJax configuration:

javascript
MathJax = {
  loader: { load: ['[tex]/ams'] },
  tex: { packages: { '[+]': ['ams'] } },
  svg: { fontCache: 'local' },
  startup: { typeset: false },
};