7 ms·
This doesn't work on Overleaf, but locally this setup has saved me quite some time: % Tikz caching (use make -f main.makefile to rebuild figures). \use
by nightcracker 5y ago
This doesn't work on Overleaf, but locally this setup has saved me quite some time:
% Tikz caching (use make -f main.makefile to rebuild figures).
\usetikzlibrary{external}
\tikzexternalize[mode=list and make,prefix=tikzcache/] % Comment out this line to disable caching.
\newcommand{\includetikz}[1]{%
\tikzsetnextfilename{#1}%
\tikzpicturedependsonfile{#1.tikz}%
\input{#1.tikz}%
}
I would have all Tikz sources in a tikz/ directory, and include them where needed using e.g. \includetikz{tikz/foo}. Then the above would add an extra step to the compilation (make -f main.makefile), but in return all images would only be recompiled as necessary and otherwise included as a cached .pdf.
- lervag 5y agoNice; do you by chance combine this with latexmk? If so, how do you add the extra compilation step in latexmk?
- nightcracker 5y agoI don't use latexmk, so I wouldn't know sorry. If you can incorporate it into latexmk you might even be able to use it on Overleaf.