[Tex/LaTex] arXiv: post supplementary files using external document and xr

arxivlatexmkpdftex

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?

Best Answer

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}

In your latex file add (on top) \usepackage{filecontents}

and before \end{document} add

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

This way your latex file will create the file.aux that you can use with xr and \externaldocument

Related Question