CTAN Comprehensive TeX Archive Network

Directory macros/latex/contrib/graphicscache

README.md

graphicscache

This package provides caching of \includegraphics calls, with several useful effects:

  • Recompilations are much faster (10x speedup observed)
  • Images can be postprocessed with ghostscript before inclusion, thus:
    • Automatic downscaling to specified DPI
    • Automatic JPEG compression with configurable quality
    • Much smaller files (e.g. 10MB instead of 150MB)!

Note: Due to the one-by-one invocation of pdflatex and ghostscript for each graphics element, the first compilation is typically slower than usual.

Note: graphicscache needs the \write18 call (also called shell escape). This is a security risk if you have untrusted sources.

graphicscache supports PDF and Lua, XeLaTeX is not supported.

Quickstart

Compile the package using

latex graphicscache.ins

to generate the file graphicscache.sty, which you should place in your input path. On Unix systems, this can be done by:

mkdir -p ~/texmf/tex/latex/graphicscache
cp graphicscache.sty ~/texmf/tex/latex/graphicscache/
texhash

Or just drop the graphicscache.sty next to your document.

Activate caching with

\usepackage{graphicscache}

and you are finished. Remember to compile your document with -shell-escape, like

pdflatex -shell-escape paper.tex

Most editors allow you to enable shell escape in their settings.

Your PDF should now re-compile faster and be significantly smaller!

Releasing

Another feature is creating a "release" tarball containing your sources and the downscaled images. NOTE: This is not required for using the caching & compression features of graphicscache!

Just use the release.sh shell script in your source directory. In this case it is recommended to place the graphicscache.sty file in your source tree, since your release target will probably not have it.

# first copy graphicscache.sty and release.sh into your paper directory
cp ...

# then release!
bash release.sh paper.tex

After checking test_release/submission.pdf, the file release.tar can be uploaded to arXiv (they will extract it automatically).

Documentation

For more information, check the package documentation, which you can generate with:

pdflatex graphicscache.dtx

Download the contents of this package in one zip archive (178.7k).

graphicscache – Cache includegraphics calls

This package provides caching of \includegraphics calls, with several useful effects:

  • Recompilations are much faster (10x speedup observed).
  • Images can be postprocessed with ghostscript before inclusion, thus:
    • Automatic downscaling to specified DPI
    • Automatic JPEG compression with configurable quality
    • Much smaller files (e.g. 10MB instead of 150MB)!

Note: Due to the one-by-one invocation of pdflatex and ghostscript for each graphics element, the first compilation is typically slower than usual.

Note: graphicscache needs the \write18 call (also called shell escape). This is a security risk if you have untrusted sources.

graphicscache supports pdf and Lua; XeLaTeX is not supported.

Packagegraphicscache
Repositoryhttps://github.com/xqms/graphicscache
Version0.4 2022-12-20
Licenses3-clause BSD License
Copyright2018–2021 Max Schwarz
MaintainerMax Schwarz
Contained inTeX Live as graphicscache
MiKTeX as graphicscache
TopicsCompilation
Conditional compilation
Graphics
External code
...
Guest Book Sitemap Contact Contact Author