MJ4 help icon is clipped

13 views
Skip to first unread message

Alex Jordan

unread,
Feb 16, 2026, 1:24:47 AMFeb 16
to prete...@googlegroups.com
With MathJax 4, when focus is on math content, there is a small help icon in the upper right corner of the math content. It can be clicked to reveal instructions for how to use the MathJax accessibility features.

The current PTX HTML has a div surrounding display math, and it clips this help icon:

Screenshot 2026-02-15 at 10.18.34 PM.png

One way to address this (that is maybe not the best) is to add padding-top to the .displaymath class. I found that 3pt was enough, and 2pt was not. But before I open a PR, I wondered if anyone could find a better solution. It seems like the div should ideally not clip vertically. But at least with Firefox, I was not able to accomplish this. For example I tried changing overflow-y on that div and it did not help.

Reminder that to build with MJ 4, you must use -x debug.mathjax4 yes.

Andrew Scholer

unread,
Feb 16, 2026, 11:14:12 AMFeb 16
to prete...@googlegroups.com
It looks like the cause is this rule we added to prevent clipping in MJ3:
https://github.com/PreTeXtBook/pretext/blob/8ad43a3f2e9bd79b3be4e438edc4ed50cc2a8c65/css/components/elements/_math.scss#L10

MJ4 added its own padding to mjx-container that is larger than what we were adding:
mjx-container[display] {
    ...
    padding: .3em 2px;
}

If we can't easily make the old fix apply only to MJ3, we should replace it with something like:
padding-top: .3em // backport MJ4 padding to MJ3

IMO that will be better than laying another fix on top of the existing one.


--
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/CA%2BR-jrfKLv3TsOgoi05ADRhu323v0%3DK%2BZgRorz0fb_9x4LBv9g%40mail.gmail.com.

Rob Beezer

unread,
Feb 16, 2026, 1:46:19 PMFeb 16
to prete...@googlegroups.com
Thanks, Andrew!

> If we can't easily make the old fix apply only to MJ3

Yes, we should be on MJ4 by now anyway. ;-) So, something that will transition
smoothly would be great.

Rob

On 2/16/26 08:13, Andrew Scholer wrote:
> It looks like the cause is this rule we added to prevent clipping in MJ3:
> https://github.com/PreTeXtBook/pretext/
> blob/8ad43a3f2e9bd79b3be4e438edc4ed50cc2a8c65/css/components/elements/
> _math.scss#L10 <https://github.com/PreTeXtBook/pretext/
> blob/8ad43a3f2e9bd79b3be4e438edc4ed50cc2a8c65/css/components/elements/
> _math.scss#L10>
>
> MJ4 added its own padding to mjx-container that is larger than what we were adding:
> mjx-container[display] {
>     ...
>     padding: .3em 2px;
> }
>
> If we can't easily make the old fix apply only to MJ3, we should replace it with
> something like:
> padding-top: .3em // backport MJ4 padding to MJ3
>
> IMO that will be better than laying another fix on top of the existing one.
>
>
> On Sun, Feb 15, 2026 at 10:24 PM Alex Jordan <jordanc...@gmail.com
> <mailto:jordanc...@gmail.com>> wrote:
>
> With MathJax 4, when focus is on math content, there is a small help icon in
> the upper right corner of the math content. It can be clicked to reveal
> instructions for how to use the MathJax accessibility features.
>
> The current PTX HTML has a div surrounding display math, and it clips this
> help icon:
>
> Screenshot 2026-02-15 at 10.18.34 PM.png
>
> One way to address this (that is maybe not the best) is to add padding-top
> to the .displaymath class. I found that 3pt was enough, and 2pt was not. But
> before I open a PR, I wondered if anyone could find a better solution. It
> seems like the div should ideally not clip vertically. But at least with
> Firefox, I was not able to accomplish this. For example I tried changing
> overflow-y on that div and it did not help.
>
> Reminder that to build with MJ 4, you must use -x debug.mathjax4 yes.
>
> --
> 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/
> CA%2BR-jrfKLv3TsOgoi05ADRhu323v0%3DK%2BZgRorz0fb_9x4LBv9g%40mail.gmail.com
> <https://groups.google.com/d/msgid/pretext-dev/CA%2BR-
> jrfKLv3TsOgoi05ADRhu323v0%3DK%2BZgRorz0fb_9x4LBv9g%40mail.gmail.com?
> utm_medium=email&utm_source=footer>.
>
> --
> 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/
> CACm44N_VpSS2Nnv3TBv%2BWPaOCKQ8zU08U4c1ubJt3t1SuQvrXA%40mail.gmail.com <https://
> groups.google.com/d/msgid/pretext-dev/
> CACm44N_VpSS2Nnv3TBv%2BWPaOCKQ8zU08U4c1ubJt3t1SuQvrXA%40mail.gmail.com?
> utm_medium=email&utm_source=footer>.

Alex Jordan

unread,
Feb 16, 2026, 7:09:24 PMFeb 16
to prete...@googlegroups.com
Andrew, do you have a handle on this for opening a PR? If I opened one, it would just be to use your suggestion.

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.1771267577%40pnsh.

Andrew Scholer

unread,
Feb 17, 2026, 12:59:07 AM (14 days ago) Feb 17
to prete...@googlegroups.com

Rob Beezer

unread,
Feb 17, 2026, 2:03:53 PM (13 days ago) Feb 17
to prete...@googlegroups.com
Thanks, Andrew. Merged, and website examples being updated just now.

On 2/16/26 21:58, Andrew Scholer wrote:
> Sure... done.
>
> On Mon, Feb 16, 2026 at 4:09 PM Alex Jordan <jordanc...@gmail.com
> <mailto:jordanc...@gmail.com>> wrote:
>
> Andrew, do you have a handle on this for opening a PR? If I opened one, it
> would just be to use your suggestion.
>
> On Mon, Feb 16, 2026 at 10:46 AM 'Rob Beezer' via PreTeXt development
> <prete...@googlegroups.com <mailto:prete...@googlegroups.com>> wrote:
>
> Thanks, Andrew!
>
> > If we can't easily make the old fix apply only to MJ3
>
> Yes, we should be on MJ4 by now anyway.  ;-)  So, something that will
> transition
> smoothly would be great.
>
> Rob
>
> On 2/16/26 08:13, Andrew Scholer wrote:
> > It looks like the cause is this rule we added to prevent clipping in MJ3:
> > https://github.com/PreTeXtBook/pretext/ <https://github.com/
> PreTeXtBook/pretext/>
> > blob/8ad43a3f2e9bd79b3be4e438edc4ed50cc2a8c65/css/components/elements/
> > _math.scss#L10 <https://github.com/PreTeXtBook/pretext/ <https://
> github.com/PreTeXtBook/pretext/>
> > blob/8ad43a3f2e9bd79b3be4e438edc4ed50cc2a8c65/css/components/elements/
> > _math.scss#L10>
> >
> > MJ4 added its own padding to mjx-container that is larger than what
> we were adding:
> > mjx-container[display] {
> >      ...
> >      padding: .3em 2px;
> > }
> >
> > If we can't easily make the old fix apply only to MJ3, we should
> replace it with
> > something like:
> > padding-top: .3em // backport MJ4 padding to MJ3
> >
> > IMO that will be better than laying another fix on top of the
> existing one.
> >
> >
> > On Sun, Feb 15, 2026 at 10:24 PM Alex Jordan
> <jordanc...@gmail.com <mailto:jordanc...@gmail.com>
> > <mailto:jordanc...@gmail.com
> <mailto:pretext-dev%2Bunsu...@googlegroups.com> <mailto:pretext-
> <mailto:pretext->
> > dev+uns...@googlegroups.com
> <mailto:dev%2Bunsu...@googlegroups.com>>.
> >     To view this discussion visit https://groups.google.com/d/msgid/
> pretext-dev/ <https://groups.google.com/d/msgid/pretext-dev/>
> >     CA%2BR-
> jrfKLv3TsOgoi05ADRhu323v0%3DK%2BZgRorz0fb_9x4LBv9g%40mail.gmail.com
> <http://40mail.gmail.com>
> >     <https://groups.google.com/d/msgid/pretext-dev/CA%2BR- <https://
> groups.google.com/d/msgid/pretext-dev/CA%2BR->
> >
>  jrfKLv3TsOgoi05ADRhu323v0%3DK%2BZgRorz0fb_9x4LBv9g%40mail.gmail.com
> <http://40mail.gmail.com>?
> >     utm_medium=email&utm_source=footer>.
> >
> > --
> > 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%2Bunsu...@googlegroups.com> <mailto:pretext- <mailto:pretext->
> > dev+uns...@googlegroups.com
> <mailto:dev%2Bunsu...@googlegroups.com>>.
> > To view this discussion visit https://groups.google.com/d/msgid/
> pretext-dev/ <https://groups.google.com/d/msgid/pretext-dev/>
> >
> CACm44N_VpSS2Nnv3TBv%2BWPaOCKQ8zU08U4c1ubJt3t1SuQvrXA%40mail.gmail.com
> <http://40mail.gmail.com> <https://
> > groups.google.com/d/msgid/pretext-dev/ <http://groups.google.com/d/
> msgid/pretext-dev/>
> >
> CACm44N_VpSS2Nnv3TBv%2BWPaOCKQ8zU08U4c1ubJt3t1SuQvrXA%40mail.gmail.com
> <http://40mail.gmail.com>?
> > utm_medium=email&utm_source=footer>.
>
> --
> 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%2Bunsu...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-
> dev/MTAwMDAyMC5iZWV6ZXI.1771267577%40pnsh <https://groups.google.com/d/
> msgid/pretext-dev/MTAwMDAyMC5iZWV6ZXI.1771267577%40pnsh>.
>
> --
> 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/
> CA%2BR-jre4DeUZ_ONZAs22zf7uTH1HqHDuGYM3Sz2j-bJPtzxuNA%40mail.gmail.com
> <https://groups.google.com/d/msgid/pretext-dev/CA%2BR-
> jre4DeUZ_ONZAs22zf7uTH1HqHDuGYM3Sz2j-bJPtzxuNA%40mail.gmail.com?
> utm_medium=email&utm_source=footer>.
>
> --
> 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/
> CACm44N8vCdWtX4-qGAXOm0VDEMKZBgM2yVcQea0jMTAu2dZ4QA%40mail.gmail.com <https://
> groups.google.com/d/msgid/pretext-dev/CACm44N8vCdWtX4-
> qGAXOm0VDEMKZBgM2yVcQea0jMTAu2dZ4QA%40mail.gmail.com?
> utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages