I'm writing my thesis (using a university-specific document type) and am importing many chapters (using the package import). Each chapter is taken directly from a latex file that once served as an article unto itself (with the preamble suitably removed). I also have each chapter print its own bibliography at the end of the chapter.
Unfortunately, many of the label names for sections and equations are the same across different chapters. For example, I might have two equations called \label{eq:schrodinger}, or two sections called \label{sec:intro}. I almost never want to cross-reference between chapters. I want each reference to an equation or section to refer to its own internal version. [The exception is my intro chapter, where I do refer to chapter numbers, but that's really not a big deal since it's not very common.]
Furthermore, I have the same problem with citations, since many chapters cite the same works, but I need those citations to appear (with the correct number) in each chapter. At the moment, latex has been ascribing each \cite{label} the number from the last occurrence of label in the entire document, rather than the occurrence of label in that chapter.
Is there any way I can fix these, by having all references/labels/citations internal only, so latex just ignores the existence of the other chapters' labels/bibitems when compiling the content of each chapter. Note that I use packages hyperref, cite, amsmath, amsthm (and many other packages), and have an automatically generated table of contents, which will undoubtedly add further complications.
I would really prefer not to have to re-label everything manually. Re-labelling sections and equations would be bad enough, but re-labelling citations would be very bad because I often use \cite{refa, refb, refc}. [Granted, with sufficient effort I suppose one can do https://xkcd.com/208/, but I would really prefer to keep the individual chapters unaltered.]
xr
orxr-hyper
packages to get the references from separate files correctly