# How to use -cd label in latexmkrc when "No file C1.aux LABELS NOT IMPORTED." error occured

I just get No file C1.aux LABELS NOT IMPORTED. error when I try to use \usepackage[subpreambles=true]{standalone} and \externaldocument{C1} commands, in order to quote from another latex files. I'm trying to use the standalone package because I get faster compile time when deal with individual tex files. And I read this from another problem which said there should be a latexmkrc file and using -cd commands, but the answer doesn't tell exactly how to write the latexmkrc file.

• the choice to use latexmk or not is like the choice of which editor you use or which operating system, it affects details of what commands you run but isn't related to any tex error. if there is no C1.aux then presumably you haven't yet run latex on C1.tex so do that first then if you still get an error, show your tex code so someone has a chance to correct it. Sep 20, 2020 at 9:05
• but if you are including chapters via standalone they are essentially just input so they are part of the current document not external documents and you shouldn't need to use xr at all I would expect? Sep 20, 2020 at 9:07
• Hi David, I use both MiKTeX(offline) and Overleaf(online) and this error only shows on the overleaf. I have a C1.axu generated by the MiKTex and I can upload that file to overleaf. Sep 21, 2020 at 1:12
• I just using xr package to cross referencing, and that's when the error occured. Sep 21, 2020 at 1:15
• I know what xr does (I wrote it) but if you are including chapters then they may be separate source files but to latex they are part of the same document so just use normal \label and \ref not the xr mechanisms. But maybe you are not doing that (You have given very few clues about your source files) Overleaf will certainly need to see any aux files that you reference using xr so yes you need to copy them from a local run or from another overleaf project Sep 21, 2020 at 6:39