使用数学从Markdown创建ePub文件 [英] Create an ePub file from markdown with math

查看:170
本文介绍了使用数学从Markdown创建ePub文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了相当多的时间试图弄清楚如何制作一个Markdown文件,该文件包含TeX数学并将其转换为可以正确呈现数学运算的ePub文件.

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.

例如:

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 $$

如何将带有上述文本的降价文件转换为ePub文件?

How can I convert a markdown file with the above text into an ePub file?

我已经尝试了使用Pandoc的不同转换方法;但是,我仍然找不到能使数学正确率达到50%的解决方案.

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?

我已经尝试过此解决方案以及其他Pandoc选项均未成功.预先感谢您的帮助.

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

推荐答案

Pandoc具有EPUB3编写器.它将乳胶数学转换为MathML,这是EPUB3读者应该支持的(但不幸的是,很少有).与默认的EPUB2相比,使用pandoc -t epub3强制输出EPUB3.

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.

当然,如果您想要EPUB2输出或不支持MathML的目标阅读器,这对您没有太大帮助.然后,您可以尝试使用--webtex选项,该选项将使用Web服务将TeX转换为图像.

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.

这篇关于使用数学从Markdown创建ePub文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆