Just spouting some thoughts here. iMathAS is the underlying system,
and MyOpenMath is an instance of it that provides open hosting. What
PreTeXt has right now is only for MyOpenMath itself. So it would take
a little work (but maybe not much?) to adjust PTX to get problems from
another iMathAS instance.
You can reference a MOM problem ID, like 2572 and 7492 are the ones
used in the PTX sample article. The pretext script calls these
problems from MOM, where David Lippman has set things up so that a PTX
version of a specified random version the exercise is returned. This
is what you see in the sample article PDF, or the sample article HTML
if configured to make a static version of the problem. If the HTML is
configured to make a live version of the problem, it will be embedded
in an iframe as it is right now at
https://pretextbook.org/examples/sample-article/html/section-myopenmath.html.
There are several issues to overcome for robust support. One is that
in general MOM problems are written by contributors, using HTML for
the problem statement portion. And it is common to find non-semantic
markup in that HTML (like a <b> tag, or inline CSS styling to achieve
some desired visual end). The PTX you get back from that is only ever
going to be a guess (like guessing <em> for the <b>) or is going to be
completely lost (like any inline CSS).
Another issue is that it is not uncommon to find incorrect HTML (like
a <p> tag never gets closed). It's not clear what the PTX that comes
out of that will look like, if it will be valid.
Another issue is that I don't know if more complicated constructions,
like a table with cells spanning multiple columns is supported (that
is, would return usable PTX). Those two examples don't contain an
image, so I wonder if images are supported right now. Extending what
is supported now might need direct assistance from David Lippman.
A WeBWorK exercise coming from the OPL might have some of these
issues, but it is less likely. Mostly because WW was built from the
start to support multiple output formats (PDF and HTML), so that has
helped it have PTX support added. Everything already passes through
presentation macros where you can just define what the "new" PTX
output should be. The fact that MOM exercise statements are written
directly using HTML reveals that HTML is central, and it will be
harder to get good PTX out of the existing MOM problems. As things
stand, it's hard to predict how successful you would be just pulling
in the MOM problems you want to pull in. The next thing to try is to
take those problems and make copies of them in MOM that you edit as
needed to fix things, like say the p tag that was never closed.
On the WW side, you can also write the exercise directly into your PTX
document. This leaves you with a WW problem that is guaranteed to work
for all the PTX purposes. It would be nice to have that for MOM too
(or rather, for iMathAS). But then you would be writing problems from
scratch, and it sounds like the goal is to access the existing MOM
problems.
One more thought. Just because you have an iMathAS installation, I'm
not sure if you necessarily get the libraries of problems that are up
at MOM. I know that it's possible to have an iMathAS instance with
your own private or in-house libraries. With the one you set up, have
you seen if you have those libraries? Can you load problem 7492 from
there? If not, I bet there is a way to get them. But I would guess
that the id numbers might differ, since other iMathAS instances can
make their own private libraries using the same id system. [I may have
a fundamental misunderstanding here.]
Can you provide a small sample of MOM problem ID numbers that you
would like to have? I could do a cursory analysis to assess how well
they will work with the current state of PTX.
> I installed Pretext on a PC with window 10. Did anyone install Pretext on a cloud server?
I think Rob or someone else should give you an answer to this.
On Thu, Feb 4, 2021 at 5:33 PM 'Libin Mou' via PreTeXt development
> To view this discussion on the web visit
https://groups.google.com/d/msgid/pretext-dev/ea77c0c3-00c4-4733-88e6-92a787f0cf60n%40googlegroups.com.