Registry / web-framework / sphinx-jupyterbook-latex

sphinx-jupyterbook-latex

JSON →
library1.0.0pypypiunverified

Sphinx Jupyter Book LaTeX is a Sphinx extension designed to enhance LaTeX build capabilities for Jupyter Book projects. It provides a set of transforms and post-transforms that configure Sphinx to correctly handle Jupyter Book's `_toc.yml` structure and produce PDF output that closely mirrors the HTML version. Version 1.0.0 is current, and releases generally align with updates in the broader Jupyter Book ecosystem.

pip install sphinx-jupyterbook-latex
INSTALL
IMPORT
SIG · SPHINX-JUPYTERBOOK
S
sphinx-jupyterbook-latex
web-frameworkpythonv1.0.0
Install
5.2s avg
Import
Disk
94MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 92.2MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 5.2s · import 0.000s · 93MB
94MB installed
● package 94MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sphinx_jupyterbook_latex
extensions = ['sphinx_jupyterbook_latex'] # in conf.py
This library is a Sphinx extension and is enabled by adding its name to the 'extensions' list in Sphinx's conf.py. Direct Python imports are rarely needed by end-users.

To get started, install the package via pip. Then, enable the Sphinx extension by adding 'sphinx_jupyterbook_latex' to your `extensions` list in `conf.py`. Note that ImageMagick is a required system dependency for image processing. If building with Jupyter Book, it often handles much of this configuration automatically.

# 1. Install the library pip install sphinx-jupyterbook-latex # 2. Add it to your Sphinx conf.py # If you're using Jupyter Book, this extension is often enabled by default. # For a standalone Sphinx project, add: extensions = [ 'sphinx_jupyterbook_latex', # other extensions like 'myst_parser', 'jupyter_book_theme', etc. ] # 3. Ensure ImageMagick is installed on your system for image conversion # Example for Debian/Ubuntu: # sudo apt-get install imagemagick # 4. Build your book to PDF (example using jupyter-book CLI) # jupyter-book build --builder latex your_book_folder # For Sphinx, use: make latexpdf
Debug
Known issues
gotchaFor proper image conversion (e.g., PNG/GIF to PDF-compatible formats), `sphinx-jupyterbook-latex` utilizes `sphinx.ext.imgconverter`, which in turn requires the system-level tool `ImageMagick` to be installed. Without it, image rendering in PDF output may fail.
fix
Install `ImageMagick` on your operating system. For Debian-based systems, use `sudo apt-get install imagemagick`.
affects: All versions
breakingOlder versions of `sphinx-jupyterbook-latex` (e.g., `0.4.6`) had an upper bound requirement of `sphinx<5`, causing incompatibility issues with Sphinx 5.x.x.
fix
Upgrade `sphinx-jupyterbook-latex` to version `1.0.0` or newer to ensure compatibility with Sphinx 5 and higher: `pip install --upgrade sphinx-jupyterbook-latex`.
affects: <1.0.0
gotchaEmbedding headings (e.g., `## My Heading`) inside admonitions or other content blocks in MyST Markdown can lead to unpredictable breakage of the document structure in Sphinx/Jupyter Book PDF output.
fix
Avoid nesting headings within content blocks. Use bold text or a custom directive if you need to highlight text within such blocks instead of a full heading.
affects: All versions
gotchaThe `--individualpages` LaTeX builder option in Jupyter Book does not fully leverage the improvements introduced by `sphinx-jupyterbook-latex` and uses the default Sphinx LaTeX writer. This may result in inconsistent output compared to the main 'book' PDF.
fix
Be aware of potential formatting differences. If `individualpages` output is critical, consider building the full book PDF and then splitting it, or manually adjusting LaTeX templates (advanced). The ExecutableBooks project is actively working on improving this.
affects: All versions
Upgrade
Version history
1.0.0latest on PyPI · released Dec 11, 2023
Audit
Dependencies
SphinxrequiredCore documentation generation engine that this library extends. Explicitly requires >=3.9 in PyPI metadata.
jupyter-bookoptionalThis extension is specifically built to support LaTeX output for Jupyter Book projects and is often included by default in them.
ImageMagickrequiredRequired system dependency for 'sphinx.ext.imgconverter' (which this extension uses) to convert images like PNG/GIF for LaTeX/PDF output.
Agent activity
13 hits · last 30 days
node
10
OpenAI (training)
1
Resources
sphinx-jupyterbook-latex — pip install sphinx-jupyterbook-latex · libregistry