Wednesday, October 19, 2016

Uploading a technical report to arXiv

Recently, I had to upload a technical report to arXiv. Their system requires that the LaTeX source has to be included. Actually, for computer vision and graphics paper where lots of images are included in the paper, uploading the LaTeX source is not straightforward. 

The scenario I encounter is that I have a complex LaTeX file with a bunch of figures. Each figure is made by a few minipages that include tens of images. As the arXiv system does not allow multiple files upload at a time, and due to the complicated file organization in my figure folder, it does not make sense to upload all the figure images. 

My solution is to split all the figures and tables into a single pdf file, and then modify the existing LaTeX file to include figures from the pdf instead. The steps are as follows. 

1. Include
\usepackage[active,tightpage,floats]{preview}
to the original LaTeX and compile. All floats (including captions) will be saved into a single pdf. Let's say we name it figures.pdf. 

2. Fork the original LaTeX to a new file, e.g., name arxiv.tex. In this file, all figures that has minipages and includegraphics are replaced with the code like this:

\begin{figure}
    \centering
    \includegraphics[page=X]{figures.pdf}
    \caption{}
    \label{fig:abc}
\end{figure}
where X is the page number to include. 

Note that to maintain correct cross-reference, figure caption and label has to be declared. Since the caption is already included in figures.pdf, we simply put an empty caption here. Remember to include
\usepackage{caption}
\captionsetup[figure]{labelformat=empty}
at the beginning to disable the caption numbering. This assumes that all figures are managed this way so disabling the caption numbering does not affect other figures. 

If compression is needed, one can compress the figures.pdf accordingly. 

3. Finally, simply upload arxiv.tex, arxiv.bbl, and figures.pdf, and other necessary class and style files if necessary. Note that arXiv does not compile BibTex (.bib) file automatically. One has to compile it and only upload the .bbl file. Uploading .bib file does not work. 

P.S. Do not treat your original paper as a figure and create arxiv.tex that looks like this:
\documentclass[a4paper]{article}
\usepackage{hyperref}
\hypersetup{
  pdfinfo={
    Title={},
    Author={},
    Subject={},
    Keywords={}
  }
}
\usepackage{pdfpages}

\begin{document}
\includepdf[pages=1-last]{original.pdf}
\end{document}

This can bypass the submission system, but the arXiv admin will hold your submission until you contact them. :)