I'm trying to start my first modular Latex file and I'm using the Wikibook of Latex. I don't know if I'm doing something wrong but I tried to find info about it and I didn't find anything.

I'm using the standalone package and the packages in the child files are not loading. In this case, the package \usepackage[showframe]{geometry} is not loading. The package only loads if I include it in the main file or in the sty file. What I am doing wrong?

These are my files:








    f(x) &= x^2+uv+u^3xy





2 Answers 2


As per the standalone documentation:

The package standalone can be used in the main document to skip all extra preambles in included files. The main file must load all packages and settings required by the sub-files.

Thus, it is a requirement to have the main file load all the packages that are required by the sub-files. My recommendation would be to put the \usepackage[showframe]{geometry} in the mystyle.sty.


I was bumping into the same problem. Peter's answer still works, but as of today, there is an alternative solution for version v1.3a: the subpreambles=true option for the standalone package. Section 6.2 of the documentation says:

The standalone package removes all sub-file preambles ("sub-preambles") by default when loaded. However, if the package is loaded with the subpreambles options, all sub-preambles are stored in an auxiliary file with the name '〈maintex file name〉.sta' (for standalone). This file is then loaded or processed at the beginning of the next LaTeX run (i.e. at the place in the preamble where the standalone package is loaded).

You must log in to answer this question.

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