tl;dr– Looks like the core problem is MathJax inappropriately applying a size-modifier to the implicit √
-character that it uses to render the radical. The trick to avoiding this problem would be ensuring that the implicit √
-character doesn't have a non-default size-modifier applied to it, either by avoiding applying one or else by shielding it with \normalsize
.
Looks like a rendering bug.
The problem appears to be specific to \sqrt
having a non-standard size-modifier, e.g. \Huge
.
Examples:
We can copy/paste the MathJax-rendered expression to see that it uses the √
character at the start of the radical. It seems like the rendering would be correct if √
were rendered at the default-size, \normalsize
, but applying another size-modifier to it messes it up.
My guess is that this is a bug coming from the size-modifier inappropriately applying to the √
-character at the start of the radical. Presumably the folks maintaining MathJax could fix this by having the √
-character in the radical not react to a size-modifier as normal-text.
Work-around.
As a partial work-around, we can define
\def\Sqrt#1{{\normalsize{\sqrt{#1}}}}
, then use \Sqrt
instead of \sqrt
.
For example:
\def\Sqrt#1{{\normalsize{\sqrt{#1}}}}
\Sqrt{\Huge \text{Nested} \Sqrt {\Huge \text{root} \Sqrt{\Huge \text{problem}}}}
renders as
$$
\def\Sqrt#1{{\normalsize{\sqrt{#1}}}}
\Sqrt{\Huge \text{Nested} \Sqrt {\Huge \text{root} \Sqrt{\Huge \text{problem}}}}
$$
The drawback to putting \normalsize
before \sqrt
is that it strips out the external-size-modifier for the internal-content as well as the radical, requiring \Huge
to be written several times above. If not for the apparent bug, then
\Huge \sqrt{\text{Nested} \sqrt{\text{root} \sqrt{\text{problem}}}}
could be sufficient, though it currently renders as:
$$
\Huge \sqrt{\text{Nested} \sqrt{\text{root} \sqrt{\text{problem}}}}
$$
.
Clarification: Why does it appear to be a bug with respect to √
?
This answer's tl;dr begins with:
Looks like the core problem is MathJax inappropriately applying a size-modifier to the implicit √
-character that it uses to render the radical.
@DavideCervone commented:
The problem is not with the scaling of the surds, but with the placement of the overlies. This is a bug in the HTML-CSS output, but changing to CommonHTML or SVG will produce the desired results.
@DavideCervone's comment points out the apparent situation while I'm suspicious it may be something else, so figured it'd be good to clarify the apparent discrepancy.
First, to acknowledge the point: if we look at something like
$$
{\boxed{
\Huge \sqrt{\text{Nested} \sqrt{\text{root} \sqrt{\text{problem}}}}
}}_{,}
$$
then the most obviously wrong part appears to be the line through the top of $`` \text{problem} " ,$ rather than anything directly with a √
-character. I agree with this observation.
That said, my guess is that that apparent problem is downstream of the actual bug. I'd speculate that it's one of those situations where someone over-corrected for a bug downstream of where it occurred, causing a secondary problem. So, it'd probably be best to address the primary problem first, then revert the buggy downstream over-reaction to the primary problem.
To clarify, I'd suggest looking at this rendered in both HTML-CSS
and Common HTML
:
$$
{\boxed{
\Huge{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{
\color{red}{
\sqrt{\rule{1em}{1em}}
}
}}}}}}}}}}
}}_{.}
$$
Observations:
In Common HTML
, this mostly looks about right. Most of the problems are confined to HTML-CSS
.
- So, I'd suggest
Common HTML
as a known-good(-ish) viewer as we look into HTML-CSS
.
Regarding $\boxed{\color{red}{\sqrt{\rule{1em}{1em}}}} :$
In Common HTML
, the radical hugs pretty tightly.
In HTML-CSS
, the radical is looser. The overall structure is larger, with a weaker wrapping around the content within the radical.
Regarding the largest √
's at the start of the expression:
In Common HTML
, they appear mostly consistent.
In HTML-CSS
, they become fractured, with both vertical and horizontal display errors.
So, here's my speculation about what happened:
The HTML-CSS
-rendering code applies a size-modifier to text, as generally desired.
- For example,
\Huge{xyz}
applies the \Huge{}
-modifier to the graphical elements for x
, y
, and z
.
The HTML-CSS
-rendering code applies a size-modifier to other graphical elements, too, as generally desired.
The HTML-CSS
-rendering code constructed the \sqrt
-graphical-element under the principle of being non-textual...
...except (and this is my guess!), the code accidentally considered the √
-character as a textual element, sizing it up as such even though it should've already been sized up as a non-textual-element, causing inappropriate, excessive sizing-up.
Someone realized that there was a bug, but instead of fixing the root-issue, they tried to counteract it with a counter-balancing size-reduction transform. I speculate that this is why, for example, the radical's line strikes-through $`` \text{problem} "$ in an above example.
If my guess is correct, then these things should be observable:
The HTML-CSS
-renderer should have the radical more over-sized than in the Common HTML
-rendered.
- Which is the case, most notably in the loose-wrapping in the inner-most radical above. Can also be seen if the same large-radicals are rendered in both renderers, then overlaid via copy/paste with transparency.
There should be other graphical counteractions apparent in the HTML-CSS
-rendering.
- Which is the case, most notably in the outer-most radicals shown above.
As a practical fix for the MathJax maintainers:
Check if the √
-character is indeed getting double-sized-up: once due to being a structural-element and once due to being a text-element.
If so, remove one of those sizing-ups, even if it makes the rendering look even worse.
Then, track down all of the counteractions, and perhaps remove those, too, if they can't be remediated. Go for simplistic right now.
Once the root problem and its related counteractions are removed, the rendering should look decent-ish (even if odd) and the code-design should be relatively simple (since less should be happening).
Then add in the touch-ups and transforms to get it looking more stylish.
Hard to be sure that this is necessary the problem/solution without looking at the code and such, but this'd be my guess. I hope the observations help to communicate ways in which the renderings would seem to reflect this hypothesized issue.
\large
,\Large
,\Huge
and similar things are switches: the text is affected from that point onwards. Comparesome writing \textbf{in bold} now normal
withsome writing \bfseries{in bold} now normal
for another example of a switch. Same for fonts like\upshape
,\rmfamily
, etc. Aside: one should use\itshape
/\rmfamily
/etc
rather than\it
/\rm
/etc
$\endgroup$