Create an ePub file from markdowns using math

I spent considerable time figuring out how I can take a markup file that contains TeX math and convert it to an ePub file where the math displays correctly.

For instance:

This is a markdown file. Here is a [link](www.example.com). Here is some inline math: $\sigma_{i=1}^n \frac{\mu}{100}$ Here is an equation: $$ y = mx + b $$ 

How to convert a delimited file with the above text to an ePub file?

I experimented with various conversion methods using Pandoc; however, I still cannot find a solution that makes math even 50% correct.

Can anyone help on how I can do this?

I tried this solution as well as another Pandoc option without success. Thanks in advance for your help.

+4
source share
1 answer

Pandoc has an EPUB3 writer. It maps latex math to MathML, which is supposed to be supported by EPUB3 readers (but, unfortunately, few do so yet). Use pandoc -t epub3 to force the output of EPUB3, unlike EPUB2, which is the default.

Of course, this does not help much if you want EPUB2 output or target readers not to support MathML. Then you can try using the --webtex , which will use the web service to convert TeX to image.

+6
source

All Articles