4

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).

16
  • it seems surprising that you need to downgrade the entire latex setup, perhaps there is a specific package that you need an old version for? Clearly most people submitting to arXiv use whatever version of latex they have locally to prepare the manuscript. Jun 20 '18 at 13:11
  • 1
    Distantly related: tex.stackexchange.com/q/428277/35864. If you don't use biblatex your bibliography should be fine. If you don't use cutting edge new features most packages should be OK too
    – moewe
    Jun 20 '18 at 13:11
  • 1
    If you want nearly the same tex distribution than arxiv, you can install texlive2016, it is available from tug.org/historic/systems/texlive/2016 Even with the same version, you'll still have to play by their rules about which bibliography formats they accept. Jun 20 '18 at 13:17
  • 1
    Like I say, they are quite probably for biblatex (that's why I said not to use it), but it is very unlikely that .bbls not produced for biblatex are going to be incompatible. Most have been stable for years and even if not .bbls rarely contain code that would cause incompatibilities.
    – moewe
    Jun 20 '18 at 14:12
  • 4
    They should fix arXiv rather than expecting us to work around their broken build system that does not generate auxiliary data properly. It would be so easy. Just make a checkbox "run bibtex", "run biber". Or auto-detect: if the user did not upload a .bbl, but a .bib, then you probably need to generate the .bbl... Oct 12 '18 at 19:18
7

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.

2
  • 1
    I was wondering whether such a docker image was available for this very purpose -- thanks! A comment: The last three points can probably be combined into a single docker ... latexmk my_texfile.tex. Oct 14 '18 at 8:26
  • If you are running this with sudo and have issues with the file owner, you can add --user $(id -u):$(id -g) to the command line (for running pdflatex and biber).
    – JPW
    Apr 9 '20 at 10:16
3

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.

8
  • For windows users the path to the W32TeX or TeX Live binaries can vary widely but wherever the path is e.g. the recommended locations are respectively c:\W32TeX\bin or c:\texlive\2016\bin\win32 (for in this case its the 2016 distro) Having determined the correct syntax for the above step 3 would change accordingly to set path=c:\w32tex\bin;%path% or set path=c:\texlive\2016\bin\win32;%path% in either case this only lasts for the session so best used in a command file where it can be set and re set at end of the run. To set permanently throughout the system use setX (only ONCE) instead.
    – user170109
    Oct 14 '18 at 10:33
  • @KJO Thanks! I'll include this in my answer. (Since the whole point of the exercise is to mirror the TeX setup that arXiv is using, you'd want to stick to texlive.) That the setting is only for the session is by design; I usually work with an up-to-date texlive and switch to 2016 only for submission (to check if it'll (likely) works and generate the correct .bbl for biblatex). Oct 14 '18 at 10:44
  • Note I specially used 2016 yours suggest 2018 ?also would update step 1 break the reason for backdating ?
    – user170109
    Oct 14 '18 at 10:52
  • "As far as biblatex and Biber are concerned, you should be good with an un-updated TeX live 2017" from tex.stackexchange.com/questions/429436/…
    – user170109
    Oct 14 '18 at 12:57
  • 1
    I have successfully used your suggestion where I have TexLive 2019 and didn't install Tex 2017 for that. I just downloaded the binaries. Jan 22 '20 at 23:32
0

I have just found out that you can use Overleaf to compile the requisite auxiliary files by using the compiler version select feature and the submit feature.

This seems like the most convenient way to obtain the compatible files for most purposes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.