| 1 |
# graphicscache |
| 2 |
|
| 3 |
This LaTeX package provides caching of `\includegraphics` calls, with several |
| 4 |
useful effects: |
| 5 |
|
| 6 |
* Recompilations are much faster (10x speedup observed) |
| 7 |
* Images can be postprocessed with `ghostscript` before inclusion, thus: |
| 8 |
* Automatic downscaling to specified DPI |
| 9 |
* Automatic JPEG compression with configurable quality |
| 10 |
* Much smaller files (e.g. 10MB instead of 150MB)! |
| 11 |
|
| 12 |
Note: Due to the one-by-one invocation of `pdflatex` and `ghostscript` for |
| 13 |
each graphics element, the first compilation is typically slower than usual. |
| 14 |
|
| 15 |
Note: graphicscache needs the `\write18` call (also called shell escape). This |
| 16 |
is a security risk if you have untrusted TeX sources. |
| 17 |
|
| 18 |
graphicscache supports **PDFLaTeX** and **LuaLaTeX**, **XeLaTeX** is not supported. |
| 19 |
|
| 20 |
## Quickstart |
| 21 |
|
| 22 |
Compile the package using |
| 23 |
|
| 24 |
latex graphicscache.ins |
| 25 |
|
| 26 |
to generate the file `graphicscache.sty`, which you should place in your TeX |
| 27 |
input path. On Unix systems, this can be done by: |
| 28 |
|
| 29 |
mkdir -p ~/texmf/tex/latex/graphicscache |
| 30 |
cp graphicscache.sty ~/texmf/tex/latex/graphicscache/ |
| 31 |
texhash |
| 32 |
|
| 33 |
Or just drop the graphicscache.sty next to your TeX document. |
| 34 |
|
| 35 |
Activate caching with |
| 36 |
|
| 37 |
\usepackage{graphicscache} |
| 38 |
|
| 39 |
and you are finished. Remember to compile your document with `-shell-escape`, |
| 40 |
like |
| 41 |
|
| 42 |
pdflatex -shell-escape paper.tex |
| 43 |
|
| 44 |
Most LaTeX editors allow you to enable shell escape in their settings. |
| 45 |
|
| 46 |
Your PDF should now re-compile faster and be significantly smaller! |
| 47 |
|
| 48 |
## Releasing |
| 49 |
|
| 50 |
Another feature is creating a "release" tarball containing your TeX sources |
| 51 |
and the downscaled images. **NOTE**: This is not required for using the caching |
| 52 |
& compression features of graphicscache! |
| 53 |
|
| 54 |
Just use the `release.sh` shell script in your source |
| 55 |
directory. In this case it is recommended to place the `graphicscache.sty` file |
| 56 |
in your source tree, since your release target will probably not have it. |
| 57 |
|
| 58 |
# first copy graphicscache.sty and release.sh into your paper directory |
| 59 |
cp ... |
| 60 |
|
| 61 |
# then release! |
| 62 |
bash release.sh paper.tex |
| 63 |
|
| 64 |
After checking `test_release/submission.pdf`, the file `release.tar` can be uploaded |
| 65 |
to arXiv (they will extract it automatically). |
| 66 |
|
| 67 |
## Documentation |
| 68 |
|
| 69 |
For more information, check the package documentation, which you can generate |
| 70 |
with: |
| 71 |
|
| 72 |
pdflatex graphicscache.dtx |