![]() |
#106 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
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 03:27 PM. |
![]() |
![]() |
![]() |
#107 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,582
Karma: 7043711
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!
![]() |
![]() |
![]() |
Advert | |
|
![]() |
#108 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,582
Karma: 7043711
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. |
![]() |
![]() |
![]() |
#109 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
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. |
![]() |
![]() |
![]() |
#110 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
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 | |
|
![]() |
#111 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
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 04:51 PM. |
![]() |
![]() |
![]() |
#112 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
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 04:56 PM. |
![]() |
![]() |
![]() |
#113 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,582
Karma: 7043711
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
|
|
![]() |
![]() |
![]() |
#114 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
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.
|
![]() |
![]() |
![]() |
#115 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,582
Karma: 7043711
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Plugin] ePub3-itizer - epub3 output plugin for Sigil | KevinH | Plugins | 435 | 01-19-2023 09:46 PM |
Errors Using plugins with Sigil | increase | Plugins | 3 | 03-06-2020 05:08 AM |
Sigil Plugins! | DiapDealer | Sigil | 33 | 03-19-2016 08:18 PM |
Sigil Plugins (for Sigil 0.7xx Alpha) | DiapDealer | Sigil | 15 | 09-27-2014 05:21 PM |
An epub3 version of Sigil ? | apulia03 | Sigil | 9 | 11-28-2012 01:07 AM |