great-tables icon indicating copy to clipboard operation
great-tables copied to clipboard

nbconvert's PDF cannot include the table: Add Save as Image

Open Nemecsek opened this issue 1 year ago • 4 comments
trafficstars

Currently a table cannot be correctly imported into a PDF made by nbconvert: issue1

is rendered in PDF like this: issue2

Adding Save as Image would allow a great-table to be included in every kind of document.

Nemecsek avatar Dec 08 '23 09:12 Nemecsek

Currently we use a ._repr_html_() method to produce HTML for jupyter. I wonder if one of these other methods would enable us to give nice outputs in nbconvert PDFs?

https://ipython.readthedocs.io/en/stable/config/integrating.html#custom-methods

Are you using the WebPDFExporter or the PDFExporter? I wonder if the WebPDFExporter would work?

(To render to the PDFExporter, I think we'd need to implement _repr_latex_(), which I think will happen eventually, and is worth tracking!)

machow avatar Dec 08 '23 22:12 machow

+1. I would find this very useful. Specifically, it would be great to have something like https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.savefig.html for GT so that I can manually export a table as a png, for example.

ajfriend avatar Jan 26 '24 18:01 ajfriend

One of the problems with R's gtsave is that it relies on web-tools to generate an image file of the table. This can be really annoying for pipelines running on containers/VMs because it adds a heavy dependency.

Hopefully we can avoid that with this package.

uditrana avatar Jan 30 '24 01:01 uditrana