繁体   English   中英

RST中的LaTeX使用Pandoc处理

[英]LaTeX in RST processed with Pandoc

我想使用ReStructuredText来记笔记,我有时想用LaTeX将方程式添加到笔记中。 我跟着这两个答案的意见这个问题,但他们都没有为我工作。 我有一个名为foo.rst的RST文件, foo.rst包含以下内容:

.. role:: latex(raw)
   :format: latex

==============
This is a test
==============

Test with latex role :latex:`\Delta X`

Test with raw role :raw:`\Delta X`

Test with raw role and $ :raw:`$\Delta X$`

Test with raw role and $ :raw:`$\Delta X$`

然后,当我使用pandoc -o foo.pdf foo.rst将其编译为pdf时,我得到了这个输出。

Imgur

如果我第一次编译到tex,我得到这个:

\section{This is a test}\label{this-is-a-test}

Test with latex role \textbackslash{}Delta X

Test with raw role \textbackslash{}Delta X

Test with raw role and \$ \$\textbackslash{}Delta X\$

Test with raw role and \$ \$\textbackslash{}Delta X\$

它似乎正在逃避rawlatex指令中的文本。 有没有办法使用内联LaTeX与pandoc和RST?

有一个数学指令和一个数学角色应该做的工作:

The area of a circle is :math:`A_\text{c} = (\pi/4) d^2`.

然后:

pandoc -o foo.pdf foo.rst

结果是:

在此输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM