4 ms·
Generating ePub from LaTeX
- ivan_ah 6y agoThe code repo containing the automation scripts and a "demo" book is here: https://github.com/minireference/sample-book https://github.com/minireference/sample-book
- nullifidian 6y agoJust want to note that EPUB 3.0 supports MathML.
- felixr 6y agoWhich readers support ePub 3.0 and MathML? I don't think (full) support is that common. Would be interested in a caniuse.com like overview
- ivan_ah 6y agoInteresting. Do you happen to know which eReader devices (and ePub readers in general) support it? MathML would be so much easier than images!
- acabal 6y agoWebkit-based renderers support it, and AFAIK that means just iBooks, Kobo when using its kepub flavor of epub (but not in regular epubs, which trigger its inferior renderer), and software like Foliate. At Standard Ebooks we use MathML in our core source (see for example the Tractatus[1]) and during build it's rendered to PNG for maximum compatibility since so few ereaders support MathML right now. [1] https://standardebooks.org/ebooks/ludwig-wittgenstein/tractatus-logico-philosophicus/c-k-ogden https://standardebooks.org/ebooks/ludwig-wittgenstein/tracta...
- contravariant 6y agoIn what sense? I thought epub was just the container format, you could put raw LaTeX in it if you really wanted to (though I'm not sure if there's a mime-type for it).
- pjscott 6y agoIf ePub were just a container format, there would be interoperability headaches galore. Part of the ePub standard specifies how to format a book's contents as a mixture of HTML, CSS, and a handful of basic image types that readers are required to support. And now, apparently, MathML.
- OldHand2018 6y agoI enjoy reading descriptions about how various people solve their problems. This is nice! One question I had was why the author uses softcover instead of pandoc. Is it a preference or a technical reason?
- ivan_ah 6y agoThe main reason is to have more control of how the math equations are rendered (the way softcover converts math to images is best-in-class). I also had a bunch of custom macros and environments that I knew how to do by adapting/extending softcover, and comparatively little experience with pandoc filters. That being said, I've recently used pandoc for another project (a paper) and I really liked the result and the functionality (references using BibTex). Also, I see modern pandoc has support for MathML and even image math https://pandoc.org/epub.html#math https://pandoc.org/epub.html#math so will be doing some testing to see how it works...
- OldHand2018 6y agoThanks, that is a great answer!
- jordan_curve 6y agoIf you find success doing this with pandoc, please consider writing another blog post! I’ve had a ton of similar issues in this space and reading your solutions has given me a bunch of ideas.
- jimhefferon 6y agoWhat an interesting article! I learned a couple of very useful things from it for a project I am starting, so thank you. I wonder, OP, if you looked into TeX4ht (https://www.tug.org/tex4ht/ https://www.tug.org/tex4ht/) at all?
- jordan_curve 6y agoNice work. There is not enough support for stuff like this. I’ve wanted forever to have a nice way to convert latex files to html. I wish I could use latex for my static site instead of markdown and I’ve tried a few things but nothing is consistent enough. This gives me a ton of hope!