Math missing in epub

21 views
Skip to first unread message

Oscar Levin

unread,
Jul 19, 2022, 6:28:31 PM7/19/22
to PreTeXt development
I've built a number of different pretext projects into epub today, and every time when I open them in calibre, there is no math.  Looking in the temporary directories, mj-input-latex.html has lots of math in it.  The epub does not.  Looking at the xhtml files from the unzipped epub shows no math either.

Is this something wrong with my setup?  Can someone else test please?

Thanks,
Oscar.

Rob Beezer

unread,
Jul 19, 2022, 11:48:51 PM7/19/22
to prete...@googlegroups.com
Dear Oscar,

Math looks great in Calibre with the following incantation. On Linux. Yes, I
still have a "mathbook" directory. ;-)

~/mathbook/mathbook/pretext/pretext -vv -c all -f epub-svg -p
~/mathbook/mathbook/examples/epub/publication.xml
~/mathbook/mathbook/examples/epub/epub-sampler.xml

There should be a "math-representations" file in one of the temporary
directories, see if there are SVG versions in there?

Rob
> --
> 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>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-dev/dade2367-80d9-4114-91ec-750fe20de8c9n%40googlegroups.com
> <https://groups.google.com/d/msgid/pretext-dev/dade2367-80d9-4114-91ec-750fe20de8c9n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Mitch Keller

unread,
Jul 20, 2022, 9:48:30 AM7/20/22
to prete...@googlegroups.com
I’ve tested the EPUB sampler and Applied Combinatorics on macOS as well, and the math shows up in Calibre and the Books app.
> 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/c1f5c792-732a-9cb4-0af5-06b4a22c6c10%40ups.edu.

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

http://www.rellek.net/

Rob Beezer

unread,
Jul 21, 2022, 7:14:06 AM7/21/22
to prete...@googlegroups.com
Dear Oscar,

Any progress on this one? We are scratching our heads.

Rob

Oscar Levin

unread,
Jul 21, 2022, 9:18:16 AM7/21/22
to PreTeXt development
Thanks Rob and Mitch.  Got back into it this morning and I'm scratching my head as well.  Everything works as expected on Ubuntu and Windows Subsystem for Linux (i.e. Ubuntu).  But no math in Windows.

Digging a little deeper (on Windows), the "math-representations-svg.xml" file has lots of math in it.  The "math-representations-speech.xml" has content, but the elements appear to be empty (i.e., `<pi:math context="me" id="me-1"><div class="speech"/></pi:math>` and similar lines for each of the ids).

Fishy messages on the console:  After PTX:DEBU calling mathjax to convert latex from ...mj-input-latex.html into raw representations as speech... I have "Unable to load local: base" and "Unable to load local: en" and then a bunch of "Something went wrong computing speech" (20 of them).  Then PTX:DEBU packaging math as speech from ... into ...

On Ubuntu, I don't get the fishy messages, in particular I do NOT see the "unable to load local: base/en" messages.  

Cheers,
Oscar. 

Rob Beezer

unread,
Jul 21, 2022, 10:50:02 AM7/21/22
to prete...@googlegroups.com
I'm guessing the point of failure is when node executes our script:

script/mjsre/mj-sre-page.js

since the output file is built, yet no conversion takes place.

I don't know enough JS to make further suggestions, but perhaps you can put some
debugging print statements in there to get an indication of if that is the
location, and perhaps *where* within that script?

Rob
> <https://groups.google.com/d/msgid/pretext-dev/dade2367-80d9-4114-91ec-750fe20de8c9n%40googlegroups.com><https://groups.google.com/d/msgid/pretext-dev/dade2367-80d9-4114-91ec-750fe20de8c9n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/pretext-dev/dade2367-80d9-4114-91ec-750fe20de8c9n%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.
> >> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-dev/c1f5c792-732a-9cb4-0af5-06b4a22c6c10%40ups.edu
> <https://groups.google.com/d/msgid/pretext-dev/c1f5c792-732a-9cb4-0af5-06b4a22c6c10%40ups.edu>.
>
> >
>
> --
> 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>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-dev/e19089e9-f72a-4bcc-bf00-202d564a42abn%40googlegroups.com
> <https://groups.google.com/d/msgid/pretext-dev/e19089e9-f72a-4bcc-bf00-202d564a42abn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Rob Beezer

unread,
Jul 21, 2022, 11:08:05 AM7/21/22
to prete...@googlegroups.com
And thinking some more. Could your version of node lag behind what the latest
MathJax assumes? (But maybe you would not have met requirements via an npm
install in that case?)

Oscar Levin

unread,
Jul 21, 2022, 7:02:58 PM7/21/22
to PreTeXt development
I've found at least part of the issue: the math representation file and temp directory were being passed to xsltproc via a stringparam, so they need to be in posix format.  Pull request at https://github.com/PreTeXtBook/pretext/pull/1799

Something is still wrong with speech, but at least for epub, this isn't strictly needed.

Oscar.

Rob Beezer

unread,
Jul 21, 2022, 8:08:20 PM7/21/22
to prete...@googlegroups.com
Dear Oscar,

Nice job tracking that down. Similar manipulations are needed to pass the path
of the publisher file into the XSLT processing. So maybe I should have thought
of that. Now, or earlier. Almost certainly the braille conversion might suffer
from the same sort of problem.

Rob
> <https://groups.google.com/d/msgid/pretext-dev/e19089e9-f72a-4bcc-bf00-202d564a42abn%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/pretext-dev/e19089e9-f72a-4bcc-bf00-202d564a42abn%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...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-dev/4d301100-db94-4083-9b99-43b4ef031601n%40googlegroups.com
> <https://groups.google.com/d/msgid/pretext-dev/4d301100-db94-4083-9b99-43b4ef031601n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Rob Beezer

unread,
Jul 21, 2022, 8:23:39 PM7/21/22
to prete...@googlegroups.com
On 7/21/22 17:07, Rob Beezer wrote:
> Almost certainly the braille conversion might suffer
> from the same sort of problem.

I see you were all over that! Thanks.

Rob
Reply all
Reply to author
Forward
0 new messages