I'm having some issues with savebox
and tikzexternalize
, when I compile the following code without external
everything works as expected, if I enable it the single images get generated correctly but the final document optimizes them away.
Is there a better way to combine tikzpictures as nodes of another tikzpicture? Am I using savebox correctly?
\documentclass[12pt]{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{external}
\tikzexternalize
\begin{document}
\newsavebox{\boxA}
\savebox{\boxA}{
\begin{tikzpicture}
\node {I am box A};
\end{tikzpicture}
}
\newsavebox{\boxB}
\savebox{\boxB}{
\begin{tikzpicture}
\node {I am box B};
\end{tikzpicture}
}
\begin{figure}
\begin{tikzpicture}
\node (C) {CENTER NODE};
\node [above=10pt of C] {\usebox{\boxA}};
\node [below=10pt of C] {\usebox{\boxB}};
\end{tikzpicture}
\end{figure}
\end{document}
Expected result:
Wrong result with tikzexternalize
: