我正在寻找一种转换“ markdown + tex_math_dollars”的方法,然后使用pandocs将其转换为“ HTML + MathML”文件。我猜想命令行语法是这样的:
pandoc stuff.md -f markdown+tex_math_dollars -t html --mathml
使用pandocs可以吗?
这是我的Pandoc输入文件的样子:
INPUT-FILE:stuff.md
**here** is my markdown + tex_math_dollars file, similar to postings on website math.stackexchange.com:
# header1: this is an equation
$$e=mc^2$$
## header2: this is another equation
$$f=ma$$
这就是我想要的pandoc输出文件,就像纯html和MathML文档一样:
OUTPUT-FILE: stuff.html
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
"http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta charset="utf-8">
<title>Fullest MathML support using MathJax</title>
<!-- MATHML POLYFILL FOR WEB BROWSERS NOT SUPPORTING MATHML NATIVELY.. -->
<script>window.MathJax = { MathML: { extensions: ["mml3.js", "content-mathml.js"]}};</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=MML_HTMLorMML"></script>
</head>
<body>
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block" alttext="E = mc^2">
<mi>E</mi>
<mo>=</mo>
<mi>m</mi>
<msup>
<mi>c</mi>
<mn>2</mn>
</msup>
</math>
</body>