"Flashing" knowls

20 views
Skip to first unread message

Jeremy Sylvestre

unread,
May 11, 2026, 8:42:51 AMMay 11
to PreTeXt development
Seeing some odd behaviour for hidden knowls in the sample article: when clicked to reveal, the entire knowl opens immediately, then disappears and re-opens via animation.

(For knowls with only a small amount of content, you might not see the initial "flash" because it happens so quickly.)


Cheers,
Jeremy S

Rob Beezer

unread,
May 11, 2026, 11:00:04 AMMay 11
to prete...@googlegroups.com
I see this in Firefox, but it is really quick, so not so noticeable. Might be
only if there is math in the knowl? Can you test a knowl without any math in it?

Can't think of what would have changed recently, except that MathJax 4 is now
live. Are you using the very latest CLI (as in, released yesterday)? MJ4
announcment slated for today...

Rob
> screen capture video <https://sites.ualberta.ca/~jsylvest/pretext-dev/flashing-
> knowl.mkv>
>
> Cheers,
> Jeremy S
>
> --
> 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+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/
> CALMYOnf4%2B0nchQk5zK6n-BEc5XdT-t%2BZ_H_hCUmszbY%2BRxDBQw%40mail.gmail.com
> <https://groups.google.com/d/msgid/pretext-dev/CALMYOnf4%2B0nchQk5zK6n-BEc5XdT-
> t%2BZ_H_hCUmszbY%2BRxDBQw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Jeremy Sylvestre

unread,
May 11, 2026, 12:48:33 PMMay 11
to prete...@googlegroups.com
On Mon, 11 May 2026 at 11:00, 'Rob Beezer' via PreTeXt development <prete...@googlegroups.com> wrote:
I see this in Firefox, but it is really quick, so not so noticeable.

Yes, very quick if the knowl does not have much content. But much more pronounced for knowls with lots of content.
 
Might be
only if there is math in the knowl?  Can you test a knowl without any math in it?


I clicked through a bunch of the knowls in Section 21: Cross-Referencing of the sample article, and it does seem to be the case that it only happens with knowls that contain math.
 
Can't think of what would have changed recently, except that MathJax 4 is now
live.  Are you using the very latest CLI (as in, released yesterday)?

No idea, this is the live sample article on pretextbook.org where I see this.

Andrew Scholer

unread,
May 11, 2026, 2:40:11 PMMay 11
to prete...@googlegroups.com
I can reproduce this on MJ 3 and 4 using the up to date pretext core.

Happy to PR something to fix the issue - shouldn't be a big lift.

Andrew



--
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.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/CALMYOndBaWT66eJkQ0OR8t1Z3X-g%3DB4csHip%3DteKMbH_G%3DGfrw%40mail.gmail.com.

Rob Beezer

unread,
May 11, 2026, 2:44:36 PMMay 11
to prete...@googlegroups.com
Great, thanks for the further sleuthing.

Sample article was built a while ago, but I'm pretty sure it has MJ 4 (I can
check in a bit, context menu will say).

There are various things going on to let MJ do its thing, before other rendering
happens, so if I had to guess I think something needs attention there, but that
is outside my expertise. Others?

Rob

On 5/11/26 09:48, Jeremy Sylvestre wrote:
>
> On Mon, 11 May 2026 at 11:00, 'Rob Beezer' via PreTeXt development <pretext-
> d...@googlegroups.com <mailto:prete...@googlegroups.com>> wrote:
>
> I see this in Firefox, but it is really quick, so not so noticeable.
>
>
> Yes, very quick if the knowl does not have much content. But much more
> pronounced for knowls with lots of content.
>
> Might be
> only if there is math in the knowl?  Can you test a knowl without any math
> in it?
>
>
> I clicked through a bunch of the knowls in Section 21: Cross-Referencing
> <https://pretextbook.org/examples/sample-article/html/section-cross-
> referencing.html#section-cross-referencing> of the sample article, and it does
> seem to be the case that it only happens with knowls that contain math.
>
> Can't think of what would have changed recently, except that MathJax 4 is now
> live.  Are you using the very latest CLI (as in, released yesterday)?
>
>
> No idea, this is the live sample article on pretextbook.org <http://
> pretextbook.org> where I see this.
>
> --
> 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+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/
> CALMYOndBaWT66eJkQ0OR8t1Z3X-g%3DB4csHip%3DteKMbH_G%3DGfrw%40mail.gmail.com
> <https://groups.google.com/d/msgid/pretext-dev/CALMYOndBaWT66eJkQ0OR8t1Z3X-
> g%3DB4csHip%3DteKMbH_G%3DGfrw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Rob Beezer

unread,
May 11, 2026, 8:23:36 PMMay 11
to prete...@googlegroups.com
Andrew has improved the knowl animations a lot, at
https://github.com/PreTeXtBook/pretext/pull/2845

For me, it looks better locally than online, so there must be some lag
retrieving something.

Have a look, the sample article is live with the changes.

Thanks, Jeremy, for the report!

Rob

Jeremy Sylvestre

unread,
May 17, 2026, 1:24:40 AMMay 17
to prete...@googlegroups.com
Thanks for addressing this issue so quickly.

Still seeing some odd knowl behaviour though.

The output at
was created using source that jing says complies with the schema, and built using pretext commit d1d952e3. No extra/custom XSL was used.

Try the following:
1. Navigate to the page linked above.
2. *Immediately after* MathJax is done rendering the math on the page, click one or more of the "Answer" knowl links.
Those knowls will take anywhere from 3 to 5 seconds to actually appear, giving the user the impression during that waiting time that something is broken or that content is missing.

The behaviour seems to revolve around that 3-to-5 second window of time following the point where MathJax is finished rendering:
. Any knowls clicked *before* MathJax has finished rendering will unfurl immediately.
. Any knowls clicked during that post-MathJax window will be delayed.
. Any knowls clicked after that post-MathJax window will unfurl immediately.

You can re-test all of the above by just reloading the page.

I guess some code that is triggered when MathJax finishes rendering is blocking the knowl animation from running. If that's the case, it would be nice if that code could be run asynchronously.

To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAyMC5iZWV6ZXI.1778545413%40pnsh.

Andrew Scholer

unread,
May 17, 2026, 11:54:17 AM (14 days ago) May 17
to prete...@googlegroups.com
The unfurl currently blocks on parsing the content with MathJax so that the animation has the correct height for the content. Once all the MathJax on the page is queued up and started, that request goes in the back of the line. That window you identify isn't after MathJax is done, it is the period while MathJax is still working through all the math elements further down the page.

We can relax the blocking at the possible expense of some jank during the unfurl. I'll take a look at that.

But this does raise some questions about the math loading... I'll ask those in a new thread.

Reply all
Reply to author
Forward
0 new messages