5 ms·
Yes it's "just" HTML/CSS, but given the wide range of ePub reader capabilities, it's not like you can just take any web page and put it in an .epub. You have be
by ivan_ah 6y ago
Yes it's "just" HTML/CSS, but given the wide range of ePub reader capabilities, it's not like you can just take any web page and put it in an .epub. You have be conservative, and use only basic stuff. Also JavaScript is not supported by most ePub readers, so many of the modern web "dynamic" niceties are not available.
For example, rendering math on the web has been a solved problem for many years thanks to MathJax and KaTeX, but these require JS, so cannot be used in ePubs (unless you know the reader supports scripting).
If anyone is interested, I wrote a mega blog post about my journey to produce decent-looking math equations inside a ePub (and mobi files): https://minireference.com/blog/generating-epub-from-latex/ https://minireference.com/blog/generating-epub-from-latex/
some discussion from when I posted on HN https://news.ycombinator.com/item?id=26356903 https://news.ycombinator.com/item?id=26356903
- bobbylarrybobby 6y agoCouldn’t you just use KaTeX to compile to MathML ahead of time?
- ivan_ah 6y agoYeah, MathML is going to be the "right" way to do this in the long term, but right now not many reader devices support it, so not a viable option. I'm doing testing though, and hopefully going to see more MathML in the future (in browsers and ePub readers).
- salamandersauce 6y agoKobo's do. Apple iBooks does. PocketBooks Android app does (not sure about their readers though). Kindle's don't still. Which I feel is holding back it's use in books at least. It seems like with KFX they will at least convert MathML to images for publishers now? So hopefully that will lead publishers to use it. Out of all my epub math textbooks I have exactly one done with MathML and it's fucking glorious compared to the dogshit image based ones most publishers put out with blurry images intended for the 800x600 readers of 2007 and not modern 300 dpi ones. I had one book where literally 2/3rds of the equations were just missing from the file and unviewable on any device. This started on PAGE 7. I then had to ask the publisher to fix it, which they sort of did by replacing with a PDF version.
- mettamage 6y agoHi Ivan, nice to see you here! Haven't gotten back to my math, but did improve in programming ;-) The struggle to get better at math and find time + motivation for it is real. I'm the high school textbook guy, if that rings any bells.