I'm using LaTeX for academic papers, and for several different papers I'd like to use several different section types that number independently of one another. I cannot split them into parts, however, as I'd like them to mingle where they are relevant. E.g. in one paper I'd like to have text sections (down to the level of subsubsections), exercise sections (down to the level of subsections) and code snippet sections (with no sublevels).
Is there an efficient way to do this?
E.g.
1: Text section
1: Exercise section
2: Text section
2: Exercise section
1: Code section
3: Text section
2: Code section
4: Text section
3: Exercise section
3: Code section
etc.
Also, if it's possible, with some automatic formating of the titles. E.g. exercise sections in blue and code snippets in green.
amsthm
is such a package.)