Sandboxed Testing & Portability

latex_it includes tools for building papers inside isolated environments, creating portable publication archives, and compiling legacy documents.


1. Portable Paper Archives (-z and -t)

Creating a Portable Archive (-z / --zip)

When preparing a paper for co-authors, journals, or archival storage, -z creates a clean, self-contained zip archive:

l -z paper.tex

The packager:

To include extra supplementary files or datasets:

l -z paper.tex -- notes.txt data/*.csv

Styles Organization (--inject-styles)

Creating a Flattened Archive (-Z / --zip-flat)

Many journal submission systems (such as Springer Nature, IEEE Author Portal, or Elsevier Editorial Manager) require all LaTeX text to be in a single monolithic .tex file with no \input or \include subdirectories.

-Z (or --zip-flat) automatically inlines all inputs into a single <document>.tex file, retains the compiled .bbl, bundles active figures and styles, and omits redundant subordinate .tex files:

l -Z paper.tex

Like -z, you can combine -Z with -t to verify that the flattened archive builds cleanly in an isolated sandbox:

l -Z -t paper.tex

Packaging Modes Comparison

latex_it provides three distinct packaging modes for sharing, archival, and publication:

Feature Standard Zip (-z) Flat Zip (-Z) arXiv Package (--arxiv)
TeX Structure Multi-file tree preserved Inlined single .tex file Inlined single .tex file
Subordinate .tex Copied into archive Omitted Omitted
Comments (%) Preserved Preserved Stripped by default
Bibliography Copies .bbl and local .bib Copies .bbl and local .bib Copies .bbl (shields biblatex)
Figures & Styles Preserved Preserved Preserved
Figure Sources Companion sources bundled (.fig, .ipe, etc.) Companion sources bundled Strictly excluded (PDF/PNG only)
Metadata File None None Generates arxiv_*_meta.txt
Target Output <doc>.zip <doc>.zip arxiv_<doc>.zip
Primary Use Case Co-authors & general archival Journal submission portals (IEEE, Springer, Elsevier) Direct submission to arXiv.org

2. Offline Sandbox Builds (tools/bws_run)

tools/bws_run builds papers inside a disposable Bubblewrap (bws) sandbox. It guarantees that the build relies only on files inside the project directory:

tools/bws_run /path/to/paper -- latex_it paper.tex

Sandbox Guarantees

To inspect the staged directory without launching the sandbox:

tools/bws_run /path/to/paper --prepare-only

3. Legacy REVTeX 4.0 Compatibility

Papers written before 2010 often use \documentclass{revtex4} (superseded by revtex4-1 and revtex4-2). On modern TeX Live installations, compiling these documents fails with missing class errors.

latex_it includes a small, LPPL-licensed REVTeX 4.0 compatibility tree:

To configure or disable REVTeX 4.0 compatibility in .l.jsonc:

{
  "revtex4": {
    "enabled": true,
    "texmf_dirs": ["~/.local/share/latex_it/texmf"]
  }
}