Underbrace Looks Weird

69 views
Skip to first unread message

Andrew Murdza

unread,
Aug 6, 2022, 5:39:28 PM8/6/22
to MathJax Users
My underbraces look weird like here: https://github.com/mathjax/MathJax/issues/2466

I tried

<script> MathJax = { startup: { ready() { if (MathJax.version === '3.0.5') { const SVGWrapper = MathJax._.output.svg.Wrapper.SVGWrapper; const CommonWrapper = SVGWrapper.prototype.__proto__; SVGWrapper.prototype.unicodeChars = function (text, variant) { if (!variant) variant = this.variant || 'normal'; return CommonWrapper.unicodeChars.call(this, text, variant); } } MathJax.startup.defaultReady(); } } }; </script> 

as suggested in https://github.com/mathjax/MathJax/issues/2402 but it didn't help. 

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" id="MathJax-script" async
</script>
    <link rel="stylesheet" href="test.css">
</head>

<body>
  $$\underbrace{\text{hiiiiiiii}}$$
</body>
</html>

test.css
body {
    font-size: 30px;
  }

with "https://cdn.jsdelivr.net/npm/mat...@3.0.0/es5/tex-chtml.js" there is still an issue. When I use src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.0.0/es5/tex-svg.js" instead, the underbrace looks correct but it messes with the CSS (I got rid of the CSS for the minimal example but I have other CSS that affects Mathjax) and I don't like the way things look. Changing the font size to 20px also fixes the issue but I want the font size to be 30px.

How can I fix this issue?

Davide Cervone

unread,
Aug 8, 2022, 10:09:21 AM8/8/22
to mathja...@googlegroups.com
Such issue tend to be browser-specific, but you have not indicated the browser or OS that you are using, so it is difficult to duplicate the result.

The configuration that you took from issue #2466 was for version 3.0.5, but you re using the generic version 3, so should be getting 3.2.2.  Note that the code is within an if-then statement that only runs if you are using version 3.0.5, so the configuration would do nothing in your case.  Furthermore, it is a fix for the SVG output, but you are using CHTML output, so it probably would have crashed in any case (since the SVG output jax is not loaded in your page).

Switching from tex-mml-chtml to tex-chtml would not change the output, since both use the same CommonHTML output jax.

You say that you don't care for the SVG output because "it messes with the CSS", but it is not clear what you mean by that, and that you "have other CSS that affects Mathjax", but don't say in what way.  Perhaps it could be made to work with SVG.

Finally, as you have found out, these issues are often sensitive top the font-size and zoom level of the browser.  You note that at 20px it works, but at 30px it doesn't.  Perhaps 29px or 31px would work, and that would be sufficient for you?

In any case, the next release will include an update to the fonts, and I'm hoping that will resolve the issues like this.

Davide


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mathjax-users/3d067a58-f413-45a7-ba7c-a1bf6c51dd44n%40googlegroups.com.

Andrew Murdza

unread,
Aug 21, 2022, 2:46:22 AM8/21/22
to MathJax Users
Ok, I will wait for that update.

I actually decided to try going back to 2.7 in order to use automatic line breaks and it fixed the brackets issue (I really need automatic line breaks because I want this website to work on both mobile phones and computers which have very different screen sizes)

Davide Cervone

unread,
Aug 22, 2022, 10:55:28 AM8/22/22
to mathja...@googlegroups.com
FYI, Automatic line breaking will be included in the next release.

Davide


Reply all
Reply to author
Forward
0 new messages