0
我有一個Expr的類來表示,其中我定義_repr_latex_方法不Jupyter/IPython的筆記本工作了
def _latex(self):
""":return: string LaTex formula"""
(...)
return res
def _repr_latex_(self):
return r'$%s$'%self._latex() #tried several variations of this...
@property
def latex(self):
from IPython.display import Math
return Math(self._latex())
數學表達式可以在細胞上http://nbviewer.ipython.org/github/Goulu/Goulib/blob/master/notebook.ipynb見[42],膠乳被正確地呈現時由屬性 明確指定,但在通過帶有UnicodeDecodeError的_repr_latex_調用時,下一個單元格失敗。 (e1)._ latex()返回沒有unicode的'\ sin(3x + 2)',那麼這裏有什麼問題? 謝謝!