Swarmauri publication-export tool for converting Jupyter notebooks into LaTeX and optional PDF artifacts.
Project description
Swarmauri Jupyter Export LaTeX Tool
swarmauri_tool_jupyterexportlatex converts a notebook object into LaTeX with nbconvert.LatexExporter and can optionally generate a PDF artifact. It also supports custom LaTeX templates for publication-oriented workflows.
Why
- Produce LaTeX artifacts from notebooks for academic and report-generation workflows.
- Reuse custom templates for publication formatting.
- Optionally bridge notebook output into PDF-ready artifacts from a single tool surface.
Features
- Accepts notebook objects and normalizes them before export.
- Exports LaTeX with
nbconvert.LatexExporter. - Supports custom template directories and files.
- Optionally generates PDF output.
- Falls back to a dummy PDF artifact when
xelatexis unavailable in the local environment.
FAQ
What input does this tool expect?
It expects a notebook object compatible with nbformat.from_dict, not a JSON string and not a notebook file path.
Does it always generate a PDF?
No. PDF generation happens only when to_pdf=True.
What happens if xelatex is missing?
The tool creates a dummy PDF file for testable fallback behavior instead of failing immediately.
Installation
uv add swarmauri_tool_jupyterexportlatex
pip install swarmauri_tool_jupyterexportlatex
Usage
from swarmauri_tool_jupyterexportlatex import JupyterExportLatexTool
notebook = {
"cells": [{"cell_type": "code", "metadata": {}, "source": ["1 + 1"], "outputs": []}],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5,
}
result = JupyterExportLatexTool()(
notebook_node=notebook,
to_pdf=False,
)
print(result["latex_content"][:200])
Examples
Export LaTeX only
result = JupyterExportLatexTool()(
notebook_node=notebook,
use_custom_template=False,
to_pdf=False,
)
Export LaTeX and request PDF output
result = JupyterExportLatexTool()(
notebook_node=notebook,
to_pdf=True,
)
print(result.get("pdf_file_path"))
Related Packages
swarmauri_tool_jupyterexporthtmlswarmauri_tool_jupyterexportmarkdownswarmauri_tool_jupyterexportpythonswarmauri_tool_jupyterexecuteandconvertswarmauri_tool_jupyterexecutenotebook
Foundational Swarmauri Packages
More Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swarmauri_tool_jupyterexportlatex-0.11.0.dev1.tar.gz.
File metadata
- Download URL: swarmauri_tool_jupyterexportlatex-0.11.0.dev1.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89e1e6c561ce903a21f9d75fd9bafa1cd9708937aa54aa0abfef0b0fab414ee3
|
|
| MD5 |
112ce98b657380e59cb720917ee9728d
|
|
| BLAKE2b-256 |
d971cfcd2a707809445c5a3c212f6ed876905f0b5074543230ac8198c0de005b
|
File details
Details for the file swarmauri_tool_jupyterexportlatex-0.11.0.dev1-py3-none-any.whl.
File metadata
- Download URL: swarmauri_tool_jupyterexportlatex-0.11.0.dev1-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a85df39b3aae05df981f1c781527ae690a30a21c66baddef22af32d7ccf49c38
|
|
| MD5 |
f4127969656b1cdfd98199fc18b03c7e
|
|
| BLAKE2b-256 |
4ae6427bc2e7bcd5c26c58cea7e8bc61f212de840684a6d9853f4b298bbe1282
|