Nested environments in package

Also look at this related thread:

Some of the (sometimes prospective) solutions mentioned there might be of some interest to you:

3 Likes