A Step-by-Step Tutorial for LaTeX with Overleaf.
Place before title of main.tex
.
\documentclass{article}
\usepackage{...}
%%====================================%%
\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{supp.pdf}
% Determine the number of pages of Supp
\pdfximage{\supplementfilename}
\def\numbersupplementpages{\the\pdflastximagepages}
\newif\ifarXiv
\arXivtrue
%%====================================%%
\title{...}
\begin{document}
Place at the end of the document
\ifarXiv
\foreach \x in {1,...,\numbersupplementpages}
{
\includepdf[fitpaper=true, pages=\x]{\supplementfilename}
}
\fi
\end{document}
- Generate
supp.pdf
and Upload to Overleaf Project. - Check
main.tex
compiles as expected. - Click Submit -> Arxiv in Overleaf.
- Decompress the .tar file and remove
supp.tex
. - Submit to Arxiv