13

ArXiv expects (La)TeX sources to be submitted rather than a PDF. But - if you build a document on a different system - different TeX distribution with different updates - you are not guaranteed to get exactly the same result. Worse than that - some packages/functionality which you're using may be missing.

How, then, should I approach making sure my (hopefully upcoming) ArXiv upload actually build and produce as little divergence from the version I build at home?

3
  • 1
    This Q&A on Tex SE should be helpful to you. Pay attention to the comment below the answer, which is exactly the same as what @NajibIdrissi said.
    – Nobody
    Commented Apr 24, 2018 at 12:17
  • 7
    “if you build a document on a different system […] you are not guaranteed to get exactly the same result” — Actually, one of the core principles of TeX is that you would get exactly the same result (down to sub-pixel precision). This is why rendering bugs in TeX aren’t fixed but become features. LaTeX has only recently started deviating (very slightly!) from this. Commented Apr 24, 2018 at 14:01
  • 7
    I'm voting to close this question as off-topic because it is about the operation of a piece of software, not about academia. Commented Apr 24, 2018 at 15:00

4 Answers 4

9

You can install TeXlive 2016 yourself. It's the version that arXiv uses. This should allow you to make sure that while writing your document, you do not use packages/macros/... that are too new for arXiv to handle. I realized some time ago that there is no point in using these newer features if the (pre)published version is not going to be able to use them (and while arXiv's version is almost current, in my understanding, publisher's latex version are often prehistoric).

Moreover, (La)TeX is designed with cross-platform compatibility (and backwards-compatibility) in mind. If something compiles on a machine using version X, then it compiles on another machine using version X+n (for positive n) in general. Breaking changes between versions are relatively rare – usually it's new macros or packages that are problematic. So building on a different system is not a problem.

In any case, arXiv allows you to review the produced PDF before submitting, and moreover provides you with the compilation log. Should anything go awry, you would know where to start (well, inasmuch as you know where to start when a latex compilation goes wrong, and the error messages are not always... very clear).

2
  • 3
    The TeX and LaTeX engine may have compatibility; packages - not at all...
    – einpoklum
    Commented Apr 24, 2018 at 13:23
  • 3
    @einpoklum That's a broad statements. Usually I find that package writers take care not to break pre-existing code, and when they do they include a summary of breaking changes.
    – user9646
    Commented Apr 24, 2018 at 13:26
9

Upload the libraries that you use, along with your LaTeX source. This will ensure that your system and arXiv are compiling your source using the same libraries (rather than different versions of the libraries), which should ensure similar results (any remaining differences are due to the compilation process).

This solution bloats the upload to arXiv. Bloat can be partly avoided by only uploading troublesome libraries. Alternatively, you could try specifying versions of packages.

4
  • interesting. It would bloat my submission though. Also, there might be incompatibilities between library versions and the engines they use. But - fair enough.
    – einpoklum
    Commented Apr 24, 2018 at 13:15
  • @einpoklum I've revised my answer regarding bloat. I've never observed any incompatibilities between library versions and compilation engines, but that might well be a valid point.
    – user2768
    Commented Apr 24, 2018 at 13:24
  • 5
    The only time I tried that, it turned out to be a nightmare. I used a new version of package X, which used package Y, which used package Z and so on and so forth. In the end I was almost including the entirety of texlive in my submission. Moreover, it was not possible to tell arXiv which .tex file was the main document, and I had to stop when one of the libraries (xstring if memory serves) shipped with a .tex file itself, which for some reason arXiv thought was the main file to compile (and failed).
    – user9646
    Commented Apr 24, 2018 at 13:25
  • I've successfully used this solution for a troublesome library, but I appreciate that it won't work in all cases, as highlighted by @NajibIdrissi
    – user2768
    Commented Apr 24, 2018 at 13:27
8

Compile at home. Submit the source code to arXiv. During the submission process, arXiv will produce its own version that you can review. Download it and compare it side-by-side with your own version that you produced at home. If you are happy with it, continue with the submission process and approve the arXiv-produced version. If not, stop and start to debug.

Using as few additional packages as possible helps a lot.

2
  • 4
    I use dozens of additional packages. And fonts. And what-not. Now, suppose that I'm not happy with the result. I'd like something better than repeated guess-attempts.
    – einpoklum
    Commented Apr 24, 2018 at 12:39
  • 1
    @einpoklum What-not is the point. We often use makefiles with custom build steps and shell-escape to generate and preprocess data, fetch it from databases and repositories, etc. The point of using LaTeX is automation.
    – Daniel
    Commented Apr 24, 2018 at 14:17
0

As Jukka Suomela suggests, upload your paper to arXiv and download the compiled version to see if it looks the way you want it to.

If, for some reason, you can't get an arXiv-compiled version that looks the way you want, then I would just compile it myself locally and upload the PDF. Sure arXiv prefers source LaTeX files, but if you can't get arXiv to make your paper look the way you want then there's no reason to try to go through with something just because arXiv prefers it that way. The paper and clear presentation of your work is the important thing about posting to arXiv, having your source LaTeX files available is secondary to that.

2
  • 2
    arXiv detects that the paper was compiled with LaTeX and refuses the PDF if you try to do that.
    – user9646
    Commented Apr 24, 2018 at 19:19
  • 3
    Note that arXiv notices if the PDF was generated by LaTeX, so you may need some kind of workaround
    – Anyon
    Commented Apr 24, 2018 at 19:19

Not the answer you're looking for? Browse other questions tagged .