Re: [pretext-dev] punctuation font size after math

22 views
Skip to first unread message

Mitch Keller

unread,
Jun 29, 2022, 11:24:18 AM6/29/22
to pretext...@googlegroups.com
Moving to -support as suggested. I dug into the HTML after MathJax does its thing, and that question mark is definitely getting a font-size reduction (as a percentage) set on it by MathJax. Increasing to 100% makes it better, but it actually appears to be slightly larger than if I put a question mark (outside math) right next to it by editing the page in Firefox’s inspector. This feels like a MathJax bug that probably should be punted to their support list, since PreTeXt isn’t doing anything other than moving the punctuation inside the math, wrapped in \text.

(Regarding the list, I would probably use two m elements in this context, since the comma is more part of the grammar of the sentence than the grammar of the math. If I were writing “Let x,y,z\in\mathbb{R}”, I would use a single math element and take the “math commas” in that case, since the commas in that case feel like they’re more part of the syntax of the math.)

> On Jun 29, 2022, at 10:16 AM, Jean-Sébastien Turcotte <jsebastie...@gmail.com> wrote:
>
> Yes I agree that a comma starting a line is bad. And the comma difference isn't that much noticeable but the question mark is somewhat more. I never know when I enumerate math things if I should do <m>a</m>,<m>b</m> vs <m>a,b</m>. I feel like both could be warranted in a given context.
>
> Also I realise that this is the wrong forum for this, I thought I was in -support. Should we move it?
>
> On Wednesday, June 29, 2022 at 11:10:23 AM UTC-4 steven...@gmail.com wrote:
> The difference in presentation is likely unintended; I'm just explaining why it looks different. Folks who know more details on MathJax will have to comment on if it's fixable, but I think the different-looking comma is less obnoxious than a line-broken comma at least.
>
>
>
> Steven Clontz
> https://clontz.org - steven...@gmail.com
>
> On Wed, Jun 29, 2022 at 10:08 AM Jean-Sébastien Turcotte <jsebastie...@gmail.com> wrote:
> So this is intended? Somehow I never noticed but it felt weird reading it today.
>
> On Wed, Jun 29, 2022 at 11:05 AM Steven Clontz <steven...@gmail.com> wrote:
> The period is being included in the LaTeX fed to MathJax, so it won't be line-broken.
>
> The comma is handled similarly, but your original mathmode comma looks different because the injected punctuation is wrapped in \text: \vec{e}_1=(1,0),\vec{e}_2=(0,1)\text{,}
>
>
>
> Steven Clontz
> https://clontz.org - steven...@gmail.com
>
>
> On Wed, Jun 29, 2022 at 10:02 AM Jean-Sébastien Turcotte <jsebastie...@gmail.com> wrote:
> In the guide, it says to put punctuation immediately after <m> </m> so that it can migrate correctly. However this seems to sometime produce a smaller font size.
>
>
>
> Compare line 3 at this Paragraph with the final question mark of the same paragraph.
>
> --
> 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 on the web visit https://groups.google.com/d/msgid/pretext-dev/c5344e9b-a98f-43c2-b290-549eb5370951n%40googlegroups.com.
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "PreTeXt development" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-dev/o_v5ruXmORQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to pretext-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-dev/CAOWT6ThGpJ31ByEZVf%3DJCGWVVBTWM8irEWy0bQ2OO9zpQvskAA%40mail.gmail.com.
>
>
> --
> Jean-Sébastien Turcotte
>
> --
> 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 on the web visit https://groups.google.com/d/msgid/pretext-dev/CAPuDJ%2BNh1gBOKLpp9bmsJUGZ-8%3Di96hS8BorV%2BBtTzb45SLsUQ%40mail.gmail.com.
>
> --
> 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 on the web visit https://groups.google.com/d/msgid/pretext-dev/354277a9-b824-492a-9423-894e7f965ea9n%40googlegroups.com.

--
Mitch Keller
mi...@rellek.net

http://www.rellek.net/

Alex Jordan

unread,
Jun 29, 2022, 11:54:56 AM6/29/22
to pretext...@googlegroups.com
I have a PR open that ends the practice of moving punctuation into math. It wraps math with adjacent text into a non breaking span. This is needed for accessibility but the font issue is another reason to make that move.

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/36876FAC-2B31-45ED-9208-A4D7AE190B96%40rellek.net.

David Farmer

unread,
Jun 29, 2022, 12:15:51 PM6/29/22
to pretext...@googlegroups.com

I thought we had new HTML markup (due to Alex) which allowed the
punctuation in inline math to stay outside the math?
> 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.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/36876FAC-2B31-45ED-9208-A4D7AE190B96%40rellek.net.
>

Rob Beezer

unread,
Jun 29, 2022, 12:47:47 PM6/29/22
to pretext...@googlegroups.com
Alex said:

> I have a PR open

I've been negligent since this one will require a very careful review. Too many
problems to deal with resulting from my sloppy reviews. I'm trying to learn my
lesson, but I'm a slow learner. ;-)

Rob

Steven Clontz

unread,
Jun 29, 2022, 8:25:46 PM6/29/22
to PreTeXt support
Crossing fingers that the PR covers more than just periods and commas.

Screenshot 2022-06-29 192453.png

Alex Jordan

unread,
Jun 29, 2022, 9:25:37 PM6/29/22
to pretext...@googlegroups.com
It will cover anything where there is no space between text and math content. For example

...the horizontal axis (<m>x</m>-axis).

Puts a nonbreaking span that starts at leftparen and ends at period.

It will not cover generated text that is part of a group like quotes from a q.

ksk...@gmail.com

unread,
Jul 4, 2022, 7:09:43 PM7/4/22
to PreTeXt support
Possibly related issue: at the moment, when punctuation follows directly after a symbol, e.g.,

... for <m>x=3</m>, set <m>y=1</m>

the space after the comma goes missing in the HTML rendering (but not in the PDF).

Rob Beezer

unread,
Jul 4, 2022, 8:24:18 PM7/4/22
to pretext...@googlegroups.com
On 7/4/22 16:09, ksk...@gmail.com wrote:
> Possibly related issue: at the moment, when punctuation follows directly after a
> symbol, e.g.,
>
> ... for <m>x=3</m>, set <m>y=1</m>
>
> the space after the comma goes missing in the HTML rendering (but not in the PDF).

Can you say, or check, if the AWOL space actually exists in the raw HTML file?
(Your choice of words suggests it is.)

Rob

ksk...@gmail.com

unread,
Jul 4, 2022, 8:38:59 PM7/4/22
to PreTeXt support
Here's a bit more context: the XML input:

   For <m>X</m> an algebraic variety over <m>\FF_q</m>, we write

is translating into the HTML:

   For <span class="process-math">\(X\)</span> an algebraic variety over <span class="process-math">\(\FF_q\text{,}\)</span> we write

and when this renders there is no space before "we". It seems that PreTeXt decides to render the comma within the MathJax block? That looks like a mistake to me; for one thing it puts the comma in the wrong font.

Kiran

David Farmer

unread,
Jul 4, 2022, 11:16:46 PM7/4/22
to PreTeXt support

No need to continue this thread.

Alex Jordan has a fix, so let's just wait until it is incorporated.

Regards,

David
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/ad560c53-540e-4de7-803c-9aa51a9c5aa8n%40googlegroups.com.
>
>

Rob Beezer

unread,
Jul 5, 2022, 11:11:45 PM7/5/22
to pretext...@googlegroups.com
Dear Kiran,

Thanks very much for the concrete example. I'll take it for a test drive soon -
there are some things I want to understand before I go any further.

MathJax and line-breaking don't behave so well together. So if my history is
right, we pull in the comma so that it does not get pushed to the start of the
next line. A font discrepancy is the price to pay.

Thanks for noticing (and reporting!), and I hope we can get this all sorted soon.

Rob
> --
> 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/ad560c53-540e-4de7-803c-9aa51a9c5aa8n%40googlegroups.com
> <https://groups.google.com/d/msgid/pretext-support/ad560c53-540e-4de7-803c-9aa51a9c5aa8n%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages