I have a Jupyter Lab environment running in a docker container. (This is the guide I used to set up my container). I use it to model data using python and pandas and I am currently working on a real estate investment model.
I am attempting to build nicely formatted report directly from my notebook, which has a mix of markdown, python print() outputs, and pandas dataframe outputs. I export to latex and/or PDF using the following terminal command:
jupyter nbconvert --to pdf --no-input --no-prompt <notebook filename>.ipynb
The output looks pretty clean and professional, except for a couple issues with table formatting.
Issue 1.)
I have a dataframe which is quite wide (15 columns), and happens to be the most important table in the entire report. Unfortunately, columns wrap to several separate tables below making it very difficult read. I am noticing that nbconvert seems to convert this table as text instead of an actual latex table, granted I am very new to latex. Here is what the output looks like in a latex editor:
Exporting to html is a marked improvement over latex/pdf, but if I try to print it to PDF, it just cuts off the last few columns of the table.
Issue 2.)
I have a markdown table in my notebook which looks nice in Jupypter but is a jumbled up mess in the latex output. Here is the output from my latex editor:
Here it is in Jupyter:
I have scoured the internet for a guide that can help me understand the finer points of styling an nbconvert output, but there is not a lot that I could find that would help me in this case (mostly math equation stuff). I am hoping the community can point me in the right direction.



