Sage notebook 极限表示法

Sage notebook limit representation

在 Sage notebook 中,我想打印函数极限的标准数学符号。

我期待这样的事情:

f = x+1
latex(limit(f, x=0)) + '=' + lim(f, x=0)

打印格式正确的 'lim x->0 x+1 = 1'

当然,我在发布问题后不久就想通了,似乎总是这样。这是我笔记簿中的代码:

show("NOTE: how to print lim")
# raw latex
f = (x^2-1)/(x-1)
Lf = LatexExpr(r'\lim_{x\to\infty}') + latex(f)
show(Lf)
# dummy limit
from sage.calculus.calculus import dummy_limit as lim
Lf = lim(f, x, 0)
out = latex(Lf) + "=" + latex(limit(f, x=0))
show(out)

不是很优雅,真的希望极限有更好的方式以未计算的形式表示自己。