I want to run queries against LaTeX documents like these:
- get list of all equations, even if one declares
\def\be{\begin{equation}}and uses it; - get list of all arguments of some command (e. g.
\marginpar), where it has been used in document (again, even if one declares\def\m\marginparand calls this macro); - get the theorem with given counter value.
The task seems to require full compiling of all macros, but I want to get arguments in not expanded form --- that is not as blocks and glue, but as user's input (if possible).
How can I do such things?
Update: ideally, I want to use "semantic markup" to mark parts of documents and generate different views of them. Assume I have smth like this:
\beginBlock{calculus}
\beginBlock{content}
... lectures...
\endBlock
\beginBlock{exam}
... problems...
\beginBlock{comments}
... comments about criteria and how to evaluate typical mistakes...
\endBlock
\endBlock[exam]
\endBlock[calculus]
and similar for linear algebra in other file; I want to generate a report with sections for calculus and linear algebra, containing only exam problems, e. g.