How can I create a local LaTeX environment which is suitable for arXiv submission preparation?

I've found a sort-of easy solution. The requirements are several gigabytes of disk space and sufficient privileges with the machine to run docker (I did have some trouble with that on one machine). This is based on the instructions found here. Special thanks are owed to makisyu for maintaining the texlive 2016 image used in this guide.

The steps are as follows (as of October 14, 2018, they will need to be amended when arXiv's texlive is upgraded):

  • Install Docker (Ubuntu has it in the standard repositories; I'm guessing so do all the major distros).
  • Navigate into the directory with your tex file.
  • Install the texlive 2016 image using the command: docker pull makisyu/texlive-2016
  • Run pdflatex the required number of times via the command docker run --rm --volume $PWD:/workdir --workdir /workdir makisyu/texlive-2016 pdflatex my_texfile.tex (replacing my_texfile.tex with the appropriate filename).
  • Run biber using the command docker run --rm --volume $PWD:/workdir --workdir /workdir makisyu/texlive-2016 biber my_texfile (replacing my_texfile with the appropriate filename, again).
  • Run any other commands necessary to generate the required auxiliary files.

Christian Clason suggested in the comments that the last three steps can be replaced by docker run --rm --volume $PWD:/workdir --workdir /workdir makisyu/texlive-2016 latexmk my_texflile.tex. I did not test that (nor can I right now), but it should make the process slightly easier.


It's also possible to just install the 2016 version of texlive in parallel to the current one -- it can be found at ftp://tug.org/historic/systems/texlive/2016, which includes the latest version of all packages, including biblatex and biber, before the freeze -- and just change the environment variable before compiling. For example, under Linux or macOS using bash, you can open a shell, change to the appropriate directory, and

  1. Delete all auxiliary files (especially *.bbl etc. for biblatex!)
  2. Set the path (assuming you used the standard install location):
    • Linux: export PATH=/usr/local/texlive/2016/bin/x86_64-linux:$PATH
    • macOS: export PATH=/usr/local/texlive/2016/bin/x86_64-darwin:$PATH
    • Windows: set path=c:\texlive\2016\bin\win32;%path%
  3. latexmk my_file.tex
  4. latexmk -c
  5. zip everything and upload to arXiv (they will ignore all files they don't use such as *.pdf or *.bib).

This works for me (I've put this in a script called arxivmk).

EDIT: I just saw that @samcarter already made this suggestion in the comments; maybe the details are still helpful.