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
.epsand.pdfimages to.jpgto 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
tikzpictureenvironments, 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
Release history Release notifications | RSS feed
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 latex_pdf_size_optimizer-0.1.1.tar.gz.
File metadata
- Download URL: latex_pdf_size_optimizer-0.1.1.tar.gz
- Upload date:
- Size: 2.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b04bfa51cd761c39b37c7fea420e9395e8b8e2aae1a61ac346a4dad2264d77fc
|
|
| MD5 |
1680812c82de951ffdd7ad527845d1fa
|
|
| BLAKE2b-256 |
b9a70dbe08e3727fa74637a5bcc20c4ee02e2e6acaa6c6d8088f52aa035dae6d
|
File details
Details for the file latex_pdf_size_optimizer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: latex_pdf_size_optimizer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba509b8a730e3973e8fc202bfa2379d7d214d96a127a317b613ce800f1b1d721
|
|
| MD5 |
a67a8abfb331753482abe48c571f6379
|
|
| BLAKE2b-256 |
6b229c15b0896c510ed5860dc8539e0b8e77b9e6cbfe26ca30aa8f37fcc9f2a2
|