nbconvert: html tables in markdown are not rendered in latex

All <table> formatting seems completely lost, and each cell is surrounded by newlines.

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Reactions: 3
  • Comments: 20 (15 by maintainers)

Most upvoted comments

For dataframes in particular, it would be helpful to embed the latex data in the notebook, which currently doesn’t happen. It looks like _repr_latex_ exists but returns None?

Solution: pd.set_option("display.latex.repr", True)

I had a pretty trivial table. Using markdown it creates a nice booktabs thing in the pdf, using html it creates the content of each cell one by one in a line. So maybe this is a pandoc issue?

This was not my main issue, but it is a bit inconvenient for pandas dataframes, which by default outputs as html. I just tried

from IPython.display import Latex
Latex(data.to_latex())

but that didn’t result in anything useful (the table was not rendered)

I’m having trouble with this solution here, the styled data frame shows up as:

<pandas.io.formats.style.Styler at 0x1202eed90>

I set the option as: pd.set_option("display.latex.repr", True) Screen Shot 2020-01-25 at 12 14 23 AM

Any advice?

Hey did you solve this by any chance?