https://github.com/executablebooks/sphinx-jupyterbook-latex
Supporting LaTeX infrastructure for Jupyter Book
https://github.com/executablebooks/sphinx-jupyterbook-latex
jupyter-book latex sphinx
Last synced: about 2 months ago
JSON representation
Supporting LaTeX infrastructure for Jupyter Book
- Host: GitHub
- URL: https://github.com/executablebooks/sphinx-jupyterbook-latex
- Owner: executablebooks
- License: bsd-3-clause
- Created: 2020-10-19T00:20:23.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-11T15:34:18.000Z (over 2 years ago)
- Last Synced: 2026-01-30T01:45:25.329Z (4 months ago)
- Topics: jupyter-book, latex, sphinx
- Language: Python
- Homepage: https://sphinx-jupyterbook-latex.readthedocs.io
- Size: 231 KB
- Stars: 31
- Watchers: 11
- Forks: 12
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: docs/contributing.md
- License: LICENSE
Awesome Lists containing this project
README
# sphinx-jupyterbook-latex
[](https://sphinx-jupyterbook-latex.readthedocs.io/en/latest/?badge=latest)
Sphinx extension to support LaTeX infrastructure for Jupyter Book.
This repository is a **development** project to improve LaTeX support
in `Jupyter Book`.
## Get started
To get started with `sphinx-jupyterbook-latex`, first install it through `pip`:
```
pip install sphinx-jupyterbook-latex
```
then, add `sphinx_jupyterbook_latex` to your extensions,
in a Sphinx `conf.py`:
```python
extensions = ["sphinx_jupyterbook_latex"]
# autoload the sphinx.ext.imgconverter extension, optional (default is True)
# jblatex_load_imgconverter = True
# turn root level toctree captions into top-level `part` headings, optional (default is to auto-infer)
# jblatex_captions_to_parts = True
```
OR in the jupyterbook `config.yml`:
```yaml
sphinx:
extra_extensions:
- sphinx_jupyterbook_latex
# config:
# jblatex_load_imgconverter: true
# jblatex_captions_to_parts: true
```
## Extension Details
This extension does not provide an actual Sphinx LaTeX theme,
instead it instantiates a number of transforms (for LaTeX builders only) that manipulate the AST into the required format:
1. Overrides some configuration:
- ``latex_engine`` -> ``xelatex``
- ``latex_theme`` -> ``jupyterBook``
- appends necessary LaTeX commands to the preamble
2. When a latex builder is specified:
- Set's up `sphinx.ext.imgconverter` (if `jblatex_load_imgconverter`)
- Replace sub-headers in the root document
- Create headings from the root-level toctree captions (if `jblatex_captions_to_parts`)
- Move bibliographies to the bottom of the document
Issues
------
A list of issues that need to be addressed:
https://github.com/executablebooks/meta/issues/169
Developer Notes
---------------
A [repository that contains many different project configurations](https://github.com/mmcky/ebp-test-projectstructure)
for testing and development is available, along with implementation
idea and notes