overline vs MathJax3 chtml

85 views
Skip to first unread message

Rob Beezer

unread,
Jun 9, 2021, 3:06:29 PM6/9/21
to pretext...@googlegroups.com
(Copying from the dead "mathbook-xml-support" list)

Not sure if anybody else is having issues with "\overline" just not showing up
now that mathjax was upgraded to v3 (at least that's what I'm blaming it on). I
noticed that if I switch to the tex-svg.js MathJax output (by editting the html
files), overlines show up again.

I couldn't really find anyone else noticing this via a quick google search, so I
submitted a mathjax issue on this, we'll see what they say. Perhaps it's just
my particular browser (chrome on linux) or some other issue?

Best,

Jiri

Rob Beezer

unread,
Jun 9, 2021, 3:14:15 PM6/9/21
to pretext...@googlegroups.com
On 6/9/21 12:06 PM, Rob Beezer wrote:
> Not sure if anybody else is having issues with "\overline" just not showing up
> now that mathjax was upgraded to v3 (at least that's what I'm blaming it on).  I
> noticed that if I switch to the tex-svg.js MathJax output (by editting the html
> files), overlines show up again.

Added:

<m>\overline{f}(x)</m>

into the sample article. Looks fine to me with (reasonably) new Firefox and
Chrome on Ubuntu 20.04.

Rob

Jason Diemer

unread,
Jun 9, 2021, 4:46:13 PM6/9/21
to PreTeXt support
I've been having trouble with this.  I'm a newb, so it is a relief to see that it might not be something I'm doing wrong.

The problem arises when rendering as CHTML.  No issues with SVG (newb question: can I force SVG rendering by default?)

Here is an image at 100% zoom in firefox.
Screenshot from 2021-06-09 13-39-45.png
Here is the same, at 110% zoom.
Screenshot from 2021-06-09 13-40-22.png

Rob Beezer

unread,
Jun 9, 2021, 5:03:40 PM6/9/21
to pretext...@googlegroups.com
Dear Jason,

Thanks very much for confirming this with an informative report.

Wild speculation: I wonder if our 88% scale (discussed elsewhere just recently)
is making that line so thin that it is not visible?

I'll get to some experimentation in a bit, if nobody else beats me to it.

At the moment, there is no way to force the SVG rendering. Once we understand
this one, we'll see what our options are.

@Jiri - do you have a pointer to your MathJax post? I don't think I saw it on
"mathjax-users".

Rob

On 6/9/21 1:46 PM, Jason Diemer wrote:
> I've been having trouble with this.  I'm a newb, so it is a relief to see that
> it might not be something I'm doing wrong.
>
> The problem arises when rendering as CHTML.  No issues with SVG (newb question:
> can I force SVG rendering by default?)
>
> Here is an image at 100% zoom in firefox.
> Screenshot from 2021-06-09 13-39-45.png
> Here is the same, at 110% zoom.
> Screenshot from 2021-06-09 13-40-22.png
> On Wednesday, June 9, 2021 at 12:06:29 PM UTC-7 Rob Beezer wrote:
>
> (Copying from the dead "mathbook-xml-support" list)
>
> Not sure if anybody else is having issues with "\overline" just not showing up
> now that mathjax was upgraded to v3 (at least that's what I'm blaming it on). I
> noticed that if I switch to the tex-svg.js MathJax output (by editting the html
> files), overlines show up again.
>
> I couldn't really find anyone else noticing this via a quick google search,
> so I
> submitted a mathjax issue on this, we'll see what they say. Perhaps it's just
> my particular browser (chrome on linux) or some other issue?
>
> Best,
>
> Jiri
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-suppo...@googlegroups.com
> <mailto:pretext-suppo...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/c4493dbf-1deb-46cf-a49a-37fa26c724d3n%40googlegroups.com
> <https://groups.google.com/d/msgid/pretext-support/c4493dbf-1deb-46cf-a49a-37fa26c724d3n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Jiří Lebl

unread,
Jun 9, 2021, 5:29:33 PM6/9/21
to PreTeXt support
I posted it as an issue on mathjax github: https://github.com/mathjax/MathJax/issues/2701

Firefox seems to be fine.  Apparently MacOS Chrome is fine, but that's just what one person said.  Also weird is that zooming in and out might make the overline appear or disappear as was noticed above.  It seems to me as if something is cropping the text.

I've now switched everything on my site to SVG rendering just to be sure.  I'm thinking svg ought to be more robust in terms of browser bugs than a soup of css and html, but that's just a total guess.

For a very simple test page to see if it really is an issue try: https://www.jirka.org/badmj.html

Best,

Jiri

Jiří Lebl

unread,
Jun 9, 2021, 5:46:00 PM6/9/21
to PreTeXt support
I just noticed I did forget to address a couple of your points.  Doubt it is the 88% scale, since it appears on vanilla mathjax v3 setup.  (v2 does not have the issue).  But zooming does make the problem appear and disappear so it is not totally irrelevant.

My way of forcing SVG is to just modify the perl script that "fine tunes" the html that xsltproc spits out to just replace tex-chtml.js to tex-svg.js :)  I know this is not a pretty solution, but I'm a firm believer in function over form.  So I just figured it is more likely to work better as a fix right now for my books before it gets solved properly (especially the analysis textbook, where missing an overline leads to very confusing text).  Though I wonder if there is any reason to pick svg over chtml or vice versa for other reasons, or if there are any downsides.  The mathjax manual is not too enlightening on the pros/cons.

Best,

Jiri

Rob Beezer

unread,
Jun 9, 2021, 5:56:40 PM6/9/21
to pretext...@googlegroups.com
On 6/9/21 2:29 PM, Jiří Lebl wrote:
> I posted it as an issue on mathjax github:
> https://github.com/mathjax/MathJax/issues/2701

Thanks, Jiri. Sounds like the ball is in MJ's court for now. (That is *not* a
refernce to Michael Jordan.)

I figured the broad PreTeXt use was going to provoke a few interesting edge
cases. Pun intended.

Rob

Rob Beezer

unread,
Jun 9, 2021, 6:01:51 PM6/9/21
to pretext...@googlegroups.com
Thanks. Yes, agreed. We will see if switching to SVG (optionally, as the
default, etc.) makes sense long-term. Once we understand this particular issue.

Going back about 6 weeks to something like

7da4f10897ab4e3371ba7a3d8b658593e34735c7

and building with MJ 2.x would be another option for anybody else who wants
their overlines back ASAP.

Rob
> <https://groups.google.com/d/msgid/pretext-support/c4493dbf-1deb-46cf-a49a-37fa26c724d3n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/pretext-support/c4493dbf-1deb-46cf-a49a-37fa26c724d3n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-suppo...@googlegroups.com
> <mailto:pretext-suppo...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/d1e9dc62-30c4-45da-b94c-92d6eea4db00n%40googlegroups.com
> <https://groups.google.com/d/msgid/pretext-support/d1e9dc62-30c4-45da-b94c-92d6eea4db00n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Jason Diemer

unread,
Jun 9, 2021, 7:31:07 PM6/9/21
to PreTeXt support
Ok - for now I will use Jiri's idea of massaging the html to force svg rendering. 

I did try playing with the 0.88 scaling.  At 0.97, the overlines appear at 100%, but zooming then makes them either appear only faintly or not at all depending on the browser zoom level.

Jason

Rob Beezer

unread,
Jun 10, 2021, 2:19:05 PM6/10/21
to pretext...@googlegroups.com
I've added a string parameter, debug.mathjax.svg, which if set to 'yes', will
make the substitution described here.

This is *only* for debugging MathJax formatting, and is totally unsupported.
Just a cursory glance at

Subsection 7.4: Advanced Mathematics
https://pretextbook.org/examples/sample-article/html/section-7.html#subsection-11

indicates that "xref" inside display mathematics are ineffective. And I am
*not* suggesting David F try to fix this.

Also, the font size scaling is not respected, as noted on:

https://github.com/rbeezer/mathbook/issues/1493

So I would suggest not blindly using this for production output without
thoroughly examining your results.

Rob
> <https://groups.google.com/d/msgid/pretext-support/d1e9dc62-30c4-45da-b94c-92d6eea4db00n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/pretext-support/d1e9dc62-30c4-45da-b94c-92d6eea4db00n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-suppo...@googlegroups.com
> <mailto:pretext-suppo...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/1e6ad4a7-a531-4ae4-bdb0-b4fccdb24196n%40googlegroups.com
> <https://groups.google.com/d/msgid/pretext-support/1e6ad4a7-a531-4ae4-bdb0-b4fccdb24196n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Jiří Lebl

unread,
Jun 10, 2021, 4:06:39 PM6/10/21
to PreTeXt support
It might be good to collect a list of things that don't work (or work differently).  I wonder if some future version of the html output will (even in the absence of chrome bugs) require using svg mathjax.  In which case it might be good to have a list of pitfalls.

I wonder what is the impact on performance too.  Just intuitively, rendering everything as svg seems like it could add extra data usage.  I haven't really done any testing, but it might be good to try (might do this later).

On the plus side, svg is going to be a lot more robust since rendering svgs imprecisely is probably a showstopper bug in all browsers, whereas browsers were always willing to ship with html/css layout engines that aren't 100% compliant (for example, if I run both firefox and chrome on my laptop on the acid3 test, they both only get 97/100, but they both render SVGs faithfully).  There are simply a lot more people that are going to be yelling at them if SVGs aren't rendered exactly right.

So a list of pros/cons might be good to put together.

Best,

Jiri

Rob Beezer

unread,
Jun 10, 2021, 4:34:39 PM6/10/21
to pretext...@googlegroups.com
On 6/10/21 1:06 PM, Jiří Lebl wrote:
> It might be good to collect a list of things that don't work (or work
> differently).

I just retitled

https://github.com/rbeezer/mathbook/issues/1493

to reflect this purpose. Please pile on with observations (performance will be
a great one).

Rob Beezer

unread,
Jun 16, 2021, 12:16:49 PM6/16/21
to pretext...@googlegroups.com
As I understand our setup, a recent version of your project in HTML will make
use of the latest 3.x.y version of MathJax, without rebuilding.

So the overline bug has been fixed, merged into MathJax, and 3.2 will roll-out
very soon (if not already). More about that on an upcoming thread on -dev.

In particular for this thread, I'd suggest those who switched to an
(unsupported) SVG rendering of MathJax may want to rebuild with the default
CHTML since certain basic features will break with SVG.

Rob


On 6/10/21 1:06 PM, Jiří Lebl wrote:
> <https://groups.google.com/d/msgid/pretext-support/1e6ad4a7-a531-4ae4-bdb0-b4fccdb24196n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/pretext-support/1e6ad4a7-a531-4ae4-bdb0-b4fccdb24196n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-suppo...@googlegroups.com
> <mailto:pretext-suppo...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/d45ab350-a316-4761-a19a-dfa011a9be1bn%40googlegroups.com
> <https://groups.google.com/d/msgid/pretext-support/d45ab350-a316-4761-a19a-dfa011a9be1bn%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages