我正在尝试将.md转换为包含两种html样式颜色的pdf:
<span style="color:#3297A5">**Like this**</span>
和数学:
$$
J(theta) = frac{1}{2m} [sum_{i=1}^{m}(h_theta(x^{(i)})-y^{(i)})^2 +
lambdasum_{j=1}^{n}(theta_j^2)].
$$
用
pandoc -s -o test.pdf test.md
输出格式和数学精细,但没有颜色。使用此在线 md 来pdf工具 http://www.markdowntopdf.com/我得到正确的颜色,但没有数学,这表明 HTML 样式颜色的 MD 到 PDF 转换是可能的吗?
如果你想
使用CSS来改变颜色,你必须使用wkhtmltopdf而不是LaTeX,例如
$ pandoc input.md --mathjax -t html5 -o output.pdf
(或尝试--mathml
而不是--mathjax
,请参阅Pandoc手册(
或者,您可以使用 LaTeX 模板并在那里进行布局。有关详细信息,请参阅 http://pandoc.org/MANUAL.html#creating-a-pdf