7

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?

5
  • Overleaf use TeXLive (tug.org/texlive), the latexmk tool is a perl script that comes with TeXLive (also available with MikTeX, though you'll have to manually install perl). Compilation via latexmk is just latexmk -pdf file.tex to have latexmk run pdflatex on your file.
    – daleif
    Commented Nov 29, 2019 at 14:45
  • @daleif thanks! I've installed texlive and run the command but I still see a lot of error and the process is aborted while in overleaf it works, I was wondering if there are other steps I've to follow
    – G M
    Commented Nov 29, 2019 at 15:05
  • if you showed the error you got someone could help. otherwise hard to guess how to answer Commented Nov 29, 2019 at 15:25
  • As David mentions we need to see those error and preferable also some code.
    – daleif
    Commented Nov 29, 2019 at 15:52
  • @DavidCarlisle, I would have so many to show that would fill the whole page, I am trying to understand more the problem behind to get some answer that could be useful for the whole community.
    – G M
    Commented Nov 30, 2019 at 7:38

1 Answer 1

8

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

3
  • Could you share a little bit of information about how to use a custom font? It is just located in my overleaf project, do I have to install the font into the OS?
    – Sraw
    Commented Mar 25, 2020 at 16:22
  • Hi, that's a separate question so should be asked separately, but you can use any OTF or TTF font with fontspec (so LuaLaTeX or XeLaTeX) by simply placing the font file in the project's folder and loading it with \setmainfont{fontfile.ext}.
    – yo'
    Commented Mar 25, 2020 at 16:33
  • Thank you. It should be a separate question. If there is more issue, I will make another question.
    – Sraw
    Commented Mar 25, 2020 at 16:34

You must log in to answer this question.

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