I have already posted a similar question here before, but because it was way too open-like and not defined well, it got closed. I'm giving it another try, this time being a bit more specific. I'm really puzzled why I can't find something like this on Google. I guess I'm search for wrong things because I'm not sure if "workbook" is a correct word anyway.
I want to create a book similar to this one. So it's a list of problems divided in sections and subsections, and after all of them, solutions to problems. The book I want to create is just a collection of problems from a lot of different places, and I'm not yet sure in which order will they go.
So, I want to create some sort of database of problems, where each problem and solution have their unique ID. For example, like this:
\problem{ID_001}
[Text of problem, including lots of "$$" and other maths (possibly pictures too?)]
\solution
[Solution to the problem above. "ID_001" "tag" is opinional,
I'm fine with typing it if it's gonna make things easier]
\problem{ID_002}
[...]
\solution
[..]
Then, I wish to create a standard LaTeX file where I could do something like this:
\section{Geometry}
\subsection{Planimetry}
\problem{ID_025}
\problem{ID_546}
\subsection{Stereometry}
\problem{ID_002}
\problem(ID_001)
This file should generate a Part I "Problems" with (in this case only one) title "Geometry", and two subtitles with two problems each (numbered 1.1, 2.1, 2.1, 2.2 or 1, 2, 3, 4 or 1, 2, 1, 2 but NOT 025, 546, 002, 001). After that, a Part II "Solutions" with same structure, but showing respective solutions instead of problems.
I hope you get the idea what I want to achieve. Obviously, the "database" and "commands" i Made up, \problem can be whatever, but I want to achieve effect similar to what I have described, also take a look at the book I have provided, here is the link again.
Please consider pointing me out to some useful links or help me determine what's the package I'm looking for (if it exists), since I'm very stuck. It's hard to find somethign you don't know the name of. And Googling "problems" along with "latex" doesn't really help much for obvious reasons.
EDIT Another thing I forgot to state, I'd also include the source of the problem in database and then, in the end of the book, after solutions, I'd generate a list like, for example:
1.1. Regional competition 2006, 4th grade
1.2. "Number theory" by John Doe
answerspackage there looks close to the type of structure you asking for. – Andrew Swann Feb 18 '13 at 10:51