## How can I make the xr package work on Overleaf?

Here's a nice solution from TeX.SX, which involves some custom commands that you'll need to add in a latexmkrc, as well as the main .tex file.

Suppose your main file is file1.tex, and you'd like to refer to labels in file2.tex, but you don't want to \include{file2} in file1.tex.

The solution here is to first add some helper code in file1.tex, in addition to loading the xr package. You'll also need to add a latexmkrc file to your project, and put some custom code in it. Here's an Overleaf project that contains the code needed. Make sure you enable the correct system call depending on the LaTeX engine you're using!