如何在python中渲染\ left(\ right)

问题描述 投票:1回答:1

我正在尝试在Ipython终端中打印Latex表达式,所以我正在使用此代码:

from IPython.display import display, Math, Latex

display(Math("$$E[\hat{r_x}(k)] = \dfrac{1}{N} \sum_{n = |k|}^{N-1} \
                  E[x(n)x^*(n-|k|)]=$$"))
display(Math("$$= \dfrac{1}{N} \sum_{n = |k|}^{N-1} r_x(|k|) = \
              \dfrac{r_x(k)}{N} (N-|k|) = r_x(k) \
              ( 1-\dfrac{|k|}{N} )$$"))

但是分数周围的括号看起来并不好,所以我尝试将\left( \right)添加到表达式中,但它只是向我显示:

enter image description here

我希望有一个人可以帮助我。谢谢你的回复。

python ipython
1个回答
1
投票

尝试这些而不是\left( \right)

display(Math("$$ \\big( \Big( \\bigg( \Bigg($$" ))
display(Math("$$ \\big[ \Big[ \\bigg[ \Bigg[$$" ))

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.