what I'm looking for...
I'm looking for a couple a commands, \disableAllButCounters and \enableAll that would do the following:
Everything between
\disableAllButCountersand\enableAllwould be ignored excepted commands such that\setcounter{counterA}{k}, so that the only common thing between\disableAllButCounters \manyCommands \enableAlland
%\disableAllButCounters \manyCommands %\enableAllwould be that after both, the values of the counters is the same. In particular, anything between these commands will not produce any output (nor
aux).I'm looking for a solution for latex and for a solution for luatex.
If it exists, these commands could provide a solution to this question.
but why!?
Basically, I would like to produce several outputs from a single latex file: one output for the content from A to B, one output for the content from B to C, etc. I plan to do it by cutting the file into multiple files. My question raises the problem of dealing with the references.
If by any chance, you think of a better solution, don't hesitate!!

\include, unless you object to its always starting a new page. – Dan Mar 20 '14 at 22:05