Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 01-30-2024, 03:37 PM   #106
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Old 01-31-2024, 01:48 AM   #107
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
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!!!
RbnJrg is offline   Reply With Quote
Old 02-01-2024, 04:25 PM   #108
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
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.
Attached Files
File Type: epub Temml.epub (579.8 KB, 165 views)
RbnJrg is offline   Reply With Quote
Old 02-01-2024, 04:39 PM   #109
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Old 02-01-2024, 05:03 PM   #110
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Old 02-01-2024, 05:05 PM   #111
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Old 02-01-2024, 05:24 PM   #112
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Old 02-01-2024, 08:44 PM   #113
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,610
Karma: 8399999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by KevinH View Post
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?
Many thanks Kevin. I will try with MathJax 2.7.5 and with MathJax 3 and tex-mml-svg instead of tex-svg. And I will test in Windows because there, in Windows, are the issues.
RbnJrg is offline   Reply With Quote
Old 02-01-2024, 10:47 PM   #114
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Old 02-01-2024, 11:41 PM   #115
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,610
Karma: 8399999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by KevinH View Post
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.
RbnJrg is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 04:32 AM.


MobileRead.com is a privately owned, operated and funded community.