scoop-latex-packer
scoop-latex-packer takes a top-level .tex file, resolves its dependencies, and packs them into a .zip suitable for submission to a publisher or to arXiv.
It also validates the resulting archive by re-compiling it in a sterile environment, so you find out before submission whether anything is missing.
Installation
pip install scoop-latex-packer
This installs the slp command (with scoop-latex-packer available as a longer-form alias). The examples below use slp.
Requirements
- Python 3.11 or newer.
latexmkandkpsewhichonPATH. Both ship with every standard TeX distribution (TeX Live, MiKTeX, MacTeX).
Usage
The CLI has three subcommands: pack builds a submission archive, analyze prints what pack would include without writing the archive, and validate verifies that an archive compiles in isolation.
Run slp with no arguments to see the top-level help.
The top-level .tex file argument to pack is optional: if you omit it, slp looks for a unique .tex file containing \documentclass in the current directory and uses that.
If the argument carries a directory component (e.g. papers/preprint.tex or /abs/path/preprint.tex), slp changes into that directory before packing, so all output files — including the resulting .zip — land beside the source.
# Pack the only top-level .tex file in the current directory.
slp pack
# Pack a specific top-level .tex file.
slp pack preprint.tex
# Pack a paper that lives in another directory — slp changes
# into that directory first, so the resulting .zip lands beside the source.
slp pack papers/preprint.tex
slp pack ~/Work/papers/preprint.tex
# Pack for arXiv submission (freezes the minted cache; ships .bib sources).
slp pack --arxiv preprint.tex
# Include extra data files that the recorder doesn't detect (repeat for multiple).
slp pack --extra-file data/run1.csv --extra-file data/run2.csv preprint.tex
# Show what pack would include in the archive without actually writing it.
# Accepts the same flags as `pack` (e.g. --arxiv to preview the prepends).
slp analyze preprint.tex
slp analyze --arxiv preprint.tex
# Verify that the resulting archive compiles with no help from your local
# TEXINPUTS/BIBINPUTS/BSTINPUTS environment.
slp validate preprint.zip
# Keep the extraction directory around for poking at after a failure.
slp validate --keep-tmpdir preprint.zip
slp <subcommand> --help (or scoop-latex-packer <subcommand> --help) lists every option for that subcommand.
Project-local config
A slp.toml file next to the top-level .tex is auto-loaded; CLI flags always win over config values, which in turn win over the built-in defaults.
pack and analyze share the [pack] section; validate reads [validate].
[pack]
arxiv = true
extra-files = ["data/run1.csv", "data/run2.csv"]
[validate]
no-open = true
You can keep several configs side-by-side in the same directory (arxiv.toml, journal-x.toml, …) and pick one with -c / --config:
slp pack -c arxiv.toml preprint.tex
slp pack -c journal-x.toml preprint.tex
Config keys mirror the CLI flag names with hyphens (e.g. freeze-minted = true); the lone exception is include-bibfiles = false, the positive form of --exclude-bibfiles.
Unknown keys produce a warning so typos surface immediately.
A reference examples/slp.toml ships in the development repository (not in the PyPI wheel) with every supported key set to its default value — copy it as a starting point.
Features
- Works with
bibtexandbiber/biblatexbibliographies. - Auto-detects the top-level
.texfile from the presence of\documentclass. - Finds dependent files on
TEXINPUTS,BIBINPUTS, andBSTINPUTS. - Ships bibliography sources (
.bib/.bst) and never the generated.bbl(nor.toc/.lof/.lot); the recipient regenerates them. This avoids the arXiv TeX Live 2025.bblversion-mismatch error, and matches arXiv's current recommendation to upload.bibfiles. --arxivswitch for one-step arXiv preparation. Under arXiv's Submission 1.5 system (2025) this just freezes themintedcache — arXiv now selects the engine interactively and recompiles the bibliography itself, so no\pdfoutput=1is injected.--freeze-mintedfreezes themintedpackage's cache so the archive compiles without--shell-escape(which arXiv disables).validatere-compiles the archive in an isolated temp directory with theTEXINPUTS/BIBINPUTS/BSTINPUTSvariables stripped, catching missing dependencies before you submit.
Limitations
- Files included via relative paths outside the current directory (e.g.
\includegraphics{../somedir/result.pdf}) cannot be packed: the archive layout assumes everything lives at or below the project root.pack(andanalyze) detect these and abort with a non-zero exit and a message naming every offending file, rather than silently producing a broken archive. Move such files under the project directory (and update the reference in your.tex) before packing. - A bibliography resource named with a subdirectory (e.g.
\addbibresource{shared/refs.bib}) that lives outside the project — found through an absoluteBIBINPUTS/BSTINPUTSsearch path — is packed under its bare filename at the archive root, so theshared/part of the reference no longer resolves. Keep such resources under the project directory.validatecatches this case by failing the sterile recompile.
Development
The development repository lives at https://gitlab.com/scoopgroup-public/scoop-latex-packer and contains a tests/ directory with sample .tex and .bib fixtures.
The tests/ directory is excluded from the PyPI wheel and sdist, so end users never see it.
git clone https://gitlab.com/scoopgroup-public/scoop-latex-packer
cd scoop-latex-packer
python -m venv .venv && source .venv/bin/activate
pip install -e .
# Now run pack/validate against the fixtures in tests/.
License
MIT — see LICENSE.
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 scoop_latex_packer-0.1.1.tar.gz.
File metadata
- Download URL: scoop_latex_packer-0.1.1.tar.gz
- Upload date:
- Size: 26.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
733b53d4ee3959d356c3e29f7786c888fdffdbb802067db3950a61f6eb36f97d
|
|
| MD5 |
845871d4eff7fbcfa8d711c689d07b60
|
|
| BLAKE2b-256 |
4b92e9aa3c5e68d32b41069ea42492f03deef6e04fe845a3a1f345d0fcef5443
|
File details
Details for the file scoop_latex_packer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: scoop_latex_packer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 27.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b6167fcca40b586641c7a07afd8c5a8232c1f78fc6dd2706414b3a85c9c40db
|
|
| MD5 |
328eb34756f11e6fe1aacd657eb4c79a
|
|
| BLAKE2b-256 |
aced1703644fad25aed92b2ba45c62bf964619ca59df8e5059b026ac8b3332fa
|