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?
[Tex/LaTex] arXiv: post supplementary files using external document and xr
arxivlatexmkpdftex
Related Solutions
Try adding the .tex
extension back on to the file.
I'm not sure why arXiv would remove it,
but many editors will assume that it's there
when running compile sequences.
To see what I mean, compare the compilation for pdfLaTeX and BibTeX:
$ pdflatex myfile.tex
$ bibtex myfile
Note that bibtex
doesn't need the file extension
since it also looks at the files generated by the LaTeX run.
Editors like TeXworks (and others, no doubt) will run these sequences for you automatically, but this requires that it knows where the extension is so that it can remove it.
When there is no extension to remove, ambiguities will arise:
$ pdflatex myfile
$ bibtex myfile
It's likely that one of these programs picked up on the 'wrong' myfile
,
causing the error that you saw.
(For example, take a look inside the aux
file; running pdflatex
directly on this file would certainly throw an error.)
Here I give a workable solution, but not a clever one. In whatever case, we have to make a third separate file for arXiv submission (say, with at least one line to include Supp.) unless they support supplementary directly.
Basically, the method is to append the supplementary material at the end of main text. Then add the commands to reset all counters and append the "S" for equations, figures, table and references. The resulting file would look like
The \pagebreak will put supplementary materials in the new page, but I don't know why it doesn't work here. The template codes are given below. Note the important codes is in the middle part. Also, please don't use same reference citation name, otherwise, there will be wrong numbering for citation.
\documentclass[twocolumn,superscriptaddress,floatfix,preprintnumbers]{revtex4}
\usepackage{graphics,amssymb,amsmath,epsfig,color}
\usepackage{graphicx}
\begin{document}
\title{Title for main text}
\author{You name here}
\affiliation{Somewhere}
\date{\today}
\begin{abstract}
Abstract...
\end{abstract}
\pacs{}
\maketitle
Paragraph 1. Main text here \cite{RefA}:
\begin{equation}
E=mc^2
\end{equation}
Paragraph 2.
Paragraph 3 \cite{RefB}:
\begin{equation}
S=k_B \ln(\Omega)
\end{equation}
\begin{thebibliography}{11}
\bibitem{RefA} A. Someone, C. Someone, D. Someone, Phys. Rev. Lett. {\bf 11}, 1111 (1911).
\bibitem{RefB} B. Someone, {\it et. al.}, Phys. Rev. Lett. {\bf 22}, 2222 (1922).
\end{thebibliography}
%%%%%%%%%% Merge with supplemental materials %%%%%%%%%%
\pagebreak
\widetext
\begin{center}
\textbf{\large Supplemental Materials: Title for main text}
\end{center}
%%%%%%%%%% Merge with supplemental materials %%%%%%%%%%
%%%%%%%%%% Prefix a "S" to all equations, figures, tables and reset the counter %%%%%%%%%%
\setcounter{equation}{0}
\setcounter{figure}{0}
\setcounter{table}{0}
\setcounter{page}{1}
\makeatletter
\renewcommand{\theequation}{S\arabic{equation}}
\renewcommand{\thefigure}{S\arabic{figure}}
\renewcommand{\bibnumfmt}[1]{[S#1]}
\renewcommand{\citenumfont}[1]{S#1}
%%%%%%%%%% Prefix a "S" to all equations, figures, tables and reset the counter %%%%%%%%%%
\section{Section 1}
Copy and paste your Supplemental Materials text here \cite{S_RefA}, blah, blah, blah, blah, blah, blah, ...
\begin{equation}
i\hbar\frac{\partial}{\partial t}\psi(x,t) = -\frac{\hbar^2}{2m}\frac{\partial^2}{\partial x^2}\psi(x,t) + V(x,t) \psi(x,t)
\end{equation}
\begin{thebibliography}{11}
\bibitem{S_RefA} A. Someone, C. Someone, D. Someone, Phys. Rev. Lett. {\bf 11}, 1111 (1911).
\end{thebibliography}
\end{document}
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:
In your latex file add (on top) \usepackage{filecontents}
and before \end{document} add
This way your latex file will create the file.aux that you can use with xr and \externaldocument