Consider the following situation. You enjoy TeXing on your local machine, having fun with the latest versions of various packages. For example, exploiting the benefits of TikZ/externalize... or biblatex.
Alas... Your university's TeX installation is old, or your collaborator cannot use your cutting edge packages. Then, a checked out copy on the other system won't compile!
One solution, which I have just used, is to remove all the fancy stuff from the source and make it compatible with the old-style system. This, however, has huge disadvantages; for example now compiling your source (on you local box) takes longer because you cannot take advantage of your latest installed version of TikZ.
Let me focus on the TikZ issue. Is there a way to automize a solution? That is, run a test at the beginning of the compilation, and enable or disable the usage of the externalize package depending on the system the document is currently compiled on?
Does this kind of approach make sense at all?
Edit:
I'm taking the risk of becoming too localized, but I do want to find a solution and to accept an answer here. I tired to use @JosephWright idea as follows:
\makeatletter
\IfFileExists{tikzexternal.sty}
{%
\usetikzlibrary{external}%
\tikzexternalize%
\tikzsetexternalprefix{figures/cache/}%
\renewcommand{\todo}[2][]{%
\tikzexternaldisable\@todo[#1]{#2}\tikzexternalenable}%
}%
{%
}%
\makeatother
When compiling this I get the following error: Illegal parameter number in definition of \reserved@a. which I don't know how to fix... Any ideas?
\@ifpackagelater? – Joseph Wright Oct 23 '12 at 20:12externalizelibrary ofTikZ, then I trying to load it will yield an error, and I won't get a chance to check whether it was loaded or not. – Dror Oct 23 '12 at 20:16\IfFileExistsfirst (for the.code.texfile) – Joseph Wright Oct 23 '12 at 20:19#. – Joseph Wright Nov 01 '12 at 08:02