PreTeXtBook / pretext

PreTeXt: an authoring and publishing system for scholarly documents
https://pretextbook.org
Other
266 stars 208 forks source link

when ref in exercise, math gets bolded in html in Safari #333

Closed kcrisman closed 2 years ago

kcrisman commented 8 years ago

Consider an exercise like this.

    <exercise>
      <statement><p>Prove <xref autoname="yes" ref="myref" />; if a prime <m>p</m> divides any finite product of primes, then <m>p</m> divides at least one of them.</p></statement>
    </exercise>

In this situation, the html bolds for the math. This doesn't appear to happen in pdf or outside of exercises, though I can't say for sure.

rbeezer commented 8 years ago

Can't duplicate this.

I put this into the first section of the minimal article and HTML output looks fine.

Then made an "exercises" section, as a peer of other sections, and put the provided "exercise" there. HTML output looks fine.

Of course, I don't have an xml:id="myref", but I'd be surprised if that has anything to do with it.

Can you provide a minimal example, and include HTML output as an attachment?

Thanks, Rob

On 07/07/2016 09:27 AM, kcrisman wrote:

|

Prove ; if a prime

p divides any finite product of primes, then p divides at least one of them.

|
davidfarmer commented 8 years ago

We need to let everyone know that reports of problems should be accompanied by a live example showing the problem.

Having to reconstruct the example is an added burden on whoever is trying to fix it. And, as this example shows, can fail to actually show the claimed problem.

Maybe we need a policy (such as the MathJax people have) of expecting a live example to accompany such error reports.

On Thu, 7 Jul 2016, Rob Beezer wrote:

Can't duplicate this.

I put this into the first section of the minimal article and HTML output looks fine.

Then made an "exercises" section, as a peer of other sections, and put the provided "exercise" there. HTML output looks fine.

Of course, I don't have an xml:id="myref", but I'd be surprised if that has anything to do with it.

Can you provide a minimal example, and include HTML output as an attachment?

Thanks, Rob

On 07/07/2016 09:27 AM, kcrisman wrote:

|

Prove ; if a prime

p divides any finite product of primes, then p divides at least one of them.

|

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.[AAM6LNhzBHdk1FRiImxx9gKb6z_UV7dLks5qTbrygaJpZM4JHQ1O.gif]

rbeezer commented 8 years ago

On 07/07/2016 08:11 PM, davidfarmer wrote:

We need to let everyone know that reports of problems should be accompanied by a live example showing the problem.

Having to reconstruct the example is an added burden on whoever is trying to fix it. And, as this example shows, can fail to actually show the claimed problem.

Maybe we need a policy (such as the MathJax people have) of expecting a live example to accompany such error reports.

Agreed in spirit. In several cases the request to produce a minimal example has "solved" the problem.

We could

Momentary lull here now - perhaps I'll do this right now. I'll suggest "live" is nice and we can move more firmly that way if need be.

kcrisman commented 8 years ago

@davidfarmer - Asking for a MWO is all well and good, but this is not Stackoverflow. I'm not asking for an answer to this question, I'm reporting a bug to the best of my ability. I am not about to post the entire source to my project in this question, and as I mentioned before my current setup makes it extremely onerous to put anything half-baked online. I would hope that MBX could accept bug reports that are also half-baked, while promising to do little about it until a MWO is available. In this case, I knew that if I didn't report it now I would forget.

@rbeezer - Yes, often that does "solve" it. In this case DTD did not have any such failures. I hope you also agree that it is better to have a few spurious reports that one agrees not to do anything about rather than discourage people from reporting bugs. You know that I at least usually try to be very careful about giving as much detail as I can when possible.

As to the bug, I will say that it doesn't occur every time, and only one or two m tags closest to the place of the reference are bolded. I'll investigate this morning for a few more minutes to see if I can nail it down; I did not have time yesterday.

kcrisman commented 8 years ago

Here's your minimal (non-)working example. No DTD violations. The last two <m>d</m> modulo <m>p</m> are bolded. I have investigated further and this only happens in Safari (9), not FF or Chrome. (Haven't checked in IE.) I'll change the title of this appropriately.

<?xml version="1.0" encoding="UTF-8" ?>

 <mathbook>

    <docinfo>

</docinfo>
    <book xml:id="minimal">
        <title>A Minimal Article</title>

      <frontmatter></frontmatter>
      <chapter>
       <title>Hi there</title>
        <section xml:id="section-computation">
            <title>Computation</title>

            <theorem xml:id="byref">
              <statement><p>This is a theorem</p></statement>
              <proof><p>And we prove it</p></proof>
            </theorem>
        </section>

      <exercises>
       <exercise>
        <statement><p>Suppose <m>p</m> is prime and <m>d</m> divides <m>p-1</m> (and hence is a possible order of an element of <m>U_p</m>).  Prove that at most <m>\phi(d)</m> incongruent integers modulo <m>p</m> have order <m>d</m> modulo <m>p</m>.  Hint: Lagrange's (polynomial) Theorem <xref autoname="no" ref="myref" />.</p></statement>
       </exercise>
      </exercises>

      </chapter>
    </book>

</mathbook>
rbeezer commented 8 years ago

Thanks very much. That's a head-scratcher, that I'd like to gt to the bottom of.

On 07/08/2016 06:14 AM, kcrisman wrote:

Here's your minimal (non-)working example. No DTD violations. The last two |d modulo p| are bolded. I have investigated further and this only happens in Safari (9), not FF or Chrome. (Haven't checked in IE.) I'll change the title of this appropriately.

|<?xml version="1.0" encoding="UTF-8" ?> <book xml:id="minimal"> A Minimal Article

Hi there
Computation

This is a theorem

And we prove it

Suppose p is prime and d divides p-1 (and hence is a possible order of an element of U_p). Prove that at most \phi(d) incongruent integers modulo p have order d modulo p. Hint: Lagrange's (polynomial) Theorem .

| — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rbeezer/mathbook/issues/333#issuecomment-231355913, or mute the thread https://github.com/notifications/unsubscribe/ABy2clg3pv0jUJ-LN_hD9BvDtYPgs1aXks5qTk0qgaJpZM4JHQ1O.
rbeezer commented 8 years ago

Thanks, KDC. No problem here - some guidance on reporting errors was long overdue. I just got something on GitHub about how I like pull requests handled, so the timing was right.

Please keep reporting what you can - it's been very helpful.

Rob

On 07/08/2016 06:03 AM, kcrisman wrote:

@davidfarmer https://github.com/davidfarmer - Asking for a MWO is all well and good, but this is not Stackoverflow. I'm not asking for an answer to this question, I'm reporting a bug to the best of my ability. I am not about to post the entire source to my project in this question, and as I mentioned before my current setup makes it extremely onerous to put anything half-baked online. I would hope that MBX could accept bug reports that are also half-baked, while promising to do little about it until a MWO is available. In this case, I knew that if I didn't report it now I would forget.

@rbeezer https://github.com/rbeezer - Yes, often that does "solve" it. In this case DTD did not have any such failures. I hope you also agree that it is better to have a few spurious reports that one agrees not to do anything about rather than discourage people from reporting bugs. You know that I at least usually try to be very careful about giving as much detail as I can when possible.

As to the bug, I will say that it doesn't occur every time, and only one or two m tags closest to the place of the reference are bolded. I'll investigate this morning for a few more minutes to see if I can nail it down; I did not have time yesterday.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rbeezer/mathbook/issues/333#issuecomment-231353780, or mute the thread https://github.com/notifications/unsubscribe/ABy2ci48SEMfMNWGdRDcxInHZOXbCjHCks5qTkq0gaJpZM4JHQ1O.

kcrisman commented 8 years ago

Thanks very much. That's a head-scratcher, that I'd like to gt to the bottom of.

Yeah, what's weird is the browser-dependent nature - the HTML source looks fine, maybe Mathjax is to blame? And that it's very inconsistent - I have two exercises in a row that reference Claim 10.4.2, and one does it and the other doesn't, not to mention whole exercise sets where this doesn't happen at all (despite there being xrefs).

kcrisman commented 8 years ago

See perhaps

https://github.com/mathjax/MathJax/issues/735

https://github.com/mathjax/MathJax/issues/845

rbeezer commented 8 years ago

Thanks for the further investigation. I'll host an HTML version and perhaps ask the list for some browser tests before agitating the good folks over at MathJax.

On 07/08/2016 10:07 AM, kcrisman wrote:

Thanks very much. That's a head-scratcher, that I'd like to gt to the bottom of.

Yeah, what's weird is the browser-dependent nature - the HTML source looks fine, maybe Mathjax is to blame? And that it's very inconsistent - I have two exercises in a row that reference Claim 10.4.2, and one does it and the other doesn't, not to mention whole exercise sets where this doesn't happen at all (despite there being xrefs).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rbeezer/mathbook/issues/333#issuecomment-231416167, or mute the thread https://github.com/notifications/unsubscribe/ABy2cokaeL_HXGd6SyMDnK_rVdUnTcdyks5qToPKgaJpZM4JHQ1O.

Alex-Jordan commented 2 years ago

I just checked KDC's minimal example, viewing output in Safari 14. I don't see the bold. Most likely Safari evolved to fox this. But also maybe it was the move to MathJax 3 or something else.