# Why doesn't standalone accept my build={} package option?

I frequently use standalone to incorporate tikz images in my documents. I have some really large tikz plots which I would like to include in my beamer presentation, but I am getting "Tex capacity exceeded" errors. First I tried unsuccessfully to "externalize" my tikz plot using standalone and the external library, but after reading this question, I have abandoned that effort and have been trying to accomplish the same thing just with standalone.

I use xelatex exclusively and I want standalone to do this also. The manual says I can set the LaTeX compiler in the package options:

build={build options}

This option allows to set the options used for building images from standalone files. See section 5.4, especially Table 3 for further details.

When I try to do this, though, like this:

\usepackage[build={latex=xelatex}]{standalone}


I get this error message:

! LaTeX Error: Unknown option build' for package standalone'.


This is a complete mystery to me, as I have tried other package options taken from the same section of the manual in my MWE (such as obeyclassoptions) and it has built successfully. Note that even if the syntax for the definition is incorrect, it's telling me that it doesn't recognize build in the first place. (Please correct my syntax if it is wrong.)

Here is my MWE:

\documentclass{beamer}

\usepackage[build={latex=xelatex}]{standalone}

\usepackage{pgfplots}

\pgfplotsset{width=7cm,compat=1.8}

\begin{document}

\begin{frame}{A slide}
Bla and bla.
\end{frame}

\begin{frame}{Another slide}
\input{testplot.tex}
\end{frame}

\end{document}


Here is the code for testplot.tex, taken from the pgfplots manual:

\documentclass{standalone}

\usepackage{pgfplots}

\pgfplotsset{width=7cm,compat=1.8}

\begin{document}

\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,
ylabel={$f(x) = x^2 - x +4$}
]
\end{axis}
\end{tikzpicture}

\end{document}


Keep in mind that my ultimate goal is to include my giant tikz plot and not have XeLaTeX quit on me due to insufficient memory, so please let me know if this is not possible with standalone. Doing it with external alone didn't work, though. The compile dies without errors but without giving me a readable document, either.

• I would compile the image testplot.tex on its own and generate a stand-alone PDF as output. Then use \includegraphics[..]{testplot} inside your beamer presentation. This way the two processes are separate and inclusion should be straight forward. – Werner Jul 11 '13 at 16:44
• There is an open issue about this bug, at the standalone repository. – Twonky Jan 24 '14 at 16:27

\usepackage[]{standalone}