It seems strange but I really need this. Is there a built-in macro to load additional packages specified in the document environment?

```
% main.tex
\documentclass{article}
\begin{document}
\input{subfile}
\end{document}

```

```
% subfile.tex
\LoadPackage{pstricks}
\LoadPackage{multido}
\pspicture(1,1)
\psframe(1,1)
\endpspicture

```

---

I accepted mbork's answer because it really allow us to load some packages after `\begin{document}`. I have tested the following and it is successfully compiled with a PDF output.

```
% main.tex
\documentclass{article}
\usepackage{pkgindoc}
\begin{document}
\input{subfile}
\end{document}

```

```
% subfile.tex
\usepackage{xcolor}
I can find a tool to convert PDF to EPS in my neither bathroom nor kitchen.

```

Unfortunately, using pstricks, geometry, hyperref (and among others) do not work. :-(