# Math missing in epub

15 views

### Oscar Levin

Jul 19, 2022, 6:28:31 PMJul 19
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

Jul 19, 2022, 11:48:51 PMJul 19
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 view this discussion on the web visit

### Mitch Keller

Jul 20, 2022, 9:48:30 AMJul 20
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

Jul 21, 2022, 7:14:06 AMJul 21
Dear Oscar,

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

Rob

### Oscar Levin

Jul 21, 2022, 9:18:16 AMJul 21
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

Jul 21, 2022, 10:50:02 AMJul 21
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
>
> >>
> >> --
> >> 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
> >> To view this discussion on the web visit
>
> >
>
> --
> 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 on the web visit

### Rob Beezer

Jul 21, 2022, 11:08:05 AMJul 21
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

Jul 21, 2022, 7:02:58 PMJul 21
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

Jul 21, 2022, 8:08:20 PMJul 21
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
>
> >>
> >
>
> --
> 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 on the web visit