At the beginning of my document I have \input{tikzcommands} where tikzcommands.tex contains global settings that I want to use in the TikZ pictures. For example, in this file I define some styles.
The problem, when using the externalize library it doesn't recognizes when something changed with the tikzcommands.tex. I tried to add something like \tikzpicturedependsonfile{tikzcommands.tex} at the beginning of the TikZ environment, but it didn't help.
What is the right way to make figureA.tex (which is included using input) depended on a settings file tikzcommands.tex?
EDIT:
Due to the comment of @Psirus I know that I'm doing something wrong. But I still don't manage to have the desired behavior, even when trying to use mode=list and make. Here is my original pseudo MWE.
First, I load TikZ
\usepackage{tikz}
\usetikzlibrary{snakes,calc,decorations.pathreplacing,patterns}
Then, I have the following
\makeatletter
\IfFileExists{tikzexternal.sty}
{%
\usetikzlibrary{external}%
\tikzexternalize%
\tikzsetexternalprefix{figures/cache/}%
\renewcommand{\todo}[2][]{%
\tikzexternaldisable\@todo[##1]{##2}\tikzexternalenable}%
}%
{%
% Empty else case
}%
\makeatother
Which checks is externalize is available, or not. This part I have to make the code compatible with older distributions of pgf which do not support the externalize package.
Then I have an included file tikzcommands.tex which contains (among other things)
\tikzset{
robot/.style={thick,fill=green!#1},
obstacle/.style={fill=red!80,thick}
}
Finally in the document's body I have inputs of the following form:
\input{./figures/figureA}
In figureA I use the styles robot and obstacle.
I want to use externalize in such a way that even when I just change the file tikzcommands.tex the figures which depend on it will be re-compiled.
I understand that I have to:
- Change the loading of the
externalizepackage. - Add something before each
inputwhich depends on thetikzcommands.tex - Probably change the building workflow. Currently I'm using
latexmkalone.
I tried several combinations but nothing worked for me. I hope someone could draw the way to accomplish this.
\tikzpicturedependsonfileis only supported formode=list and make, which is not the default. What mode are you using? – Psirus Feb 10 at 7:34