pythonjupyter-notebooknbconvert

How to disable the header with filename and date when converting .ipynb to pdf with nbconvert?


I am using nbconvert for converting my .ipynb into an .pdf file. When doing so the resulting .pdf file contains a header with the filename and the current date below. How can I disable that?

I was looking in the docs but cannot find how to do it.

CLI command

jupyter nbconvert --to pdf filename.ipynb

Actual

enter image description here

Wanted

enter image description here


Solution

  • I found some helpful pointer in the docs. Just follow these steps:

    1. Run jupyter --paths in your command-line.
    2. Copy the path who looks like /Users/username/.venv/venvName/share/jupyter (I run nbconvert from a venv. Could be different for you).
    3. Go to the path and duplicate the folder latex
    4. Name the folder hide_header or whatever you want
    5. Open base.tex.j2 and delete the line ((* block maketitle *))\maketitle((* endblock maketitle *))
    6. Save
    7. run jupyter nbconvert --to pdf filename.ipynb --template=hide_header