Closed aeisenbarth closed 4 months ago
When you have notebooks that are not executed ("execution_mode": "off") and notebooks that are executed, following images can be distorted.
"execution_mode": "off"
This happens when the executor that was used for the static notebook has saved the size of embedded images:
{ "data": { "image/png": "..." "text/plain": [ "<IPython.core.display.Image object>" ] }, "metadata": { "image/png": { "height": 100, "width": 500 } }, "output_type": "display_data" }
The image size persists onto all following notebooks or cells that are executed by MyST-NB. This does not happen with jupyter lab or nbsphinx.
jupyter lab
nbsphinx
conf.py
exclude_patterns = ["_build", "jupyter_execute"] extensions = ["myst_nb"]
and an index.md:
index.md
```{toctree} example <example.ipynb>
and the attached notebook file.
sphinx-build -b html docs docs/_build
You might see something like this:
(The Github template contains a mistake in the environment command, this project is not jupyter-book, but myst-nb.)
jupyter-book
myst-nb
$ pip freeze | grep -E "myst-nb|Sphinx" myst-nb==1.1.0 Sphinx==7.2.6
Without having looked at the code, I think it could be a static class variable that should be an instance variable.
Describe the bug
When you have notebooks that are not executed (
"execution_mode": "off"
) and notebooks that are executed, following images can be distorted.This happens when the executor that was used for the static notebook has saved the size of embedded images:
The image size persists onto all following notebooks or cells that are executed by MyST-NB. This does not happen with
jupyter lab
ornbsphinx
.Reproduce the bug
conf.py
:and an
index.md
:sphinx-build -b html docs docs/_build
You might see something like this:
List your environment
(The Github template contains a mistake in the environment command, this project is not
jupyter-book
, butmyst-nb
.)