arXiv: post supplementary files using external document and xr

I have two documents in LaTeX, one called main.tex and the other supplement.tex. They are both linked together by the xr package and compile without error. (They have to be compiled in the order: pdflatex on main followed by pdflatex on the supplement and then pdflatex on the main again to complete the cross-referencing. Is there a way to put this on arXiv and letting the compiler there know that pdflatex has to run a few times on each docment? Many thanks! Should one put up the .aux files also in that case?

I would upload the compiled supplement.pdf, and supplement.aux with main.tex so the arXiv compiler can extract all the labels used in supplement.tex (via xr) when building main.tex, that should compile fine.

However I really would suggest including the supplementary in the main PDF (e.g. combining the tex sources or appending supplement.pdf using pdfpages) as finding supplementary through downloading the source is a pain and can leave the supplement's existence poorly advertised.

• I tried uploading supplement.aux and main.aux since both documents cross-reference each other, but to no avail. – user3236841 Nov 12 '17 at 14:13
• Also, I am not sure how pdfpages works but not sure that the cross-referencing can work as is being suggested. Note that both main.tex and supplement.tex reference each other and it works very well for my purposes. – user3236841 Nov 12 '17 at 14:20
• The arXiv wants a single file to compile to produce the paper, anything else should be included as an ancilliary file so I am suggesting upload the pre-compiled supplement.pdf and as long as supplement.aux is bundled with main.tex all references should appear correctly in the produced main.pdf. Are you looking for hyperlinking to work? This would be much more of a problem. – Dai Bowen Nov 14 '17 at 14:23

the xr package (and packages like it, such as xref that rely on having an external aux file present) don't work in arXiv's autotex engine. You'll need to re-work you citations between the two documents to not be cross-referenced from the same aux file.

You can workaround a problem. Take your file.aux, create xx.tex and upload it to arxiv along with your latex file. the xx.tex is:

\begin{filecontents}{file.aux}
The content of file.aux
\end{filecontents}


\makeatletter\@input{xx.tex}\makeatother