jupyter-book
jupyter-book copied to clipboard
align: center in image directive does not center image
Describe the bug Two things related to images in the jupyter book website:
- In the jupyter book docs: https://jupyterbook.org/content/figures.html, the html tag examples (in the raw html images section) don't render.
- In the myst image directive example, the image is not aligned in the centre of the page.
To Reproduce See (1) here See (2) here
Expected behavior (1) Image should render (2) Figure should be centered
Thanks for catching the HTML tag examples, that was a docs bug I fixed here: https://github.com/executablebooks/jupyter-book/pull/1205
For the second, it seems that the align-center
tag is correctly given, but it isn't having any effect, so I think that's a theme bug.
Would it be helpful for me to post this as a bug in the theme repository? (and am I right in thinking it is here: https://github.com/executablebooks/sphinx-jupyter-book-theme ?)
Nah I think it is OK to keep it here, but let's note in the top-level comment that the sphinx-book-theme repo is where the fix would be: https://github.com/executablebooks/sphinx-book-theme
I've got the same issue in a freshly installed environment: centering images is not working (they are on left) In Jupyter Lab but centering figures still correct
Here is my configuration
name: JBook
channels:
- conda-forge
dependencies:
- _libgcc_mutex=0.1=conda_forge
- _openmp_mutex=4.5=2_gnu
- accessible-pygments=0.0.4=pyhd8ed1ab_0
- alabaster=0.7.13=pyhd8ed1ab_0
- anyio=4.2.0=pyhd8ed1ab_0
- argon2-cffi=23.1.0=pyhd8ed1ab_0
- argon2-cffi-bindings=21.2.0=py310h2372a71_4
- arrow=1.3.0=pyhd8ed1ab_0
- asttokens=2.4.1=pyhd8ed1ab_0
- async-lru=2.0.4=pyhd8ed1ab_0
- attrs=23.1.0=pyh71513ae_1
- babel=2.14.0=pyhd8ed1ab_0
- beautifulsoup4=4.12.2=pyha770c72_0
- bleach=6.1.0=pyhd8ed1ab_0
- brotli-python=1.1.0=py310hc6cd4ac_1
- bzip2=1.0.8=hd590300_5
- ca-certificates=2023.11.17=hbcca054_0
- cached-property=1.5.2=hd8ed1ab_1
- cached_property=1.5.2=pyha770c72_1
- certifi=2023.11.17=pyhd8ed1ab_0
- cffi=1.16.0=py310h2fee648_0
- charset-normalizer=3.3.2=pyhd8ed1ab_0
- click=8.1.7=unix_pyh707e725_0
- colorama=0.4.6=pyhd8ed1ab_0
- comm=0.1.4=pyhd8ed1ab_0
- dataclasses=0.8=pyhc8e2a94_3
- debugpy=1.8.0=py310hc6cd4ac_1
- decorator=5.1.1=pyhd8ed1ab_0
- defusedxml=0.7.1=pyhd8ed1ab_0
- docutils=0.18.1=py310hff52083_1
- entrypoints=0.4=pyhd8ed1ab_0
- exceptiongroup=1.2.0=pyhd8ed1ab_0
- executing=2.0.1=pyhd8ed1ab_0
- fqdn=1.5.1=pyhd8ed1ab_0
- greenlet=3.0.3=py310hc6cd4ac_0
- icu=73.2=h59595ed_0
- idna=3.6=pyhd8ed1ab_0
- imagesize=1.4.1=pyhd8ed1ab_0
- importlib-metadata=7.0.1=pyha770c72_0
- importlib_metadata=7.0.1=hd8ed1ab_0
- importlib_resources=6.1.1=pyhd8ed1ab_0
- ipykernel=6.28.0=pyhd33586a_0
- ipython=8.19.0=pyh707e725_0
- isoduration=20.11.0=pyhd8ed1ab_0
- jedi=0.19.1=pyhd8ed1ab_0
- jinja2=3.1.2=pyhd8ed1ab_1
- json5=0.9.14=pyhd8ed1ab_0
- jsonpointer=2.4=py310hff52083_3
- jsonschema=4.20.0=pyhd8ed1ab_0
- jsonschema-specifications=2023.12.1=pyhd8ed1ab_0
- jsonschema-with-format-nongpl=4.20.0=pyhd8ed1ab_0
- jupyter-book=0.15.1=pyhd8ed1ab_0
- jupyter-cache=0.6.1=pyhd8ed1ab_0
- jupyter-lsp=2.2.1=pyhd8ed1ab_0
- jupyter_client=8.6.0=pyhd8ed1ab_0
- jupyter_core=5.6.0=py310hff52083_0
- jupyter_events=0.9.0=pyhd8ed1ab_0
- jupyter_server=2.12.1=pyhd8ed1ab_0
- jupyter_server_terminals=0.5.1=pyhd8ed1ab_0
- jupyterlab=4.0.9=pyhd8ed1ab_0
- jupyterlab-myst=2.1.0=pyhd8ed1ab_0
- jupyterlab_pygments=0.3.0=pyhd8ed1ab_0
- jupyterlab_server=2.25.2=pyhd8ed1ab_0
- latexcodec=2.0.1=pyh9f0ad1d_0
- ld_impl_linux-64=2.40=h41732ed_0
- libffi=3.4.2=h7f98852_5
- libgcc-ng=13.2.0=h807b86a_3
- libgomp=13.2.0=h807b86a_3
- libnsl=2.0.1=hd590300_0
- libsodium=1.0.18=h36c2ea0_1
- libsqlite=3.44.2=h2797004_0
- libstdcxx-ng=13.2.0=h7e041cc_3
- libuuid=2.38.1=h0b41bf4_0
- libuv=1.46.0=hd590300_0
- libxcrypt=4.4.36=hd590300_1
- libzlib=1.2.13=hd590300_5
- linkify-it-py=2.0.0=pyhd8ed1ab_0
- markdown-it-py=2.2.0=pyhd8ed1ab_0
- markupsafe=2.1.3=py310h2372a71_1
- matplotlib-inline=0.1.6=pyhd8ed1ab_0
- mdurl=0.1.0=pyhd8ed1ab_0
- mistune=3.0.2=pyhd8ed1ab_0
- myst-nb=0.17.2=pyhd8ed1ab_0
- myst-parser=0.18.1=pyhd8ed1ab_0
- nbclient=0.7.4=pyhd8ed1ab_0
- nbconvert-core=7.13.1=pyhd8ed1ab_0
- nbformat=5.9.2=pyhd8ed1ab_0
- ncurses=6.4=h59595ed_2
- nest-asyncio=1.5.8=pyhd8ed1ab_0
- nodejs=20.9.0=hb753e55_0
- notebook-shim=0.2.3=pyhd8ed1ab_0
- openssl=3.2.0=hd590300_1
- overrides=7.4.0=pyhd8ed1ab_0
- packaging=23.2=pyhd8ed1ab_0
- pandocfilters=1.5.0=pyhd8ed1ab_0
- parso=0.8.3=pyhd8ed1ab_0
- pexpect=4.8.0=pyh1a96a4e_2
- pickleshare=0.7.5=py_1003
- pip=23.3.2=pyhd8ed1ab_0
- pkgutil-resolve-name=1.3.10=pyhd8ed1ab_1
- platformdirs=4.1.0=pyhd8ed1ab_0
- prometheus_client=0.19.0=pyhd8ed1ab_0
- prompt-toolkit=3.0.42=pyha770c72_0
- psutil=5.9.7=py310h2372a71_0
- ptyprocess=0.7.0=pyhd3deb0d_0
- pure_eval=0.2.2=pyhd8ed1ab_0
- pybtex=0.24.0=pyhd8ed1ab_2
- pybtex-docutils=1.0.3=py310hff52083_1
- pycparser=2.21=pyhd8ed1ab_0
- pydata-sphinx-theme=0.14.4=pyhd8ed1ab_0
- pygments=2.17.2=pyhd8ed1ab_0
- pysocks=1.7.1=pyha2e5f31_6
- python=3.10.13=hd12c33a_1_cpython
- python-dateutil=2.8.2=pyhd8ed1ab_0
- python-fastjsonschema=2.19.1=pyhd8ed1ab_0
- python-json-logger=2.0.7=pyhd8ed1ab_0
- python_abi=3.10=4_cp310
- pytz=2023.3.post1=pyhd8ed1ab_0
- pyyaml=6.0.1=py310h2372a71_1
- pyzmq=25.1.2=py310h795f18f_0
- readline=8.2=h8228510_1
- referencing=0.32.0=pyhd8ed1ab_0
- requests=2.31.0=pyhd8ed1ab_0
- rfc3339-validator=0.1.4=pyhd8ed1ab_0
- rfc3986-validator=0.1.1=pyh9f0ad1d_0
- rpds-py=0.16.2=py310hcb5633a_0
- send2trash=1.8.2=pyh41d4057_0
- setuptools=68.2.2=pyhd8ed1ab_0
- six=1.16.0=pyh6c4a22f_0
- sniffio=1.3.0=pyhd8ed1ab_0
- snowballstemmer=2.2.0=pyhd8ed1ab_0
- soupsieve=2.5=pyhd8ed1ab_1
- sphinx=5.0.2=pyh6c4a22f_0
- sphinx-book-theme=1.0.1=pyhd8ed1ab_0
- sphinx-comments=0.0.3=pyh9f0ad1d_0
- sphinx-copybutton=0.5.2=pyhd8ed1ab_0
- sphinx-design=0.3.0=pyhd8ed1ab_0
- sphinx-external-toc=0.3.1=pyhd8ed1ab_1
- sphinx-jupyterbook-latex=0.5.2=pyhd8ed1ab_0
- sphinx-multitoc-numbering=0.1.3=pyhd8ed1ab_0
- sphinx-thebe=0.2.1=pyhd8ed1ab_0
- sphinx-togglebutton=0.3.2=pyhd8ed1ab_0
- sphinxcontrib-applehelp=1.0.7=pyhd8ed1ab_0
- sphinxcontrib-bibtex=2.5.0=pyhd8ed1ab_0
- sphinxcontrib-devhelp=1.0.5=pyhd8ed1ab_0
- sphinxcontrib-htmlhelp=2.0.4=pyhd8ed1ab_0
- sphinxcontrib-jsmath=1.0.1=pyhd8ed1ab_0
- sphinxcontrib-qthelp=1.0.6=pyhd8ed1ab_0
- sphinxcontrib-serializinghtml=1.1.9=pyhd8ed1ab_0
- sqlalchemy=2.0.23=py310h2372a71_0
- stack_data=0.6.2=pyhd8ed1ab_0
- tabulate=0.9.0=pyhd8ed1ab_1
- terminado=0.18.0=pyh0d859eb_0
- tinycss2=1.2.1=pyhd8ed1ab_0
- tk=8.6.13=noxft_h4845f30_101
- tomli=2.0.1=pyhd8ed1ab_0
- tornado=6.3.3=py310h2372a71_1
- traitlets=5.14.0=pyhd8ed1ab_0
- types-python-dateutil=2.8.19.14=pyhd8ed1ab_0
- typing-extensions=4.9.0=hd8ed1ab_0
- typing_extensions=4.9.0=pyha770c72_0
- typing_utils=0.1.0=pyhd8ed1ab_0
- tzdata=2023d=h0c530f3_0
- uc-micro-py=1.0.1=pyhd8ed1ab_0
- uri-template=1.3.0=pyhd8ed1ab_0
- urllib3=2.1.0=pyhd8ed1ab_0
- wcwidth=0.2.12=pyhd8ed1ab_0
- webcolors=1.13=pyhd8ed1ab_0
- webencodings=0.5.1=pyhd8ed1ab_2
- websocket-client=1.7.0=pyhd8ed1ab_0
- wheel=0.42.0=pyhd8ed1ab_0
- xz=5.2.6=h166bdaf_0
- yaml=0.2.5=h7f98852_2
- zeromq=4.3.5=h59595ed_0
- zipp=3.17.0=pyhd8ed1ab_0
- zlib=1.2.13=hd590300_5
- pip:
- mdit-py-plugins==0.3.5