This could be automated even further, and it would be nice if the hyperlinks were the same size as the nodes, but it shows - I think - the main idea.
\documentclass{article}
%\url{http://tex.stackexchange.com/q/61020/86}
\usepackage{tikz}
\usetikzlibrary{positioning}
\tikzset{box1/.style={draw=black, thick, rectangle,rounded corners, minimum height=2cm, minimum width=2cm}}
\usepackage{hyperref}
\colorlet{picture-1-1}{red}
\colorlet{picture-2-1}{blue}
\colorlet{picture-3-1}{orange}
\colorlet{picture-4-1}{green}
\colorlet{picture-1-0}{white}
\colorlet{picture-2-0}{white}
\colorlet{picture-3-0}{white}
\colorlet{picture-4-0}{white}
\begin{document}
\foreach \n in {0,...,15} {
\pgfmathtruncatemacro\i{mod(\n,2)}
\pgfmathtruncatemacro\j{mod(int(\n/2),2)}
\pgfmathtruncatemacro\k{mod(int(\n/4),2)}
\pgfmathtruncatemacro\l{mod(int(\n/8),2)}
\pgfmathparse{\i == 0 ? "\noexpand\hyperlink{picture-1-\j-\k-\l}{1}" : 1}
\let\pictexti=\pgfmathresult
\pgfmathparse{\j == 0 ? "\noexpand\hyperlink{picture-\i-1-\k-\l}{2}" : 2}
\let\pictextj=\pgfmathresult
\pgfmathparse{\k == 0 ? "\noexpand\hyperlink{picture-\i-\j-1-\l}{3}" : 3}
\let\pictextk=\pgfmathresult
\pgfmathparse{\l == 0 ? "\noexpand\hyperlink{picture-\i-\j-\k-1}{4}" : 4}
\let\pictextl=\pgfmathresult
\hypertarget{picture-\i-\j-\k-\l}{%
\begin{tikzpicture}
\node[box1, fill=picture-1-\i] (c1) {\pictexti};
\node[box1, fill=picture-2-\j, right=1cm of c1] (c2) {\pictextj};
\node[box1, fill=picture-3-\k, below=1cm of c2] (c3) {\pictextk};
\node[box1, fill=picture-4-\l, left=1cm of c3] (c3) {\pictextl};
\end{tikzpicture}}
\newpage
}
\end{document}
Each possible configuration is generated, and each unfilled square is linked to the next appropriate configuration. By labelling the configurations according to which squares are filled, it is very easy to sort out the paths in the graph linking the configurations.
Update 2013-08-31 This version allows for two-way clicking, so a coloured node is a link to the uncoloured one and vice versa. It actually makes the code a smidgeon simpler. To offset that, I've included Jake's excellent code for making the entire node clickable (and used hidelinks to hide the red boxes).
\documentclass{article}
%\url{http://tex.stackexchange.com/q/61020/86}
\usepackage{tikz}
\usepackage{hyperref}
\usetikzlibrary{positioning,calc}
\tikzset{
box1/.style={
draw=black,
thick,
rectangle,
rounded corners,
minimum height=2cm,
minimum width=2cm
},
hyperlink node/.style={
alias=sourcenode,
append after command={
let \p1 = (sourcenode.north west),
\p2=(sourcenode.south east),
\n1={\x2-\x1},
\n2={\y1-\y2} in
node [inner sep=0pt, outer sep=0pt,anchor=north west,at=(\p1)] {\hyperlink{#1}{\phantom{\rule{\n1}{\n2}}}}
}
}
}
\colorlet{picture-1-1}{red}
\colorlet{picture-2-1}{blue}
\colorlet{picture-3-1}{orange}
\colorlet{picture-4-1}{green}
\colorlet{picture-1-0}{white}
\colorlet{picture-2-0}{white}
\colorlet{picture-3-0}{white}
\colorlet{picture-4-0}{white}
\hypersetup{hidelinks}
\begin{document}
\foreach \n in {0,...,15} {
\pgfmathtruncatemacro\i{mod(\n,2)}
\pgfmathtruncatemacro\j{mod(int(\n/2),2)}
\pgfmathtruncatemacro\k{mod(int(\n/4),2)}
\pgfmathtruncatemacro\l{mod(int(\n/8),2)}
\pgfmathparse{int(1-\i)}
\edef\pictexti{picture-\pgfmathresult-\j-\k-\l}
\pgfmathparse{int(1-\j)}
\edef\pictextj{picture-\i-\pgfmathresult-\k-\l}
\pgfmathparse{int(1-\k)}
\edef\pictextk{picture-\i-\j-\pgfmathresult-\l}
\pgfmathparse{int(1-\l)}
\edef\pictextl{picture-\i-\j-\k-\pgfmathresult}
\edef\picname{picture-\i-\j-\k-\l}
\hypertarget{picture-\i-\j-\k-\l}{%
\begin{tikzpicture}
\node[box1, fill=picture-1-\i, hyperlink node=\pictexti] (c1) {1};
\node[box1, fill=picture-2-\j, hyperlink node=\pictextj, right=1cm of c1] (c2) {2};
\node[box1, fill=picture-3-\k, hyperlink node=\pictextk, below=1cm of c2] (c3) {3};
\node[box1, fill=picture-4-\l, hyperlink node=\pictextl, left=1cm of c3] (c3) {4};
\end{tikzpicture}}
\newpage
}
\end{document}
/usr/localso it plays well with Debian stuff. You could try installing pgf in your user TEXMF tree. Or you could look through the manual (texdoc pgf) to see if there's an alternative toint- it's been so long since I used the old version of pgf that I don't know if such exists. – Andrew Stacey Aug 31 '12 at 12:42/usr/localso providing/usr/local/binis in your path and early in your path then there's no conflict. – Andrew Stacey Aug 31 '12 at 14:12$HOME/local/texliveto keep it out of the way and then symlinked the binaries into$HOME/local/bin(which was in my path). I don't remember anything being complicated about this set-up, though there might be a configuration variable or two to configure. – Andrew Stacey Sep 02 '12 at 16:47dpkgisn't going to see your local installation. The test iskpsewhich, or just plainwhich. Trywhich texorkpsewhich latex.ltxto see if they are finding your new installation. – Andrew Stacey Sep 10 '12 at 08:45kpsewhich pgfmath.code.texandkpsewhich pgfmathfunctions.round.code.texand see if they are in the texlive 2012 tree. – Andrew Stacey Sep 11 '12 at 20:19@syntax to flag me. – Andrew Stacey Sep 17 '12 at 08:49