Git Product home page Git Product logo

pgfcache's Introduction

The pgfcache LaTeX package

What does it do?

pgfcache compiles PGF images to PDF only when needed (i.e., after you made changes to a figure). Otherwise, the static PDF is served, severely cutting compilation time for figure-heavy documents (think tikz-externalize for PGF images). Also, I have specifically designed it to play well with figures that were created with Matplotlib's PGF backend.

Usage

Using the package is easy. A minimal example would be:

\documentclass{article}
\usepackage{pgfcache}

\setpgfpreamble{%
  \usepackage{amsmath}
  <other packages that are needed to compile your PGF images, e.g. fonts>
}

\begin{document}
	\importpgf{path/to/pgffile}{myfigure.pgf}
\end{document}

Your file then has to be compiled with the option -shell-escape to pdflatex, e.g.:

pdflatex -synctex=1 -shell-escape -interaction=nonstopmode "yourfile".tex

You will also have to create a folder called _pgfcache in the parent folder of your TeX document. This is where all the pre-compiled figures will go.

If you specify an output directory (by adding -output-directory=<output> to the pdflatex command above), you should create the _pgfcache folder in that output directory. Additionally, you have to add \usepackage[outdir=<output-dir>]{pgfcache} to the preamble of your LaTeX document (see example).

Troubleshooting

The package has only rudimentary error checks. If you run into errors, you should first check whether your figures are compiled correctly (by looking at the logs in the _pgfcache folder). Chances are, you just need to specify additional packages with \setpgfpreamble, or delete the cache and try again. Otherwise, feel free to contact me or raise an issue.

Also note that pgfcache only works with PDFLaTeX (no XeLaTeX or LuaLaTeX support).

pgfcache's People

Contributors

dionhaefner avatar juupje avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.