2016-11-22 75 views
-1

我期待在轉換一個標準的數學用戶輸入鍵入設定輸出諸如標準數學輸入使用python

int(3cos(x)+2)

膠乳

$\int cos(3x) dx$

然後該膠乳表達轉換爲typsetted可以在GUI上實時使用的數學圖像

這怎麼辦?

+2

http://stackoverflow.com/questions/3867028/converting-a-python-numeric-expression-to-latex – Whud

回答

1

您還可以使用sympy將乳膠表達式生成爲圖像。

檢查sympy的文檔。 下面是一個例子:

latexexpr = sin(sqrt(x**2 + 20)) + 1 
preview(latexexpr, viewer='file', filename='result.png') 

結果: Result

+0

大,剛開運行時錯誤RuntimeError:沒有安裝latex程序 –

+0

以爲我已經安裝了texlive,結果不是這個虛擬主機,可能已經解決了這個問題 –

+0

好可愛,謝謝。 –