![]() |
Calibre mathjax
Hello,
this drives me crazy. I have an ePub with equations and I load mathjax in the <head> section of htmls like that: <script type="text/x-mathjax-config">MathJax.Hub.Config({jax: ["input/MathML","output/SVG"], extensions: ["mml2jax.js"], SVG: {linebreaks: {automatic: true, width:"container"}}});</script> <script type="text/javascript" async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script> When I edit the epub in calibre, equations show perfectly, with linebreaks and all! When I try to read the epub outside the editor in calibre viewer, the equations don't show! What am I doing wrong? I use calibre in mac. thx Elias. |
The calibre viewer includes its own copy of matchjax. You should not be bundling mathjax with your epub. See the demo file http://manual.calibre-ebook.com/typesetting_math.html
|
Thank you for the quick answer. I found out that when I don't include mathjax it shows ok. But what if I need to include mathjax for other browsers/readers?
Also, can I use the configuration part of mathjax to activate line breaking? Thx |
I really would not recommend bundling mathjax with ebooks, that is going to be pretty fragile, not to mention greatly increasing the size of the book.
You use a script tag with type text/x-mathjax-config for doing MathJax config. In it you have access to the MathJax object. Look at the example on the page I linked to earlier. |
I understand your opinion, but native mathml is also unstable and mathjax seems to show ok in ipad.
I am trying to find a way to conditionally load mathjax in the configuration file. I know one can have different configurations for different browsers. But could it be set to not load/ignored if the reader is calibre? After many hours of experimenting with many readers, I found out that readium is pretty good but has a problem of not breaking math lines (I would appreciate if someone knows how to achieve it) and other readers have their own problems. (yes, I have set breaking lines in mathjax config) Calibre seems to show everything perfectly to me... when mathjax is not trying to load... thx Elias |
Conditionally loading is trivial. Simply run a script that inserts a new script tag into the DOM and set the src of the script tag to point to mathjax. Use the epubReadingSystem object to detect reading systems.
|
I can't get maths equations to show correctly in the Editor Preview Panel but works fine in Calibre Viewer.
Is there a simple remedy? Thanks |
Quote:
Moderator Notice Asking the same question again won't get you a different answer - Kovid Goyal already gave you the answer elsewhere, no one is likely to offer a different answer to one given by the creator of calibre. Please read the Mobileread Guidelines - item 3 in particular. BR |
| All times are GMT -4. The time now is 10:54 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.