I would like to use the eLife template in Overleaf for the supplementary material. Since it is very long, I need to include section numbers, to make it easier for the reader to navigate the document.

In the cls file, the set up for the sectioning includes the command:


which I have changed to


This includes the numbers to the section, but there is no spacing between the section number and the section title (so it looks ugly, see image)

enter image description here

and I also get two types of errors when I compile:

Missing number, treated as zero.
<to be read again> 
l.123 ...m when used on the co-infection data set}

A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)


Illegal unit of measure (pt inserted).
<to be read again> 
l.123 ...m when used on the co-infection data set}

Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)

I only know enough about how to use latex to write a document, but I am not able to change the formatting and the look of it. So any guidance on how I can edit the cls file to stop the errors and improve the look would be helpful.

To open the eLife template in overleaf and have a look at the source code, you can follow this link.

Many thanks!

  • In eLife.cls file search for \titleformat commands and add a distance value on fourth mandatori parameter which is empty.
    – Ignasi
    Apr 2, 2019 at 9:15
  • 1
    @Ignasi Would you like to add an answer?
    – CarLaTeX
    Apr 2, 2019 at 14:31

1 Answer 1


eLife.cls associated to eLife template in Overleaf shows following lines:

% section/subsection/paragraph set-up
\titlespacing*{\section}{0pc}{3ex \@plus4pt \@minus3pt}{0pt}
\titlespacing*{\subsection}{0pc}{2.5ex \@plus3pt \@minus2pt}{0pt}
\titlespacing*{\subsubsection}{0pc}{2ex \@plus2.5pt \@minus1.5pt}{0pt}
\titlespacing*{\paragraph}{0pc}{1.5ex \@plus2pt \@minus1pt}{0pt}

According to titlesec documentation, the fourth parameter in \titleformat command is the distance between section number and title. As eLife declares titleformat commands with empty distance, even increasing secnumdepth the distance will be 0.

You'll have to insert some distance in fourth parameter in all these \titleformat commands. Just an example:


You must log in to answer this question.

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