Printing your Notebooks
You may have noticed that printing a notebook from a browser gives you very ugly, badly formatted output. Fortunately, there is a better way and it is available from VS Code itself. It is called nbconvert and it prints notebooks using XeLaTeX based on the XeTeX engine. This is an update of TeX engine supporting a wider range of typography.
How do we print from VSCode?
Open your notebook in VSCode and left click on the ...
symbol to the right of Outline
. Select Export
and then Export
to PDF. Choose the destination folder and export. If there are errors in the export process, nothing will be output. Simply correct the errors and retry. In my case I had trouble printing the birds example and I needed to delete the attached image.
You will likely need the packages Xetex
and Pandoc
. Install these as follows:
$ sudo apt-get update
$ sudo apt-get install texlive-xetex \
texlive-fonts-recommended texlive-plain-generic
$ sudo apt-get install pandoc
If you need it, install the vscode-pdf
extension to view pdf files.
So there you go, the output looks great! Take a look at the bird’s notebook I printed today.
Happy GitHub Printing,
Brian