I am using the jupyter/ipython notebook in a class to do data treatment with pandas and write my report all in one document. I wanted to use nbconvert to convert my ipynb file to pdf afterwards. This works mostly fine, but the pandas dataframes which have a nice HTML representation do not get converted nicely via LaTeX.
ipython nbconvert --to pdf My_Report.ipynb
or
ipython nbconvert --to markdown My_Report.md
pandoc -i My_Report.md -o My_Report.pdf
If I want to get nicely formatted LaTeX/pdf tables, I need to do explicitly output LaTeX which does not give you a nice representation in the notebook:
from IPython.display import Latex
Latex(df.to_latex())
Is there a way to get both versions at the same time? HTML in the notebook and clean Latex for the conversion?