How to remove or change the header of jupyter notebooks pdf in Visual Studio Code?

Question:

I am in Visual Studio Code and I have created the following jupyter notebook:

enter image description here

I would like to know how to remove or modify the pdf header (circled in red below) produced when I export this notebook to pdf with VSCode.

enter image description here

I know this is a similar header to a latex document produced with maketitle, but I don’t know how to remove it or how to change the title, add authors or change the date. I would also like to know how to reduce the margins of the pdf produced (in my latex document I use geometry for).

Thanks for your help :

Asked By: emerick biron

||

Answers:

In fact, the best way to convert jupyter files to PDF is not through vsocd or notepad. We can open jupyter files through Chrome browser, and then convert them to PDF by printing, so that no title can be adjusted, and row spacing can be adjusted in print.

Answered By: MingJie-MSFT

I didn’t find a satisfying solution: you would have to edit the notebook’s metadata (in JSON).
For now, I:

  • export the notebook as LaTeX source (e.g. jupyter-nbconvert --to latex my_notebook.ipynb)

  • edit the generated .tex file to adjust title and author.

  • compile it to pdf (pdflatex or your favorite tool).

Answered By: emmv