2

I want to cross-reference between different chapters. For example I have chap2.tex and chap3.tex as files containing all the theorems and methods, respectively. The following chapters 4,5...7 will extensively rely on cross-referencing from these two chapter.

I am using the thesis template from here and I have tried following the solution provided for a similar problem using the xr package, but it is not working.

Can somebody point out the error I am making? Is there something with the template?

Nitya
  • 21
  • 1
    If you're including these in the same "master document", there's no need for specifically using xr. A simple \label and corresponding \ref would suffice. – Werner Jul 22 '15 at 18:17
  • @Werner I am keeping each chapter separate as they are around 10 chapters. \label and \ref works perfectly fine within a chapter on a single chap.tex file. – Nitya Jul 22 '15 at 18:22
  • 2
    What do you mean by "keeping each chapter separate"? Do you compile them on their own? If you \include each chapX.tex as part of a master document, then you can still use \label-\ref, even though the \label is in one file and \ref is in another. – Werner Jul 22 '15 at 18:30
  • @Werner I \include them into the master document as \include{chap1.tex}, \include{chap2.tex}......Trying to use \ref is not giving me any option to include in another chapter as it gives in the same chapter. – Nitya Jul 22 '15 at 18:38
  • Hmmm, perhaps not from your editor's point of view, but it should work for LaTeX. Try it. – Werner Jul 22 '15 at 18:44
  • I am using Texmaker, are you able to cross reference between different chapter in different files? what editor do you use? Is this editor specific issue? – Nitya Jul 22 '15 at 19:08
  • 1
    Yes you are. The suggested labels in your \ref might not show up, but you can certainly use them. – Werner Jul 22 '15 at 19:17
  • The editor doesn't matter. Just type the label and ignore the editor which may claim the cross-reference is undefined. Kile does this for some cross-references which are perfectly well defined. Just ignore your editor - LaTeX will work it out. – cfr Jul 22 '15 at 19:27
  • @cfr @Werner, I manged to solve it. I used \input{chap2} in the begining of later chapters which provides me the option for label selection. And even after I remove the \input{chap2}, they can retain their values. – Nitya Jul 23 '15 at 10:00

0 Answers0