小编moo*_*oos的帖子

Emacs preview-latex用于格式化python注释和文档字符串

我最喜欢的Emacs功能之一是preview-latex软件包:它将LaTeX文档中的LaTeX方程式渲染为内嵌图形.像这样:

预览 - 乳胶截图

我想在Emacs中为Python注释和函数文档字符串提供类似的功能.我的docstrings中有很多数学:

def proj_levenberg(x,y,wsqrt,A):
    """
    Finds a homography between two sets of 2d points.

    Specifically, approximately minimize the weighted image plane
    error

       min_A  sum_{X,y,w}  w  ||(A_12 x_) /  (A_3 x_)  -  y||^2

    where x_=[x;1], A_12 are the first two rows of A and A_3 is the
    third row of A.
    ...
Run Code Online (Sandbox Code Playgroud)

我想在LaTex中编写这些内容,这样当我浏览代码时,我可以看到呈现的文档字符串和注释.

有没有办法做到这一点,还是我必须做预览乳胶手术?

python emacs latex

4
推荐指数
1
解决办法
829
查看次数

标签 统计

emacs ×1

latex ×1

python ×1