{"id":9320,"library":"sphinx-jupyterbook-latex","title":"Sphinx Jupyter Book LaTeX","description":"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.","status":"active","version":"1.0.0","language":"python","source_language":"en","source_url":"https://github.com/executablebooks/sphinx-jupyterbook-latex","tags":["sphinx","jupyter-book","latex","documentation","publishing","pdf","executablebooks"],"install":[{"cmd":"pip install sphinx-jupyterbook-latex","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core documentation generation engine that this library extends. Explicitly requires >=3.9 in PyPI metadata.","package":"Sphinx","optional":false},{"reason":"This extension is specifically built to support LaTeX output for Jupyter Book projects and is often included by default in them.","package":"jupyter-book","optional":true},{"reason":"Required system dependency for 'sphinx.ext.imgconverter' (which this extension uses) to convert images like PNG/GIF for LaTeX/PDF output.","package":"ImageMagick","optional":false}],"imports":[{"note":"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.","symbol":"sphinx_jupyterbook_latex","correct":"extensions = ['sphinx_jupyterbook_latex'] # in conf.py"}],"quickstart":{"code":"# 1. Install the library\npip install sphinx-jupyterbook-latex\n\n# 2. Add it to your Sphinx conf.py\n# If you're using Jupyter Book, this extension is often enabled by default.\n# For a standalone Sphinx project, add:\nextensions = [\n    'sphinx_jupyterbook_latex',\n    # other extensions like 'myst_parser', 'jupyter_book_theme', etc.\n]\n\n# 3. Ensure ImageMagick is installed on your system for image conversion\n# Example for Debian/Ubuntu:\n# sudo apt-get install imagemagick\n\n# 4. Build your book to PDF (example using jupyter-book CLI)\n# jupyter-book build --builder latex your_book_folder\n# For Sphinx, use: make latexpdf","lang":"bash","description":"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."},"warnings":[{"fix":"Install `ImageMagick` on your operating system. For Debian-based systems, use `sudo apt-get install imagemagick`.","message":"For 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.","severity":"gotcha","affected_versions":"All versions"},{"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`.","message":"Older 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.","severity":"breaking","affected_versions":"<1.0.0"},{"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.","message":"Embedding 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"The `--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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'1.0.0':55 'align':61 'book':3,7,21,40,68,73 'broader':66 'build':17 'capabl':18 'close':49 'configur':34 'correct':37 'current':57 'design':13 'document':75 'ecosystem':69 'enhanc':15 'executablebook':78 'extens':12 'general':60 'handl':38 'html':52 'jupyt':2,6,20,39,67,72 'jupyter-book':71 'latex':4,8,16,74 'mirror':50 'output':47 'pdf':46,77 'post':31 'post-transform':30 'produc':45 'project':22 'provid':24 'publish':76 'releas':59 'set':26 'sphinx':1,5,11,35,70 'structur':43 'toc.yml':42 'transform':28,32 'updat':63 'version':53,54","created_at":"2026-04-16T18:49:36.816057+00:00","updated_at":"2026-04-16T18:49:36.816057+00:00","problems":{"verify_error":"no import statement found"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.0.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://executablebooks.org/","github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/sphinx-jupyterbook-latex/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"skip","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-05","install_tag":null}}