# Error using tikz/pgf with font=\size (and minimal document class)

I'm having an issue with pgfplots/tikz when trying to change the font size for legends/nodes. Any command that contains "font=\size" fails (for example, "font=\small") with the error "Undefined control sequence \end{axis}".

Here is a MWE.

\documentclass[]{minimal}

\usetikzlibrary{patterns,matrix,arrows}
\pgfplotsset{compat=1.9}

\begin{document}

\begin{tikzpicture}
%\tikzstyle{every node}=[font=\small] % throws "Undefined control sequence \end{axis}"
\begin{axis}
%[legend style={font=\tiny}] % throws "Undefined control sequence \end{axis}"
\end{axis}
\end{tikzpicture}
\end{document}

-

You are using minimal document class where font size commands will not be available (Refer this answer). Use some other class and things work:

\documentclass[]{standalone}

\usetikzlibrary{patterns,matrix,arrows}
\pgfplotsset{compat=1.9}

\begin{document}

\begin{tikzpicture}
\begin{axis}
[legend style={font=\tiny}] % works
\end{axis}
\end{tikzpicture}
\end{document}


-
Thanks, that was it; sorry, but the error message was truly unhelpful. –  facuq Nov 28 '13 at 3:18