A simple method for including supplemental materials files on the arXiv.
This repository includes information on how to include a supplemental materials file as a stand-alone PDF file when co-submitting a paper to the arXiv and a journal. It uses the pdfpages
and pgffor
latex packages.
Place the following in the header of your main manuscript.tex
file
\usepackage{pdfpages} % include pdfs
\usepackage{pgffor} % for loops
% Fix for a pdfpages rotation bug with revtex
\makeatletter
\AtBeginDocument{\let\LS@rot\@undefined}
\makeatother
% the name of the supplement PDF file
\def\supplementfilename{supplement.pdf}
% Determine the number of pages
% in the supplement file and store
\pdfximage{\supplementfilename}
\def\numbersupplementpages{\the\pdflastximagepages}
% Are we submitting to the arXiv?
% Un-comment the appropriate line
\newif\ifarXiv
\arXivtrue
% \arXivfalse
and include at the end of the document
...
\bibliography{refs}
\ifarXiv
\foreach \x in {1,...,\numbersupplementpages}
{
\clearpage
\includepdf[pages={\x,{}}]{\supplementfilename}
}
\fi
\end{document}
where \numbersupplementpages
is the automatically determined number of pages in the PDF file.
- Generate
supplement.pdf
by runningpdflatex/bibtex
onsupplement.tex
to create a stand-alone PDF file - Run
pdflatex/bibtex
onmanuscript.tex
to produce the combinedmanuscript.pdf
file. - Upload
manuscript.tex
,manuscript.bbl
andsupplement.pdf
to the arXiv.
- Replace
pgffor
package with plain TeX loop - Integrate instructions for using this with overleaf: https://www.overleaf.com/learn/how-to/Cross_referencing_with_the_xr_package_in_Overleaf