Math Mode in Horizontal Parsons

7 views
Skip to first unread message

Geoffrey Cox

unread,
Apr 16, 2025, 12:43:37 PM4/16/25
to PreTeXt development
In case anyone is interested, I recently submitted this PR to support math in horizontal Parsons problems. It appears to be working, but I am sure more kinks must be hammered out.

This might be a good way to construct formulas and equations (term-by-term) if multiple correct orderings can be supported (for addition/multiplication). 

Sean Fitzpatrick

unread,
Jan 2, 2026, 1:27:26 PM (11 days ago) Jan 2
to PreTeXt development
I am trying to use this for a PROTEUS problem, and the math isn't rendering.

Here is my output in HTML:

Screenshot 2026-01-02 112518.png

This is the source that produced it:

    <exercise label="APEX-PROTEUS-lhosptial-2-v1" component="proteus" language="natural">
      <statement>
        <p>
          Place the functions below in order from left to right according to the following rule:
          <m>f(x)</m> is to the left of <m>g(x)</m> if <m>\lim_{x\to\infty}\frac{f(x)}{g(x)}=0</m>.
        </p>
      </statement>
      <blocks layout="horizontal" randomize="yes">
        <block order="5"><m>\sin(x)</m></block>
        <block order="2"><m>\ln(x)</m></block>
        <block order="6"><m>\sqrt{x}</m></block>
        <block order="3"><m>x^3</m></block>
        <block order="1"><m>e^x</m></block>
        <block order="4"><m>x^x</m></block>
      </blocks>
    </exercise>

Am I getting something wrong? I think my source aligns with the example in the pull request.

Rob Beezer

unread,
Jan 2, 2026, 1:35:49 PM (11 days ago) Jan 2
to prete...@googlegroups.com
Normally an #m would live in a #p. Can you give that a go?

On 1/2/26 10:27, Sean Fitzpatrick wrote:
> I am trying to use this for a PROTEUS problem, and the math isn't rendering.
>
> Here is my output in HTML:
>
> Screenshot 2026-01-02 112518.png
>
> This is the source that produced it:
>
>     <exercise label="APEX-PROTEUS-lhosptial-2-v1" component="proteus"
> language="natural">
>       <statement>
>         <p>
>           Place the functions below in order from left to right according to
> the following rule:
>           <m>f(x)</m> is to the left of <m>g(x)</m> if
> <m>\lim_{x\to\infty}\frac{f(x)}{g(x)}=0</m>.
>         </p>
>       </statement>
>       <blocks layout="horizontal" randomize="yes">
>         <block order="5"><m>\sin(x)</m></block>
>         <block order="2"><m>\ln(x)</m></block>
>         <block order="6"><m>\sqrt{x}</m></block>
>         <block order="3"><m>x^3</m></block>
>         <block order="1"><m>e^x</m></block>
>         <block order="4"><m>x^x</m></block>
>       </blocks>
>     </exercise>
>
> Am I getting something wrong? I think my source aligns with the example in the
> pull request.
>
> On Wednesday, April 16, 2025 at 10:43:37 AM UTC-6 gcox...@gmail.com wrote:
>
> In case anyone is interested, I recently submitted this PR <https://
> github.com/RunestoneInteractive/rs/pull/694> to support math in horizontal
> Parsons problems. It appears to be working, but I am sure more kinks must be
> hammered out.
>
> This might be a good way to construct formulas and equations (term-by-term)
> if multiple correct orderings can be supported (for addition/multiplication).
>
> --
> 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/0e641dd1-dc84-48f7-a9ef-639118693712n%40googlegroups.com <https://
> groups.google.com/d/msgid/pretext-dev/0e641dd1-dc84-48f7-
> a9ef-639118693712n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Sean Fitzpatrick

unread,
Jan 2, 2026, 1:57:05 PM (11 days ago) Jan 2
to PreTeXt development
Things get much worse if i put in <p>:

Screenshot 2026-01-02 115619.png

Rob Beezer

unread,
Jan 2, 2026, 2:10:11 PM (11 days ago) Jan 2
to prete...@googlegroups.com
I'd have said the math wasn't being processed based on the first screenshot.
Looks like *nothing* is being processed in the second screenshot.

Are your screenshots from Runestone hosting or "plain HTML"?

I can't think of recent changes on the PreTeXt side that might be responsible.

Doesn't look that RS pull request ever added an example to the PreTeXt Sample
Book, so from my perspective there's not much to go on. Did it ever work?

Rob

On 1/2/26 10:57, Sean Fitzpatrick wrote:
> Things get much worse if i put in <p>:
>
> > github.com/RunestoneInteractive/rs/pull/694 <http://github.com/
> RunestoneInteractive/rs/pull/694>> to support math in horizontal
> > Parsons problems. It appears to be working, but I am sure more kinks must be
> > hammered out.
> >
> > This might be a good way to construct formulas and equations (term-by-term)
> > if multiple correct orderings can be supported (for addition/
> multiplication).
> >
> > --
> > 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-
> <https://groups.google.com/d/msgid/pretext->
> > dev/0e641dd1-dc84-48f7-a9ef-639118693712n%40googlegroups.com
> <http://40googlegroups.com> <https://
> > groups.google.com/d/msgid/pretext-dev/0e641dd1-dc84-48f7- <http://
> groups.google.com/d/msgid/pretext-dev/0e641dd1-dc84-48f7->
> > a9ef-639118693712n%40googlegroups.com?utm_medium=email&utm_source=footer
> <http://40googlegroups.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/7a8a8acd-8c35-4bcf-87ef-159e4c19a895n%40googlegroups.com <https://
> groups.google.com/d/msgid/pretext-
> dev/7a8a8acd-8c35-4bcf-87ef-159e4c19a895n%40googlegroups.com?
> utm_medium=email&utm_source=footer>.

Alex Jordan

unread,
Jan 2, 2026, 2:22:02 PM (11 days ago) Jan 2
to prete...@googlegroups.com
To me it looks like HTML characters (less than sign) are being escaped at some stage where they should not be escaped.

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/MTAwMDAwMS5iZWV6ZXI.1767381009%40pnsh.

Alex Jordan

unread,
Jan 2, 2026, 2:24:07 PM (11 days ago) Jan 2
to prete...@googlegroups.com
If you inspect the page, do you see
<span...
Or do you see 
&lt;span...
?

Andrew Scholer

unread,
Jan 2, 2026, 3:06:02 PM (11 days ago) Jan 2
to prete...@googlegroups.com
I see something in the JS likely related to recent refactoring to remove a JQuery dependency. Will PR it to Brad.

Andrew

Rob Beezer

unread,
Jan 2, 2026, 3:22:49 PM (11 days ago) Jan 2
to prete...@googlegroups.com
And perhaps "somebody" could donate an example of a horizontal Parsons with math
to the Sample Book, once this is sorted. I'm sorta looking sideways at you
Sean, though there are others who may feel a greater sense of responsibility. ;-)

Rob
> gcox...@gmail.com <mailto:gcox...@gmail.com> wrote:
> >      >
> >      > In case anyone is interested, I recently submitted this PR
> <https://
> >      > github.com/RunestoneInteractive/rs/pull/694 <http://
> github.com/RunestoneInteractive/rs/pull/694> <http://github.com/
> <http://github.com/>
> >     RunestoneInteractive/rs/pull/694>> to support math in horizontal
> >      > Parsons problems. It appears to be working, but I am sure
> more kinks must be
> >      > hammered out.
> >      >
> >      > This might be a good way to construct formulas and
> equations (term-by-term)
> >      > if multiple correct orderings can be supported (for addition/
> >     multiplication).
> >      >
> >      > --
> >      > 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> <mailto:pretext- <mailto:pretext->
> >      > dev+uns...@googlegroups.com
> <mailto:dev%2Buns...@googlegroups.com>>.
> >      > To view this discussion visit https://groups.google.com/d/
> msgid/pretext- <https://groups.google.com/d/msgid/pretext->
> >     <https://groups.google.com/d/msgid/pretext- <https://
> groups.google.com/d/msgid/pretext->>
> >      > dev/0e641dd1-dc84-48f7-
> a9ef-639118693712n%40googlegroups.com <http://40googlegroups.com>
> >     <http://40googlegroups.com <http://40googlegroups.com>> <https://
> >      > groups.google.com/d/msgid/pretext-dev/0e641dd1-dc84-48f7-
> <http://groups.google.com/d/msgid/pretext-dev/0e641dd1-dc84-48f7->
> <http://
> > groups.google.com/d/msgid/pretext-dev/0e641dd1-dc84-48f7-
> <http://groups.google.com/d/msgid/pretext-dev/0e641dd1-dc84-48f7->>
> >      > a9ef-639118693712n%40googlegroups.com?
> utm_medium=email&utm_source=footer <http://40googlegroups.com?
> utm_medium=email&utm_source=footer>
> >     <http://40googlegroups.com?utm_medium=email&utm_source=footer
> <http://40googlegroups.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>>.
> > dev/7a8a8acd-8c35-4bcf-87ef-159e4c19a895n%40googlegroups.com
> <http://40googlegroups.com> <https://
> > groups.google.com/d/msgid/pretext- <http://groups.google.com/d/
> msgid/pretext->
> > dev/7a8a8acd-8c35-4bcf-87ef-159e4c19a895n%40googlegroups.com
> <http://40googlegroups.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/MTAwMDAwMS5iZWV6ZXI.1767381009%40pnsh <https://
> groups.google.com/d/msgid/pretext-dev/
> MTAwMDAwMS5iZWV6ZXI.1767381009%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-jreBw90cLCvAG3aN0PYdkpRdc92nh90PAYCrJtT_YJURfw%40mail.gmail.com
> <https://groups.google.com/d/msgid/pretext-dev/CA%2BR-
> jreBw90cLCvAG3aN0PYdkpRdc92nh90PAYCrJtT_YJURfw%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 view this discussion visit https://groups.google.com/d/msgid/pretext-dev/
> CACm44N8HeVMnqdD73vA%3Di-%2B1JD-56zJcVRg1Lu%2BOjczuhOSxbw%40mail.gmail.com
> <https://groups.google.com/d/msgid/pretext-dev/CACm44N8HeVMnqdD73vA%3Di-
> %2B1JD-56zJcVRg1Lu%2BOjczuhOSxbw%40mail.gmail.com?
> utm_medium=email&utm_source=footer>.

Andrew Scholer

unread,
Jan 2, 2026, 3:35:29 PM (11 days ago) Jan 2
to prete...@googlegroups.com
Suggestion: Add two problems on the same page. There turns out to be two issues - one is the JQuery one I mentioned; the other is a preexisting timing related issue with transforming HTML into the draggable block, mathjax loading, and re-rendering the blocks with mathjax. Having multiple problems on the same page makes it more likely that the timing issue appears.

I'm fixing both, but the timing one is more duct-tape work than a proper fix.


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/MTAwMDAyMi5iZWV6ZXI.1767385366%40pnsh.

Sean Fitzpatrick

unread,
Jan 2, 2026, 3:41:53 PM (11 days ago) Jan 2
to PreTeXt development
In the first Parsons block, I think I'm seeing an extra closing div tag:

Screenshot 2026-01-02 133859.png

Sean Fitzpatrick

unread,
Jan 2, 2026, 3:42:37 PM (11 days ago) Jan 2
to PreTeXt development
I will make a duplicate of this question (so there are two on the page) and push things up to Runestone to see how it looks there.

Sean Fitzpatrick

unread,
Jan 2, 2026, 3:45:05 PM (11 days ago) Jan 2
to PreTeXt development
I think Vilma needs this live ASAP, so I might ditch the horizontal mode temporarily.
There are two other horizontal Parsons problems in APEX I can keep for testing.

Reply all
Reply to author
Forward
0 new messages