Many thanks for the detailed answer. The reason why I was using the class standalone was to be able to input it into the main document. So if I use the article class instead do I also get all the benefits of using the standalone package in the main file (eg. only a single preamble and imports, etc.)? Also, what would be the best way to use the macros provided by standalone (eg. \onlyifstandalone{〈code〉}) in a document with the article class? Would it just be a matter of importing standalone as a...
Unable to use algorithm environment in standalone document