I write course material for my students. Every chapter is in a different file. Some chapters are used in several classes, but in a different order. Say:
- including chapter-foo.tex as chapter 1
- including chapter-bar.tex as chapter 2
- including chapter-xyz.tex as chapter 3
- including chapter-abc.tex as chapter 1
- including chapter-foo.tex as chapter 2
- including chapter-bar.tex as chapter 3
Now, whenever I compile ClassA.tex or ClassB.tex, three AUX files are generated and all is fine. However, if I add a fourth chapter to class A's document and -- in order to save time -- use
\includeonly so that the first three chapters can be skipped during compilation, this will get me wrong cross-references, if the last complete run has been done with ClassB.tex.
I am looking for a way to add some prefix to the AUX file's names, e.g. compiling chapter-foo.tex from ClassA.tex would use (and create, if necessary) a-chapter-foo.aux, wheres compiling it from ClassB.tex would use b-chapter-foo.aux.