Create an ePub file from markdown with math

倾然丶 夕夏残阳落幕 提交于 2019-12-10 17:11:02

问题


I've spent a considerable about of time trying to figure out how I can take a markdown file, which contains TeX math and convert it into an ePub file where the math is rendered properly.

For example:

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 can I convert a markdown file with the above text into an ePub file?

I've experimented with different methods of conversion using Pandoc; however, I still can not find a solution which renders the math even 50% correct.

Can anyone provide any help as to how I can do this?

I've tried this solution as well as other Pandoc option without success. Thanks in advance for the help.


回答1:


Pandoc has an EPUB3 writer. It renders latex math into MathML, which EPUB3 readers are supposed to support (but unfortunately still 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 could try using the --webtex option, which will use a web service to convert the TeX to an image.



来源:https://stackoverflow.com/questions/13991893/create-an-epub-file-from-markdown-with-math

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!