Skip to main content

tex-minify

A command-line tool to expand \input commands in TeX files and filter BibTeX files based on citations.

Features

  • Recursively expands all \input commands in TeX files
  • Handles relative paths correctly
  • Supports both .tex extension present or not in \input commands
  • UTF-8 encoding support
  • Configurable base directory for input resolution
  • Filter BibTeX files to only keep cited references

Usage

Using uvx (no installation required)

# Minify a TeX file (prints to stdout)
uvx tex-minify minify input.tex

# Save minified output to file
uvx tex-minify minify input.tex -o output.tex

# Specify base directory for \input resolution
uvx tex-minify minify input.tex --base-dir /path/to/tex/files -o output.tex

# Filter BibTeX file to only keep cited references
uvx tex-minify filter-bib paper.tex references.bib -o filtered.bib

Using pip installation

First install:

pip install tex-minify

Then use:

# Minify a TeX file
tex-minify minify input.tex -o output.tex

# Filter BibTeX file
tex-minify filter-bib paper.tex references.bib -o filtered.bib

Using pixi (for development)

# Setup development environment
pixi install
pixi run install

# Run the tool
pixi run -- tex-minify minify input.tex
pixi run -- tex-minify filter-bib paper.tex references.bib

Commands

minify

Process a TeX file and expand all \input commands.

tex-minify minify INPUT_FILE [-o OUTPUT] [--base-dir BASE_DIR]

Arguments:

  • INPUT_FILE: Path to the input TeX file
  • -o, --output: Output file path (optional, defaults to stdout)
  • --base-dir: Base directory for resolving \input paths (optional, defaults to input file directory)

filter-bib

Filter a BibTeX file to only include references that are cited in the TeX file.

tex-minify filter-bib TEX_FILE BIB_FILE [-o OUTPUT]

Arguments:

  • TEX_FILE: Path to the TeX file containing citations
  • BIB_FILE: Path to the BibTeX file to filter
  • -o, --output: Output file path (optional, defaults to stdout)

Error Handling

The tool will exit with a non-zero status code and display an error message if:

  • Input files are not found
  • Referenced \input files are not found
  • Output file cannot be written
  • Any other processing errors occur

Metadata

Release files for tex-minify 0.2.6

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

Source distribution (sdist)

Source distribution for tex-minify 0.2.6
File Size Uploaded
tex_minify-0.2.6.tar.gz 15.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tex-minify 0.2.6
File Interpreter ABI Platform
tex_minify-0.2.6-py3-none-any.whl Python 3 none any Details

Total release size: 20.6 kB

Release files / tex_minify-0.2.6.tar.gz

Download URL tex_minify-0.2.6.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2ff66f9d5b72bd06ae88e41a241e5584ac5b2b38562ba66687b6889593b10080
BLAKE2b-256 checksum
How to use checksums
2882cdd79978ac18b2265e370c8a3a64e6bfbb3a95ca87243001e416307ab41b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 16, 2024.

Transparency log

Release files / tex_minify-0.2.6-py3-none-any.whl

Download URL tex_minify-0.2.6-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c7ae1d2e0610006612ed481fbbb7d5ef9d4159681b22c0af9e7549f0330ff17
BLAKE2b-256 checksum
How to use checksums
facbba8bf627b0a926dcb6b0e9ed2abeb8ab9e3cd16fb510ce0d0d655c8ba2e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 16, 2024.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.6 This release

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.0

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