带LaTeX的reStructuredText中的数学 [英] Math in reStructuredText with LaTeX

查看:303
本文介绍了带LaTeX的reStructuredText中的数学的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用轻量级的标记语言在我的大学课堂上做笔记.

I would like to use a lightweight markup language to take notes in my college classes.

我选择的编辑器是gedit,我发现用于Gedit的reStructuredText工具,将运行reStructuredText处理器并在gedit的窗格中呈现HTML.这很棒,而且达到了目标的80%.

My editor of choice is gedit, and I found reStructuredText Tools for Gedit, which will run the reStructuredText processor and render the HTML in a pane in gedit. This is great, and 80% of the way there.

但是对于我的许多班级,我需要在笔记中包括数学方程式或希腊字符.尽管我对LaTeX不太熟悉,但我的理解是它具有这些功能.

But for many of my classes I need to include math equations or greek characters in my notes. Although I'm not very familiar with LaTeX, my understanding is that it has these capabilities.

如何在reST文档中使用LaTeX?是否需要将reST文档处理为LaTeX,然后处理为HTML,还是有更好的方法?降价会更容易吗?我可以根据需要修改gedit插件.

How can I use LaTeX in a reST document? Would the reST document need to be processed into LaTeX, then that rendered into HTML, or is there a better way? Would markdown make this easier? I can modify the gedit plugin if necessary.

最后,有人这样做吗?在纯文本编辑器中做课堂笔记还有其他建议吗?

Lastly, does anyone do this? Any other suggestions for taking class notes in a plain text editor?

谢谢!

推荐答案

从0.8版开始,它本身就受到支持:您不应再使用任何替代方法.语法也非常简单.它与乳胶数学相同,但没有包含$$

Since version 0.8 it is supported natively: You shouldn't use any workaround anymore. The syntax is also very simple. It is the same as latex math, but without the enclosing $$

因此您可以简单地为数学块编写以下内容

So you can simply write the following for a math block

.. math::

   \frac{ \sum_{t=0}^{N}f(t,k) }{N}

或者,如果您想编写内联代码,则可以使用以下代码:

Or if you want to write inline you can use this:

:math:`\frac{ \sum_{t=0}^{N}f(t,k) }{N}`

请注意此处的定界反引号.

notice the delimiting backticks there.

更新:

在较新的版本中,似乎有必要对数学元素使用双反斜杠,因此它是\\frac而不是\frac

in newer versions it seems to be necessary to use a double-backslash for the math elements, so it's \\frac and not \frac

这篇关于带LaTeX的reStructuredText中的数学的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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