Clone wiki

externalize tikz / Home

Short Description

This script automates the external compilation of tikz source files (TSF).

Long Description

The script searches for TSF within its folder and in all the subfolders. The main tex file's preamble is used for the compilation of all the TSF. The used compiler is specified by the COMPILER variable.

The first time the script runs, all the TSF are compiled and the produced pdfs are moved at the same (sub)folder as the corresponding TSF. The pdfs have the same name as the TSF.

The names and the modification time of the TSF are stored in a pickled dictionary.

On subsequent runs, if there are new TSF or if the old TSF have been modified they are recompiled.


  1. No command line arguments. To change the input, you must edit the corresponding variables.
  2. The script must be placed on the same folder as the main tex file whose name is specified by the MAIN_FILE variable.
  3. The pickled dictionary is stored in a file whose name is specified by the PICKLE_FILE variable.
  4. All the TSF must have the extension specified by the EXT variable.
  5. If in order to compile the TSF you must use packages/options that are not included in the preamble of the main file, then you can specify them in the PREVIEW variable (e.g. the `preview` package).
  6. If there are major changes in the main tex files preamble (font changes etc) then in order to recompile all the TSF, just erase the PICKLE_FILE.