Jupyter Notebook fails to properly handle IPython.display Markdown

Answered
from IPython.display import display, Markdown, Latex
display(Markdown('*some markdown* $\phi$'))
# If you particularly want to display maths, this is more direct:
display(Latex('\phi'))
display(Markdown(r'$b = \frac{\epsilon}{2}$'))

Here is the output that I get:
<IPython.core.display.Markdown object>
\phi
<IPython.core.display.Markdown object>

The code is working fine when ran via browser-executed Jupyter Notebook.

I found a Markdown Support module plugin and installed it, but no difference.

Thanks,
Craig
PyCharm 2016.2.3
Sorry that my first post was placed into AppCode -- I did not see that the below window had a pull-down selection.
0
2 comments
Avatar
Permanently deleted user
from IPython.display import display, Math, Markdown, Latex, display_markdown
display(Markdown('*some markdown* $\phi$'))
# If you particularly want to display maths, this is more direct:
display(Latex('\phi'))
display(Markdown(r'$b = \frac{\epsilon}{2}$'))
display(Math(r'$F(k) = \int_{-\infty}^{\infty} f(x) e^{2\pi i k} dx$'))
display(Math(r'$b = \frac{\epsilon}{2}$'))
display(Math(r'$e^x = \sum_{i=0}^\infty \frac{1}{i!}x^i$'))
display(Math(r'$\sum_{n=0}^\infty\frac{u^n}{n!}\Delta^na_i = e^{-u}\sum_{j=0}^\infty\frac{u^j}{j!}a_{i+j} $'))

I continued to look for a solution.  Using display(Math()) works -- and it seems to work with or without the $......$ on each side.  For my purposes, this solution works fine for me -- I'll have to change code that I have already written, but it is an easy change.

I also tried the new Early Access Program for 2016.3 -- Math works, but Markdown does not.

The one problem that I still see is a lack of cell padding before and after the equation.  Can this be changed?

Thanks,

Craig

0

Hi!
Thank you for reporting the problems!

I've created issues dedicated to IPython.display problems on our issue tracker: that is for IPython.display Markdown and that is forIPython.display Math.

0

Please sign in to leave a comment.