The assignment is done in Jupyter, and the submission portal wants a PDF. You choose Download as PDF, or run jupyter nbconvert --to pdf, and get an error saying xelatex wasn't found, or that pandoc is missing. nbconvert makes its PDFs through LaTeX, so it needs a full TeX distribution installed before it produces anything.
Look Scanned can now open .ipynb files directly. Select your notebook on the Jupyter Notebook to Scanned PDF page and it is laid out right in your browser: the Markdown cells, the code and the outputs saved with it. Check the pages in the preview and download a PDF. There is nothing to install, and the notebook isn't uploaded.
One thing up front: Look Scanned makes documents look scanned, so that's what the PDF looks like. That suits a notebook that has to be handed in as a printed-and-scanned copy, or one that should simply read like paper. You can turn rotation, blur and noise down to zero for a cleaner page, but every page is still an image, so the text in the PDF can't be selected or searched.
How to convert an .ipynb file to a scanned PDF
- Run the notebook and save it in Jupyter, JupyterLab, VS Code or Google Colab, so the outputs are stored in the file. In Colab, use File → Download → Download .ipynb.
- Open Jupyter Notebook to Scanned PDF and select the
.ipynbfile. - Go through the preview page by page. Check the code, tables and charts, and set the paper size and margins.
- Adjust the scan effect. Keep blur and noise low so small code stays readable. Pages come out in grayscale by default; choose Colorful to keep the colors of your charts.
- Generate the scanned PDF and download it.
If you'd rather have images, you can export each page as JPG or PNG instead. Our guide to PDF, JPG and PNG explains when each one makes sense. With Pro, Bulk Scan handles several .ipynb files at once.
What appears on the page
- Markdown cells: headings, lists, tables, links and images, including images pasted into a cell.
- Code cells, highlighted for the notebook's language and labeled with their
In [1]:prompts. Long lines wrap instead of running off the page. - Saved outputs under their
Out[1]:prompts: printed text, return values, HTML tables such as pandas DataFrames, and images, so plots from matplotlib or seaborn come through. - Errors, with the full traceback.
- Terminal output as a terminal shows it. Color codes are removed, and a progress bar such as tqdm keeps only its final state rather than every update.
What to know before you start
- Cells aren't run. Look Scanned reads what is saved in the file; there is no kernel. A cell you never ran, or a notebook saved with its outputs cleared, shows code with nothing under it. Run all cells and save before you select the file.
- Math stays as TeX source. Formulas written as
$…$or$$…$$in Markdown cells appear exactly as typed, for example$\alpha + \beta$, rather than as typeset math. - Interactive output doesn't render. Plotly, Bokeh and ipywidgets draw with JavaScript, which isn't run. You get whatever static version the notebook saved alongside, often only a short line of text, or nothing at all. Plots saved as images, such as matplotlib's, are fine.
- Notebooks must be nbformat 4. That's what current Jupyter, JupyterLab, VS Code and Colab write. A very old nbformat 3 notebook is refused; open it in a current Jupyter and save it again to upgrade it.
- Wide tables are squeezed. Tables are fitted to the page width, so a DataFrame with many columns ends up with narrow, wrapped columns.
- Keep your notebook. The PDF is made of page images, like a real scan. Keep the
.ipynbfile to run and edit the code.
The notebook is read and laid out on your own device and isn't uploaded to a server. The one exception is a Markdown cell that shows an image by its web address: your browser fetches that image from the site that hosts it, just as Jupyter would.
When nbconvert is the better choice
If you need selectable text, typeset formulas or a PDF that matches Jupyter's own export, nbconvert is still the right tool. Install a TeX distribution and run jupyter nbconvert --to pdf, or use --to webpdf, which prints through a headless Chromium browser and skips LaTeX altogether. Either way, you can then add the scan effect to that PDF in Look Scanned.
Is your write-up a Markdown or LaTeX file rather than a notebook? Those open too: see Markdown and HTML to scanned PDF and LaTeX to scanned PDF.
Got a notebook that has to go in as a PDF? Try it now.