jupyter / jupyter/notebook

Last page is truncated when printing from print preview if there is large code cell

Open
#2,934 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
13.3k
Forks
5.8k
Avg merge
6d 11h
Merged PRs (30d)
7

Description

I often write code in jupyter notebook and then print it into pdf. Sometimes (in about 50% cases) last page in printed pdf is truncated. I think that this happens when there is large code cell in jupyter notebook. I create reduced jupyter notebook, that cause issue. Here is structure of this jupyter notebook:

1. markdown cell
2. large code cell
3. many markdown cells
4. last markdown cell

All markdown cells are just one line cells with one or two words. Code cell can contain anything and have enough lines to not fit into one A4 page. So, someone can confirm this issue doing the following:

* Download ipynb file from [gist.gihub.com](https://gist.github.com/dima74/d8e3de515303139952128d4293ada6df) or from [azure notebooks](https://notebooks.azure.com/diraria/libraries/name)
* Open notebook in Chrome (I think any other broswer is also suitable) or directly in azure notebooks.
* (Optional) add or remove few markdown cells of type (3)
* Open print preview: `File` + `Print Preview`
* Print this file into pdf (`Ctrl` + `P`) with A4 and album orientation

Expected result: all cells are presented in resulting pdf
Actual result: last cell is not presented.

Thanks for reading, thanks if answer something, huge gratitude if fix this.

Contributor guide

Open the contributing guide

Research direction

Start with the reduced notebook from the linked gist, open it in Chrome, and use File > Print Preview before printing to an A4 PDF in landscape orientation. Confirm the large code cell reproduces the missing final markdown cell; done means every cell, including the last one, appears in the resulting PDF.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.