【发布时间】:2019-01-31 06:16:53
【问题描述】:
我正在使用 Google 的 Colaboratory 平台在 Jupyter 笔记本中运行 python。在标准的 Jupyter 笔记本中,sympy 函数的输出是正确排版的 Latex,但 Colaboratory 笔记本只输出 Latex,如下面的代码 sn-p:
import numpy as np
import sympy as sp
sp.init_printing(use_unicode=True)
x=sp.symbols('x')
a=sp.Integral(sp.sin(x)*sp.exp(x),x);a
导致 Latex 输出如下:
$$\int e^{x} \sin{\left (x \right )}\, dx$$
Rendering LaTeX in output cells in Colaboratory 和 LaTeX equations do not render in google Colaboratory when using IPython.display.Latex 这些问题中引用的答案并不能解决问题。虽然它提供了一种在代码单元的输出中显示 Latex 表达式的方法,但它并没有修复内置 sympy 函数的输出。
关于如何获得 sympy 输出以正确呈现的任何建议?或者这是 Colaboratory notebook 的问题?
【问题讨论】:
标签: latex jupyter-notebook google-colaboratory