Swarmauri Tool Jupyter Export LaTeX
Converts a Jupyter NotebookNode into LaTeX using nbconvert; optionally generates a PDF.
Features
- Uses nbconvert’s
LatexExporterwith optional custom template support. - Returns the LaTeX string and (optionally) the path to a generated PDF.
- Accepts inline CSS/JS injection via nbconvert hooks.
Prerequisites
- Python 3.10 or newer.
- nbconvert (with LaTeX/PDF dependencies such as TeXLive or Tectonic if generating PDFs).
- Swarmauri base/core packages (installed automatically).
Installation
# pip
pip install swarmauri_tool_jupyterexportlatex
# poetry
poetry add swarmauri_tool_jupyterexportlatex
# uv (pyproject-based projects)
uv add swarmauri_tool_jupyterexportlatex
Quickstart
import json
import nbformat
from swarmauri_tool_jupyterexportlatex import JupyterExportLatexTool
notebook = nbformat.read("notebooks/example.ipynb", as_version=4)
exporter = JupyterExportLatexTool()
response = exporter(
notebook_node=notebook,
use_custom_template=False,
template_path=None,
to_pdf=True,
)
if "latex_content" in response:
Path("notebooks/example.tex").write_text(response["latex_content"], encoding="utf-8")
if pdf := response.get("pdf_file_path"):
print("PDF saved to", pdf)
else:
print("Error:", response.get("error"))
Tips
- Install a TeX distribution (e.g.,
texlive,tectonic) whento_pdf=True. - Use
use_custom_template=Trueandtemplate_pathto control the LaTeX layout. - Combine with notebook execution tools (execute → export → PDF) for reporting pipelines.
Want to help?
If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.
Metadata
Release files for swarmauri_tool_jupyterexportlatex 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| swarmauri_tool_jupyterexportlatex-0.9.0.tar.gz | 8.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swarmauri_tool_jupyterexportlatex-0.9.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.9 kB
Release files / swarmauri_tool_jupyterexportlatex-0.9.0.tar.gz
| Download URL | swarmauri_tool_jupyterexportlatex-0.9.0.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b45d6bfa9eabd0d076f0e1d1393179fcfd2cf7bd0c0de64dd4816744c14e4e31
|
|
BLAKE2b-256 checksum How to use checksums |
241a94b725931ace95ecd113a44ff173fea2bec072092b1b67a62c643722819d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / swarmauri_tool_jupyterexportlatex-0.9.0-py3-none-any.whl
| Download URL | swarmauri_tool_jupyterexportlatex-0.9.0-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
151e93f55ca23b2fd1308d6674594da75f4e368483704d514a49d5fe0cad3082
|
|
BLAKE2b-256 checksum How to use checksums |
03c79fb3c4213ba6a8e436dde9cb0d207007555e9b89a28efe6d31491bd94a1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|