はじめに
Jupyter Notebook上でSymPyの数式とLaTeXコマンドを組み合わせて表示したい
import sympy
# おまじない
sympy.init_printing()
x = sympy.Symbol('x')
x**2

display
from IPython.display import display
for i in range(5):
f = 1/x**i
display(f)

SymPyからLaTeXへの変換
display(f)
sympy.latex(f)

# LaTeXの表示
from IPython.display import Math
display(Math(r'f_n(x) = \frac{1}{x^n}'))

# 組み合わせる
for i in range(5):
f = 1/x**i
display(Math(r'f_{%d}(x) = %s' % (i, sympy.latex(f))))

おまけ




コード
参考
Is it possible to show print
output as LaTeX in jupyter notebook?
https://stackoverflow.com/questions/48422762/is-it-possible-to-show-print-output-as-latex-in-jupyter-notebook
謝辞
@7shi さん、教えて頂きありがとうございました.