1

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?

Ben K.
  • 1,160
  • 6
  • 20
  • This looks similar http://stackoverflow.com/questions/20685635/pandas-dataframe-as-latex-or-html-table-nbconvert – Stefan Dec 05 '15 at 16:36
  • Yes indeed. I had a second look at the answers and the answer to my question was in the lower ones, so I upvoted that one :-). How can I retract my question? – Ben K. Dec 05 '15 at 17:54

0 Answers0