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
Suppose your main file is
file1.tex, and you'd like to refer to labels in
file2.tex, but you don't want to
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!