Finally switching from Word to latex... Should have done years ago

For the last paper of Margot thesis on the diversity of Mamiellophyceae in the OSD dataset I decided to switch from Word to Latex using the Overleaf web site. It took some effort and adjustment, but the effort might be really worthwhile.


  • Open an Overleaf account
  • Swtich to Overleaf 1 or Overleaf 2 . Overleaf 2 is better for tracking changes but misses some of the necessary feature for auxiliary files. It does not have direct Git support and one has to go through GitHub
  • Create a new project based on the Scientific Reports template.
  • Main text is in file main.tex
  • Begin to fill in the template

Synchronizing with computer

Version Overleaf 1

Version Overleaf 2

  • From Overleaf : Menu -> Synchronize with GitHub
    • Create new repository
  • Go to GitHub
    • Clone repository on your computer using GitHub desktop
  • Updates
    • from Overleaf -> Push or Pull changes to/from GitHub
    • from your computer - > Use GitHub desktop to push or pull

Supplementary material

  • Create a new file called main-sup.tex which contains all the Supplementary
  • Need to change the name of the Figures and tables
  • Cannot use \maketitle because it requires abstract
  • In order to be able to reference the figures and tables from the supplementary material, you need to put some helper code in the main document (main.tex - see code below), reference the Supplementary file in main.tex and refresh the Supplementary file each time you restart the Overleaf session.

Figures (directory \fig)

  • Do the figures under R (using an Rmd file) and save as pdf
  • If necessary improve with Corel Draw or Illustrator
  • Reexport as pdf
  • Open pdf and select area of figures
  • Save as png in the directory \fig

Tables (directory \tables)

  • Store tables in Excel file
  • Read Excel in R and export as Latex using xtable library
  • Choose the option to have the caption on top
  • If the table is too big use scalebox = 0.75
  • If the table is too long, use the longtable option tabular.environment = "longtable", floating=FALSE (note: floating must be set to FALSE in this case)
  • File is stored in \table


  • Do not use the Overleaf Mendeley importer because it does not handle the italics (coded in HTML in Mendeley Micromonas)
  • Export the group you are working in as a bib file
  • Run small R routine to change the HTML codes for Italics to the Latex code for italics.
  • Place the file into your git directory and push to Overleaf

Latex Code

Main document - header


\usepackage{setspace} % for spacing of paragraphs
\usepackage{lineno} % for line numbers
\usepackage{gensymb} % for degree sign \degree

% (See
\newcommand*{\addFileDependency}[1]{% argument=file name and extension
  \IfFileExists{#1}{}{\typeout{No file #1.}}

\externaldocument{main_sup} % This is the supplementary material

% Title and authors
\title{Novel diversity within GOT Mamiellophyceae }
\author[1]{Jon Snow}
\author[1,*]{Daniel Vaulot}
\affil[*]{Corresponding author: (ORCID 0000-0002-0717-5685)}
\keywords{phytoplankton, xxx}


Supplementary - header


\usepackage{setspace} % for spacing of paragraphs
\usepackage{lineno} % for line numbers
\usepackage{gensymb} % for degree  \degree
\usepackage{longtable} % for long tables
\usepackage{hanging} % for hanging indents

% To change the name of the Figure to Fig. S1 etc...
\DeclareCaptionLabelFormat{addS}{#1 S#2}