Skip to main content

Swarmauri publication-export tool for converting Jupyter notebooks into LaTeX and optional PDF artifacts.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_tool_jupyterexportlatex Discord

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 xelatex is 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

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

If you're not sure about the file name format, learn more about wheel file names.

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

Hashes for swarmauri_tool_jupyterexportlatex-0.11.0.dev1.tar.gz
Algorithm Hash digest
SHA256 89e1e6c561ce903a21f9d75fd9bafa1cd9708937aa54aa0abfef0b0fab414ee3
MD5 112ce98b657380e59cb720917ee9728d
BLAKE2b-256 d971cfcd2a707809445c5a3c212f6ed876905f0b5074543230ac8198c0de005b

See more details on using hashes here.

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

Hashes for swarmauri_tool_jupyterexportlatex-0.11.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 a85df39b3aae05df981f1c781527ae690a30a21c66baddef22af32d7ccf49c38
MD5 f4127969656b1cdfd98199fc18b03c7e
BLAKE2b-256 4ae6427bc2e7bcd5c26c58cea7e8bc61f212de840684a6d9853f4b298bbe1282

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page