[Tex/LaTex] What are the steps for compiling Overleaf projects offline and getting consistent results

compilingoverleaf

I am trying to compile Overleaf projects offline and I was wondering what is the best procedure to get consistent results.

I don't understand which distribution Overleaf is using, furthermore, I am not very familiar with Latexmk that it seems it's used by Overleaf for compiling the projects. Is there any workflow or procedure I can follow to get the same result of compiling the project online when I compile the project offline?

Best Answer

(Tom from Overleaf Support Team writing.)

Note that to allow offline compilation of Overleaf projects, you shall do the following:

  • Ensure that there are no errors in your document. By errors, I mean those indicated by the red balloon next to the "Recompile" button. The yellow and blue warnings are fine for this.

  • Take the contents of the latexmk file (note: it's not latexmk.tex, it's without any file extension) from How does Overleaf compile my project? and put it in the document's folder (it doesn't cause any harm even in Overleaf).

  • Ensure that you use latexmk -pdf as the compiler in your computer, and not pdflatex or anything else.

  • I recommend renaming the main file you compile to output.tex.

  • Preferably use TeXLive 2018. If you don't have it, certainly TL2019 is better than TL2017 or earlier as there were some big changes in input handling between TL2017 and TL2018. Still, watch for issues with recent changes in packages (Google is your friend in this, most incompatibilites have been discovered already by someone else).

After following these steps, you should be able to compile your documents offline.