Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 03-09-2025, 06:05 PM   #16
wanderson
Enthusiast
wanderson began at the beginning.
 
wanderson's Avatar
 
Posts: 28
Karma: 10
Join Date: Jul 2017
Location: Austin TX USA
Device: Kindle Paperwhite Gen 11, Likebook Mars & TCL NxtPaper 11
Quote:
Originally Posted by tomsem View Post
Because they are starting with LaTeX documents and don't want to translate to MathML?

But it is easy with tools like this: https://temml.org
I'm trying to edit a math-heavy epub document. My goal is to have this document renderable on pure ebook readers (e.g. e-ink devices) as well as in computer-based EPUB renderers. Specifically, I do not wish to rely on having a Javascript engine available to the rendering agent. Therefore, I avoid Mathjax.

I'm working with equations initially written in either LaTeX or ASCIImath code, then rendered into MathML using an online tool like temml (above) or even ASCIImath (https://asciimath.org/). I know that not all HTML or ePub versions directly support MathML, but it is in the current standards. I suppose this is a problem for future me, but right now I use HTML5 / EPUB3 compliant renderers, such as Flow/Firefox on Windows, or a Readium-based app (e.g. R2 reader) on Android-based e-ink devices.

So what (you may be wondering) does this have to do with the Calibre Editor? Well, as far as I can tell, the Calibre Editor still uses Mathjax to render pure MathML. This is not too much of a problem, as it usually gets the general layout correct, but Mathjax version 3 only supports its own fonts, not a specified font which MathML supports natively.

So, if this is indeed the case, is there any way to get the Calibre Editor to render MathML "natively" and avoid piping it through Mathjax?
wanderson is offline   Reply With Quote
Old 03-09-2025, 10:30 PM   #17
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,376
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
In theory it could work, since the editor uses chromium to render which supposedly support mathml and up to date calibre uses a new enough version of Qt WebEngine that it should work, so you can try it without the mathjax canary script and see.
kovidgoyal is online now   Reply With Quote
Advert
Old 03-10-2025, 09:57 AM   #18
wanderson
Enthusiast
wanderson began at the beginning.
 
wanderson's Avatar
 
Posts: 28
Karma: 10
Join Date: Jul 2017
Location: Austin TX USA
Device: Kindle Paperwhite Gen 11, Likebook Mars & TCL NxtPaper 11
Quote:
Originally Posted by kovidgoyal View Post
In theory it could work, since the editor uses chromium to render which supposedly support mathml and up to date calibre uses a new enough version of Qt WebEngine that it should work, so you can try it without the mathjax canary script and see.
I don't use the mathjax script. In the Calibre source file /src/pyj/editor.pyj, the routine check_for_maths() returns True not only if it sees the so-called canary script name, but also returns True if it sees the MathML xmlns namespace declaration. However, I do need to use that same namespace declaration for native MathML to work. So I need to somehow prevent Mathjax from loading in this circumstance.

Any suggestions are welcome.

Last edited by wanderson; 03-10-2025 at 04:33 PM.
wanderson is offline   Reply With Quote
Old 03-10-2025, 10:06 PM   #19
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,376
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Then you are out of luck. You can edit the source code and run from source at best.
kovidgoyal is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle Previewer doesn't support Calibre generated azw3/mobi xtraktor Calibre 3 02-12-2021 09:04 AM
CSS support in the editor vFbjgBDhV Editor 5 11-03-2020 09:25 AM
MathML not working (with Calibre@Archlinux?) nqk Server 4 07-16-2020 04:09 AM
Kindle Previewer 3 versus KDP Online Previewer Contre-jour Kindle Formats 3 05-29-2018 10:05 AM
MathML Support in the Browser? ManDay Onyx Boox 0 01-28-2013 05:21 AM


All times are GMT -4. The time now is 11:12 PM.


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