Robust arXiv LaTeX cleaner with DPI-based image rescaling.
pip install arxivit
# Create an uploadable archive: /path/to/paper.arxiv.tar.gz
arxivit /path/to/paper/main.tex
# Convert images to JPEG at max 300 DPI in the final PDF and save to dir /path/to/output
arxivit /path/to/paper/main.tex --image-options 'jpeg,300dpi' --output /path/to/output
# Convert images to max 300 DPI in the final PDF, images in figures/pca/ to max 1000px
arxivit /path/to/paper/main.tex --image-options '300dpi' --image-options 'figures/pca/*:1000px'
For more options, run:
arxivit --help
arxiv-latex-cleaner
statically analyzes LaTeX source code, which has some limitations:
- It does not reliably track dependencies in all scenarios—e.g., when images are included via complex macros that obscure their filenames in the source code.
- It only supports fixed-size image rescaling, without considering how large an image appears in the final compiled PDF.
arxivit
takes a different approach:
- It uses
latexmk
to compile the LaTeX source code. - It analyzes the compilation log to determine which
.tex
files and images are included, as well as their sizes in the final PDF. - It rescales images to the desired DPI based on their actual dimensions in the final document, ensuring uniform sharpness while minimizing file size.
- It uses
latexpand
to strip comments from.tex
files.