I've created a standalone file containing two tikzpicture
environments. If I compile the file by itself, I am seeing two pages generated. So far so good.
\documentclass[tikz]{standalone}
\usetikzlibrary{...}
\begin{document}
\tikzset{...}
\begin{tikzpicture}
...
\end{tikzpicture}
\begin{tikzpicture}
...
\end{tikzpicture}
\end{document}
Now I want to include only the first or the second one of them in my main document:
\begin{figure}
\centering
\includestandalone[page=2]{figures/diagrams}
\caption{The enhanced diagram}
\end{figure}
Other than expected and documented, the result is both diagrams being printed side-by-side with the second one surpassing the right margin of the page. Any idea what could be the issue?
Edit, Solution: Turns out the problem originated out of multiple errors. Maybe this will be a help for others:
@torbjørn-t brought to my attention, that the default
mode=tex
setting doesn't support the pages option. Be sure to activate one of the other inclusion modes in the main document. I decided to go with:\usepackage[mode=build]{standalone}
Next issue was, that the cascaded build now yielded the following error:
Package standalone Warning: Graphic '...' could not be build. Shell escape activated?
Be sure to enable shell escape.In my case the above wasn't actually related to shell escape but to a build error inside the standalone
diagrams
document in combination with the fact, that it is located in the subdirectoryfigures
. Turns out the build is executed in a different path and a\include{general_properties}
couldn't be resolved correctly. To solve this and similar issues, be sure to check the individual log files next to your standalone file.