Skip to main content

A tool to optimize LaTeX projects by converting images and compressing PDFs.

Project description

LatexPDFSizeOptimizer

A tool to optimize LaTeX projects by converting vector graphics to JPG, pre-compiling TikZ figures, and compressing the final PDF.

Features

  • Image Conversion: Recursively converts .eps and .pdf images to .jpg to reduce file size.
  • Dynamic Resizing: Detects exact dimensions of PDF figures to prevent cropping.
  • Smart Caching: Skips redundant conversions using hash-based verification.
  • TikZ Optimization: Extracts tikzpicture environments, compiles them, and replaces them in source.
  • Robust Compilation: Auto-cleans build artifacts to prevent corruption.
  • PDF Compression: Compresses final output to target size using Ghostscript.

Installation

pip install .

Usage

Navigate to your LaTeX project directory and run:

latex-pdf-size-optimizer

(Settings are loaded from latex-pdf-size-optimizer.toml or CLI arguments)

Arguments

Argument Description Default
path Path to project root .
--main-tex Main LaTeX file thesis.tex
--max-size Target PDF size in MB 5.0
--dpi Image resolution 200
--compression Ghostscript setting (/screen, /ebook) /ebook
--exclude Files to exclude []
--dry-run Preview actions without changes False

Example

latex-pdf-size-optimizer --dry-run

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

latex_pdf_size_optimizer-0.1.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

latex_pdf_size_optimizer-0.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file latex_pdf_size_optimizer-0.1.0.tar.gz.

File metadata

File hashes

Hashes for latex_pdf_size_optimizer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2510787f779b2529d7bcbf163251071a921abc357c8f50999220fe78daef8d45
MD5 866a7cbe61faf4ad81f3e8f0ed396f1f
BLAKE2b-256 f8e8165bebd78062a08d176592f809a114a2dba275bd426f86fcad54712c4243

See more details on using hashes here.

File details

Details for the file latex_pdf_size_optimizer-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for latex_pdf_size_optimizer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 869ba628b26602269f1a37dfdf438c4e1d3d22d3d8e945d97d0235bca1c8ee0c
MD5 a281282ba50a5fd99897ed11691ae33c
BLAKE2b-256 fc7a14e0f7eece3a0464176a39aebf01d9e1a391329ef39c36c463a4b9410ba0

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