Skip to main content

LaTeX2Bundle

LaTeX2Bundle banner

LaTeX2Bundle packages a LaTeX project into a single ZIP archive. It resolves \\input{} and \\include{}, collects figures and auxiliary files (e.g. .bib, .cls), optionally reduces bibliographies to cited entries, and produces a ready-to-share bundle.


Features

  • Resolves \\input{} and \\include{} directives
  • Copies figures and auxiliary files into a self-contained directory
  • Optionally reduces .bib files to only cited entries
  • Optionally renames figures for portability
  • Produces a single ZIP archive

Usage

latex2bundle path/to/main.tex [options]

Options

  • -c, --copy-files <files...> Include additional files (e.g. extra.bib myclass.cls)

  • -t, --target-dir <dir> Output directory (defaults to the main file’s directory)

    Verbose logging

  • --no-reduce-bib Keep full .bib files (disable citation-based reduction)

  • --no-rename-figures Keep original figure filenames


Examples

# Basic: bundle main.tex into ./bundle and create main.zip
latex2bundle path/to/main.tex

### Mode examples

The `--mode` flag controls what artifacts are produced. Valid values:

- `both` (default): create the cleaned bundle directory and a ZIP archive containing it.
- `zip-only`: create only the ZIP archive and remove the temporary bundle directory.
- `bundle-only`: create and keep the bundle directory but do not create a ZIP file.

Examples:

```bash
# Create both the bundle and the ZIP (default)
latex2bundle path/to/main.tex --mode both

# Produce only the ZIP and remove the bundle directory
latex2bundle path/to/main.tex --mode zip-only

# Produce only the bundle directory without creating a ZIP
latex2bundle path/to/main.tex --mode bundle-only

Combine .bib files

Use the included tool to scan one or more TeX entry files, collect all referenced .bib files (recursing through \input/\include), and produce a single combined .bib containing only the cited entries. The tool also detects conflicting keys and can print sorted entries.

Basic usage:

# scan entry.tex and write combined.bib
python -m latex2bundle.combine_bib entry.tex -o combined.bib

# print conflicts and sorted entries by title (use -L DEBUG for more debug output)
python -m latex2bundle.combine_bib entry.tex --print-conflicts --print-sorted=title -L DEBUG

Notes:

  • The tool follows \input{} and \include{} recursively to find all bibliography references.
  • When duplicate entries (same title) are detected the tool can deduplicate and optionally update TeX files' citation keys to point to the kept key; run with -L DEBUG to see detailed debug output before making changes.

Include extra files with verbose output

latex2bundle path/to/main.tex -c extra.bib myclass.cls -v

Write bundle to a specific directory

latex2bundle path/to/main.tex -t /tmp/output

Disable bibliography reduction and figure renaming

latex2bundle path/to/main.tex --no-reduce-bib --no-rename-figures


---

## License

See `LICENSE`.

Release files for latex2bundle 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for latex2bundle 0.1.4
File Size Uploaded
latex2bundle-0.1.4.tar.gz 13.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for latex2bundle 0.1.4
File Interpreter ABI Platform
latex2bundle-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 26.0 kB

Release files / latex2bundle-0.1.4.tar.gz

Download URL latex2bundle-0.1.4.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
316fe68b9e46d2ba37bc8eab7753b4e4bbbd8f2a7b14f8b8f05a93bdf4aa907b
BLAKE2b-256 checksum
How to use checksums
30b1be3b0f94af6cf48a82982abf89a082209d6e765ab91fa1c8b063e25eddc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / latex2bundle-0.1.4-py3-none-any.whl

Download URL latex2bundle-0.1.4-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cffccfe5109a0f563c02c1ea9e9df0a81ac327baeaa0890be09cd6359bcb8547
BLAKE2b-256 checksum
How to use checksums
d4d50465a25382a6cab5a3cb3b23bd7119f8ba2d2f2194fc00dd96666325f176
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page