使用 LaTeX 在 reStructuredText 中进行数学运算 [英] Math in reStructuredText with LaTeX

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

问题描述

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

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

我选择的编辑器是 gedit,我发现 reStructuredText Tools for Gedit,其中将运行 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天全站免登陆