[Tex/LaTex] How to create a local LaTeX environment which is suitable for arXiv submission preparation

arxivdistributions

ArXiv does not compile many of the (derivative) auxiliary files for its files, like the .bbl and .ind files, and these files need to be uploaded along with the original source.

The main problem with this is that these files can be pretty sensitive about having the wrong version. Thus, to upload a document to arXiv, I have to somehow get a downgraded version of LaTeX.

Is there a known portable LaTeX distribution, or live USB system with a robust selection of LaTeX packages preinstalled, in the versions suitable for (current) arXiv (which would not require a lot of work to set up, like installing another OS or downloading packages by hand)? Or is there some other way to avoid all this nuisance? Something I can just download, run and be done with it?

I know there are hacks which allow you to upload the .pdf without the source files, but I would rather not do that (although if there is no hassle-free solution, I think I will do just that — I'm honestly sick of it by now).

Best Answer

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.