# Include aux file in tex source?

I have a large book broken into several chapters, each of which reference each other heavily. I would like to be able to distribute individual chapters as self-contained .tex files. I can do this except for the fact that references will not work unless I have the .aux file for the entire book (and I use the xr package for external references). I would thus like to be able to include the large .aux file in the individual chapter files when distributing the individual files. Is there a way I can do this?

• But what behavior do you want? If one chapter references another with \ref, what do you want it to display when that chapter is distributed separately?
– Ben
Jan 5 '11 at 19:12
• The same that it would display as if it were in the total document. (Each individual chapter file starts the numbering according to its place in the book, so there should not be a conflict.) As in, I would like to store the cross-referencing data within each .tex file so that the others are not necessary. Jan 5 '11 at 19:13
• you should use \include and \includeonly, then you can run individuell chapters. See also tex.ac.uk/cgi-bin/texfaq2html?label=include
– user2478
Jan 5 '11 at 19:59
• have you already considered the filecontents environment and package? Mar 15 '11 at 12:49