How to synchronize an Overleaf Project with a GitHub repository

Writing papers with a large number of co-authors can be complicated endeavour. This why Overleaf is an interesting choice, as it allows for multiple people to edit a same LaTeX document simultaneously. However, online compiling on Overleaf requires time and you will also want to have access to your files on your laptop and use your favorite LaTeX editor. This is why synchronizing your paper in an Overleaf project as well as in a GitHub repository GitHub. This will also grant you access to the laboratory’s LaTeX good practices repository.

Main reasons why you will want to synchronize your paper on Github and Overleaf

  • Allows for multiple contributors to work on a project simultaneously
  • Allows to backup and archive your paper in the common laboratory repository
  • Allows to easily export your paper in arXiv friendly format

Procedure

  1. In your Overleaf dashboard, create a new blank project using and give it a relevant name (e.g., publication_conference/journal_name_firstnameLastname)
  2. In the project page on Overleaf, select and
  3. Select “Create a Github repository”
  4. Select “norlab-ulaval” as Owner and select the “Private” option so you can choose who can commit to the repository

  5. The repository should now be visible on the laboratory’s GitHub page :

    norlab-ulaval

  6. Clone the repository on you computer

    git clone <github_repo_url>
    
  7. Add the LaTeX good practices repository as a Git submodule, as shown below :

    git submodule add https://github.com/norlab-ulaval/latexGoodPractices.git
    
  8. Push the changes from your local repository to the remote GitHub repository
  9. Pull the changes from the Overleaf project page by selecting , and

Your project is now synchronized between the two platforms and you can now push or pull changes directly from the Overleaf project page. Be careful when editing the document on your laptop at the same time as it is being changed on Overleaf as this may cause merging conflicts.

Exporting an article using Overleaf

One of the main advantages of using this method for your projects is that Overleaf offers a tool to export your project for numerous publishing platforms, notably arXiv. Simply compile your project once it is completed and select tab on the top left of the project page. Then select the platform where you wish to publish and Overleaf will create the necessary files.

It should be noted that an issue related to the biblatex file format is likely to happen when compiling the project on arXiv. This issue can be resolved by cloning this Python script in your local repository and following the instructions to create a biblatex file that is compatible with arXiv. More details on this issue can be found here.