jwbuurlage / category-theory-programmers

Category theory in the context of (functional) programming
MIT License
514 stars 38 forks source link

Missing diagrams and theorems in `epub` and `html` #12

Open jwbuurlage opened 7 years ago

jwbuurlage commented 7 years ago

Using these filters:

it may be possible to add diagrams and amsthm environments to all document types.

TODO:

delta4d commented 7 years ago

Hi jwbuurlage, I checked pandoc documents. and http://pandoc.org/epub.html#math says

Pandoc has an EPUB3 writer. It renders LaTeX math into MathML, which EPUB3 readers are supposed to support (but unfortunately few do). Use pandoc -t epub3 to force EPUB3 output, as opposed to EPUB2 which is the default.

Of course, this isn’t much help if you want EPUB2 output or target readers that don’t support MathML. Then you should try using the --webtex option, which will use a web service to convert the TeX to an image.

Calibre could render mathml successfully. But kindle does not.

I have tried --webtex option, but it takes time, and could not find some resources on web.

I have tried iBooks on my iphone, it supports mathml, and can render the epub3 file correctly. But in order to make epub work on other devices, it may need to convert tex to images, which may break some inline equations.

If only to make it work on Kindle. I think there's a workaround. Send the generated pdf to Kindle email with title convert, Kindle will do the converting work to fit the device.


  1. Kindle mathml. https://github.com/michal-h21/tex4ebook
  2. Pandoc scripting. http://pandoc.org/scripting.html
jwbuurlage commented 7 years ago

I see, thanks for taking the time to do some research into this.

I think for the epub in the repository I will opt for MathML to keep it manageable. Still, some of the fonts are missing in my reader, even though MathML is supported (Google Books). These problems are orthogonal to the diagrams/theorem environments however.