I have a standalone tikzpicture described as below which works well:

\newcommand{\bigfont}{\usefont{T1}{cmr}{m}{n}\fontsize{100}{\baselineskip} \selectfont}

\draw [line width=1](-1.5,-1.6) rectangle (1.5,1.6) (1.5,1.6);
\node at ( 0,0) {\bigfont{O}};


When run by pdflatex we get the following picture:

enter image description here

I saved the standalone file as FIGG.tex and call it in a book as below:



\captionof{figure}{MY FIGURE}

However this main tex file does not like to show the figure giving me an error:

10 Undefined control sequence. l.10 \node at ( 0,0) {\bigfont {O}}; Do you know how to fix this to be able to call the FIGG in the main tex file?

1 Answer 1


In your example, standalone's default setting mode=tex takes effect. Under this mode, \includestandalone works like \input so the file FIGG.tex is included, with its preamble skipped. Therefore the \bigfont defined in the preamble FIGG.tex is skipped, throwing error Undefined control sequence ... \bigfont.

There are two kinds of solutions:

  • If you want to include FIGG as a source file, Then use \usepackage[subpreambles]{standalone} in the main tex file and compile it twice.
  • If you want to insert FIGG as an image, then use modes like buildmissing or buildnew as in \usepackage[mode=<mode>]{standalone} (need -shell-escape) in the main tex file. Check the doc of standalone to see which mode best fits your need.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .