Question
Asked By – fulaphex
I want to write a report for classes in Jupyter notebook. I’d like to count some stuff, generate some results and include them in markdown. Can I set the output of the cell to be interpreted as markdown?
I’d like such command: print '$\phi$'
to generate phi symbol, just like in markdown.
In other words, I’d like to have a template made in markdown and insert the values generated by the program written in the notebook. Recalculating the notebook should generate new results and new markdown with those new values inserted. Is that possible with this software, or do I need to replace the values by myself?
Now we will see solution for issue: How to programmatically generate markdown output in Jupyter notebooks?
Answer
The functions you want are in the IPython.display module.
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'))
This question is answered By – Thomas K
This answer is collected from stackoverflow and reviewed by FixPython community admins, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0