简体   繁体   中英

How to render \left( \right) in python

I'm trying to print a Latex expression in the Ipython terminal, so I'm using this code:

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} )$$"))

But the parenthesis around the fraction doesn't look good, so I tried to add \\left( \\right) to the expression, but it just shows me this:

在此处输入图片说明

I hope someone can help me. Thank you for your responses.

try these instead of \\left( \\right)

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

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM