pandas dataframe to latex table Solved! #863
-
Hi, I've been using jupyter book to create a scientific paper: This worked reasonably well except that I did not manage to get pandas dataframes converted into LaTeX tables. I used the {list-table} to get the dataframes into latex by writing my own converter from dataframe to this format and then pasted it into a markdown cell. ...I've been looking at the MySTNB code to try to understand how to fix this. Could I get some help to point me in the right direction to fix this? I've been experimenting with altering the renderer for mime_type=="text/html": This solution works when building html but still not LaTeX... :( |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I found a solution: the latex builder does not handle the "text/html" mimetype
The conversion pandas dataframe to table works in LaTeX also! |
Beta Was this translation helpful? Give feedback.
I found a solution:
the latex builder does not handle the "text/html" mimetype
if this one is added: "text/html"
https://github.com/martinlarsalbert/MyST-NB/blob/master/myst_nb/core/render.py#L1257
The conversion pandas dataframe to table works in LaTeX also!
This was also explaining why this previously worked in html, but not in latex.