MathJax v4

38 views
Skip to first unread message

Rob Beezer

unread,
Oct 3, 2022, 1:32:09 PM10/3/22
to prete...@googlegroups.com
MathJax 4 is now available in an alpha release for testing. In just a few
minutes, I will make a switch we can use for testing.

https://github.com/mathjax/MathJax-src/releases/tag/4.0.0-alpha.1

Alex has started an issue - let's use that for technical details.

https://github.com/PreTeXtBook/pretext/issues/1841

General announcements of availability for testing of new features or releases
can go here.

Big new features seem to be:

* Line-breaking (Alex?)

* A bunch of new fonts (readability, David?)

* HTML inside TeX (!). Maybe mrow/xref could be easier now?

* New accessibility features, such as stepping through parts of an expression
with simultaneous highlight and voice (readability).

Rob

Rob Beezer

unread,
Oct 3, 2022, 1:35:15 PM10/3/22
to prete...@googlegroups.com
There is now a "stringparam" debug.mathjax4 which you can set to yes and get
our test version of MathJax 4 replacing the old version. You'll need to use the
pretext/pretext script to build HTML, as the CLI will not be keeping up
typically.

Big changes announced here, technical progress on the GitHub issue.

Oscar Levin

unread,
Oct 4, 2022, 11:25:35 AM10/4/22
to PreTeXt development
And now this can be done with the CLI, if you are using the brand new nightly development builds.  Upgrade using:  `pip install pretext --upgrade --pre`

Rob Beezer

unread,
Nov 29, 2022, 12:42:04 PM11/29/22
to prete...@googlegroups.com
Well into the weeds on this one. ;-) Browsers have been inclined to put a
line-break right after some inline math (MathJax) and before "clause-ending
punctuation," such as a period or a comma. Which looks really unprofessional.

So we have been absorbing the punctuation into the math with a \text{} and
scrubbing it from where it was authored. You're welcome! Good, but maybe not
so optimal for the math bits when used in other ways (braille). MathJax 4 has
this under control now.

Experiment: hack into our fix, turn it off, but also add a " FOO " after the
punctuation and before whatever comes next. To make these situations easy to
locate. Build Judson's AATA, chunked by chapter. Investigate. Chapters 5, 8,
17, 21, 23 (for no particular reason). 907 locations where punctuation follows
math. 7 are a bad line-break. And never more than two in a single chapter.

Now, turn on MathJax 4 and rebuild. All 7 bad breaks behave themselves.
Chapters 5, 8 and 17 show no bad breaks (didn't cruise the others).

https://pretextbook.org/beta/2022-11-29-math-punctuation/

Alex is interested in expressions like $x$-axis which I did not explicitly test.

Notes:

1. Punctuation on display math may be messed up, just a consequence of my hack.

2. A "FOO" at the start of a line is an apparent success (look at end of
previous line).

3. "<punct> FOO" at the start of a line is a failure.

4. Mostly tested in Chrome. <rant>Only Chapter 17 tested in my Firefox has
been crippled for testing by Ubuntu's delivery via Snap packaging. Not a fan.
(Yes, I'll install it differently when I get a chance.)</rant> Both bad breaks
were fixed, but the math+punctuation unit went to different lines on different
browsers. I'd guess fine details of font sizes, etc will influence these minute
decisions.

5. debug.mathjax4 yes|no can control the MathJax version.

6. math.punctuation.include display will turn off our inline adjustments, but
you won't get a "FOO", and this is not what I did.

Short answer: perhaps we turn off our low-level manipulation when we switch to
MathJax 4. We may still want it for SVG images of math that go into EPUB (and
similar). We'll need to test line-breaking between an image and punctuation
there, since we won't have MathJax controlling it.
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-dev...@googlegroups.com
> <mailto:pretext-dev...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-dev/f53e79c9-80cc-4d08-ad0d-ded4a0bf6380n%40googlegroups.com <https://groups.google.com/d/msgid/pretext-dev/f53e79c9-80cc-4d08-ad0d-ded4a0bf6380n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Rob Beezer

unread,
Nov 29, 2022, 8:57:54 PM11/29/22
to prete...@googlegroups.com
Entirely for Brad M.

We talked today about MathJax and timing. I found the current release notes:

https://github.com/mathjax/MathJax-src/releases/tag/4.0.0-alpha.1

And a section titled "MathJax v4.0 and Promises" indicates *some* changes since
font data is being loaded asynchronously. I couldn't quite tell if that was
applicable to Runestone's process for making sure math bits wait until they are
ready for MathJax (or is it the other way around?).

Rob

Rob Beezer

unread,
Aug 17, 2023, 12:16:17 PM8/17/23
to prete...@googlegroups.com
First beta release is out.

*Everything* right now is being announced and discussed on a GitHub issue, so
head over there with questions. This is just a PSA.

https://github.com/PreTeXtBook/pretext/issues/1841

Any post on the issue should get you email for life. Maybe even a smiley-face
reaction (untested).

Rob

Rob Beezer

unread,
Aug 17, 2023, 12:32:28 PM8/17/23
to prete...@googlegroups.com
But should have also said this may be the *last* beta release. So those with
pet projects can do some serious testing?

"which we hope to be the last beta release before the official version becomes
available"

Rob Beezer

unread,
May 3, 2024, 4:05:01 PMMay 3
to prete...@googlegroups.com
Is now out

*Everything* right now is being announced and discussed on a GitHub issue, so
head over there with questions. This is just a PSA.

https://github.com/PreTeXtBook/pretext/issues/1841

Reminder: stringparam debug.mathjax4 set to yes will activate this new vesion
for safe testing.

Rob

Rob Beezer

unread,
Jul 21, 2024, 1:33:34 PM (3 days ago) Jul 21
to prete...@googlegroups.com
Is now out

*Everything* right now is being announced and discussed on a GitHub issue, so
head over there with questions. This is just a PSA.

https://github.com/PreTeXtBook/pretext/issues/1841

Reminder: stringparam debug.mathjax4 set to yes will activate this new version
for safe testing.

Rob
Reply all
Reply to author
Forward
0 new messages