[HN Gopher] Generating ePub from LaTeX
___________________________________________________________________
Generating ePub from LaTeX
Author : ivan_ah
Score : 75 points
Date : 2021-03-05 13:59 UTC (9 hours ago)
(HTM) web link (minireference.com)
(TXT) w3m dump (minireference.com)
| OldHand2018 wrote:
| I 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 wrote:
| The 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 so will be doing some testing
| to see how it works...
| OldHand2018 wrote:
| Thanks, that is a great answer!
| jordan_curve wrote:
| If 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.
| jordan_curve wrote:
| Nice 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!
| jimhefferon wrote:
| What 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/) at all?
| nullifidian wrote:
| Just want to note that EPUB 3.0 supports MathML.
| ivan_ah wrote:
| Interesting. Do you happen to know which eReader devices (and
| ePub readers in general) support it?
|
| MathML would be so much easier than images!
| acabal wrote:
| Webkit-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/tracta...
| felixr wrote:
| Which 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
| contravariant wrote:
| In 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 wrote:
| If 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.
| ivan_ah wrote:
| The code repo containing the automation scripts and a "demo" book
| is here: https://github.com/minireference/sample-book
___________________________________________________________________
(page generated 2021-03-05 23:02 UTC)