Search code examples
juliajupyterijulia-notebooknbconvert

Julia DataFrames format in pdf with nbconvert


How can I get a DataFrame in a Julia Notebook to output to a pdf with nbconvert and control the formatting like with knitr::kable or pander tables in an R-markdown document?

Julia notebook:
the following code cell

using DataFrames
A = DataFrame(randn(10, 7))

the pdf from nbconvert shows 10Œ7 DataFrames.DataFrame followed by an un-formatted table. Although display(A) and print(A) show different outputs in the notebook, the pdf from nbconvert shows the same output as the code cell above does in the notebook.

With the Python Markdown Notebook Extension, the following markdown cells display the table in the notebook, but in the nbconvert generated pdf, the DataFrame turns into a one dimensional array.

Test1

{{A}}

Test2

|      |
|------|
|{{A}}|

How can I get output like kable or pander tables in a knitted R-markdown doc in a pdf from a Julia Notebook with nbconvert?

Also on Github.


Solution

  • From Github discussion, nbconvert cannot read the Markdown Notebook Extension html output. Tables should be output from code cells so nbconvert can output them to TeX -> pdf.

    The next follow-on question about which Julia functions can do this best is on StackOverflow