I am using the Texmaker latex editor, and get the following error when trying to use the Standalone package: ! Extra }, or forgotten \endgroup.

I am simply following the overleaf tutorial on the standalone package to make a multi-file document. I have copied their code exactly, and set up the files accordingly. When I compile both the main document and the `introduction' I get the above error. It loads fine in the overleaf editor, but not in Texmaker. I get the same issue on Ubuntu and Windows. Any help is appreciated.

Main file


\title{Standalone package example}
\date{May 2021}



\section{First section}


Introduction file

   \documentclass[class=article, crop=false]{standalone}

A TikZ figure will be rendered below this line

\caption{A nice simple diagram}


diagram file


roundnode/.style={circle, draw=green!60, fill=green!5, very thick, minimum size=7mm},
squarednode/.style={rectangle, draw=red!60, fill=red!5, very thick, minimum size=5mm},
\node[squarednode]      (maintopic)                              {2};
\node[roundnode]        (uppercircle)       [above=of maintopic] {1};
\node[squarednode]      (rightsquare)       [right=of maintopic] {3};
\node[roundnode]        (lowercircle)       [below=of maintopic] {4};

\draw[->] (uppercircle.south) -- (maintopic.north);
\draw[->] (maintopic.east) -- (rightsquare.west);
\draw[->] (rightsquare.south) .. controls +(down:7mm) and +(right:7mm) .. (lowercircle.east);


The files are




  • 6
    There is 99% certainty that you did something wrong. If we follow the same tutorial, we will not do your mistake so we cannot advice you where the problem is. Because you didn't show your problem, you didn't show your code. Give your code in your question which generates the mentioned error message. Without this, it is impossible to help you.
    – wipet
    Oct 28, 2022 at 5:19
  • Exact same problem. It occurs in Line 555 of the .sty pack I have tried the exact same example and with my own documents, always get the same error.
    – RSVUK
    Nov 14, 2022 at 14:24

1 Answer 1


You just need to add the relevant options to the \documentclass of your diagram file:

\documentclass[class=article, crop=false]{standalone}

Having done that, after recompilation from scratch, I get the following, seemingly correct, output:

enter image description here

You must log in to answer this question.

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