MartinScharrer / standalone

A LaTeX class and package is provided which allows LaTeX diagrams or other LaTeX code to be compiled standalone or as part of a main document. Special support for pictures with beamer overlays is also provided.
LaTeX Project Public License v1.3c
9 stars 2 forks source link

Request feature if not too difficult: enable subpreambles=false on per file basis #12

Open cfr42 opened 5 months ago

cfr42 commented 5 months ago

It would be very useful if it was possible to ignore the preambles of some input documents, while still utilising the (fantastic!) feature globally. At the moment, the option to enable/disable subpreambles is switched off after the package options are processed. I assume there are reasons for this (though I didn't investigate to see what), so I was wondering if it would be possible to change this so the setting could be changed locally.

If this would be difficult or time-consuming to implement, I want to withdraw this request because I don't think it is a good use of your time in that case. However, if it could be done relatively straightforwardly, it would be extremely helpful.

The motivation for this request is really a function of complexity. I have a semi-modular system for creating teaching materials which involves a large number of files. In addition, particular documents include yet more files. Many of these are tikzpictures. It's very convenient to have standalone sort out what needs loading altogether, but enabling subpreambles globally causes compilation failures because the preambles of other files duplicate macro creation or are otherwise inconsistent. Obviously it is theoretically possible to resolve these problems, but so far I've simply lived with the errors due to missing dependencies for tikzpictures and added things to the main document when they occur. The ability to switch subpreambles off for particular files would be a convenient solution.