Skip to main content

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

Project description

LatexPDFSizeOptimizer Icon

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.1.tar.gz (2.2 MB 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.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for latex_pdf_size_optimizer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b04bfa51cd761c39b37c7fea420e9395e8b8e2aae1a61ac346a4dad2264d77fc
MD5 1680812c82de951ffdd7ad527845d1fa
BLAKE2b-256 b9a70dbe08e3727fa74637a5bcc20c4ee02e2e6acaa6c6d8088f52aa035dae6d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for latex_pdf_size_optimizer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ba509b8a730e3973e8fc202bfa2379d7d214d96a127a317b613ce800f1b1d721
MD5 a67a8abfb331753482abe48c571f6379
BLAKE2b-256 6b229c15b0896c510ed5860dc8539e0b8e77b9e6cbfe26ca30aa8f37fcc9f2a2

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