01-30-2024, 03:37 PM | #106 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Perhaps TeX to MathML javascript library might allow things to work with both a MathJax 3 and a Mathjax 2.7.x polyfill.
Maybe something like: https://github.com/ronkok/Temml UPDATE, After looking at it a bit more it seems the Readium reader just like Sigil only injects a link to its internal MathJax when it detects a mathml math tag on first load of a page. Without a mathml math tag being present, MathJax is never loaded. Last edited by KevinH; 01-30-2024 at 04:27 PM. |
01-31-2024, 01:48 AM | #107 |
Wizard
Posts: 1,610
Karma: 8399999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Thank you very much Kevin! You gave me a lot of valuable information! You told me about Temml; well, that took to me to katex.js and with katex I was able to show TeX equations on Readium (and also in Sigil! ) Scripts plus all fonts take 1MB but the scripts also works with just the "Main" font that takes 400KB. It's very much lighter than MathJax. And equations looks great. Tomorrow I will post an epub so you can watch the results. Many thanks again Kevin!!!
|
Advert | |
|
02-01-2024, 04:25 PM | #108 |
Wizard
Posts: 1,610
Karma: 8399999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Hi Kevin;
I don't know if there is some difference between Sigil for Linux (Arch Linux) and Sigil for Windows but this case makes me think there is. I was able to implement (according to what you suggested) the Ron Kok's "Temml" library and TeX equations are displayed great on Sigil and its plugins (all of them, EpubJS, Bibi Reader AND Readium Lite) BUT on Sigil for Linux, on Windows NOTHING WORKS! Why? Is there anything special with Sigil for Windows that must we know? I attach the testing epub in case you want to give it a glance. |
02-01-2024, 04:39 PM | #109 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Are you sure you enabled Javascript in Sigil Preferences on Windows? Does your js pull in any remote resources? If so you want to enable remote resources in Sigil Preferences as well. Both Sigil and macOS and Windows comes bundled with MathJax but on Linux it is a system install.
Other than that, there really should not be any javascript related differences in Windows. |
02-01-2024, 05:03 PM | #110 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
It does not "work" on macOS either. Although looking with the inspector shows the proper mathml has been injected by your script but the link to MathJax itself is never injected. This is because no math tag exists when Preview is loaded the first time.
So this appears to be a timing issue. When Mathjax is run there is no mathml to process until after your script finishs but by then it is too late. That is why I thought it may not help to use temml in my update to that post. |
Advert | |
|
02-01-2024, 05:05 PM | #111 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
I think that one of the differences is in the old multi pass algorithm used my MathJax 2.x versus the once and done approach used by MathJax 3.
Last edited by KevinH; 02-01-2024 at 05:51 PM. |
02-01-2024, 05:24 PM | #112 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Okay tested things ... if I grab the MathJax.js file from 2.7.5 and insert it into your epub and load it after your scripts, it all works.
If instead I grab the single Mathjax 3 mml-svg.js and include that, nothing works. So basically, order and MathJax version matters. My guess your Arch system is defaulting to a MathJax 2.7.x build somehow for Sigil. I think converting tex to mathml on the fly and then trying with MathJax 3 is going to be an issue due to order and timing. Update: I think there is one other difference between Linux and Win/Mac, typically the Linux Box comes with a full version of MathJax that includes all of mathjax js code including the Tex code. Have you tried things with the MathJax 3 tex-mml-svg.js file instead? Last edited by KevinH; 02-01-2024 at 05:56 PM. |
02-01-2024, 08:44 PM | #113 | |
Wizard
Posts: 1,610
Karma: 8399999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
|
|
02-01-2024, 10:47 PM | #114 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
To test with I used the MathJax.js (it is version 2.75) file that is deep inside the Readium Plugin in the viewer scripts mathjax folder.
|
02-01-2024, 11:41 PM | #115 |
Wizard
Posts: 1,610
Karma: 8399999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Plugin] ePub3-itizer - epub3 output plugin for Sigil | KevinH | Plugins | 456 | 10-27-2024 07:00 AM |
Errors Using plugins with Sigil | increase | Plugins | 3 | 03-06-2020 06:08 AM |
Sigil Plugins! | DiapDealer | Sigil | 33 | 03-19-2016 09:18 PM |
Sigil Plugins (for Sigil 0.7xx Alpha) | DiapDealer | Sigil | 15 | 09-27-2014 06:21 PM |
An epub3 version of Sigil ? | apulia03 | Sigil | 9 | 11-28-2012 02:07 AM |