Adding line numbers to a LaTeX manuscript for peer review

Help centre › LaTeX › Review and submission · Packages: lineno

Add \usepackage{lineno} to the preamble and \linenumbers after \begin{document}: every line of text is numbered in the left margin. \modulolinenumbers[5] prints every fifth number, and many journal classes have a review option that does this for you.

A complete example

A whole document: paste it into an empty project and compile it.

\documentclass{article}
\usepackage{amsmath}
\usepackage{lineno}
\linenumbers
\begin{document}
\section{Introduction}
Reviewers cite line numbers in their reports, so a numbered manuscript is easier
to review. This paragraph is long enough to fill several lines of text, and each
of them carries a number in the left margin of the page when the document is
compiled with the lineno package.
\begin{linenomath*}
\begin{equation}
  E = mc^2
\end{equation}
\end{linenomath*}
The paragraph after the equation keeps its numbers as well, because the display
is wrapped in the linenomath environment provided by the package.
\end{document}

The options

  • \modulolinenumbers[5]: print only every fifth number (all lines are still counted).
  • \usepackage[pagewise]{lineno}: start again at 1 on each page. The default counts through the whole document, which reviewers usually prefer.
  • \usepackage[switch]{lineno}: numbers on the outer margin, left in the left column and right in the right column of a two-column page.
  • \usepackage[right]{lineno}: numbers in the right margin.
  • \nolinenumbers stops numbering; \resetlinenumber[1] restarts the count.

Numbers around equations

lineno numbers a paragraph when it is finished, and a display equation interrupts the paragraph; with some versions the lines just before a display lose their numbers. Wrapping the display in linenomath (or linenomath*, which leaves the equation lines themselves unnumbered) fixes it, as in the example. Recent versions of lineno handle amsmath environments themselves, so check the PDF before wrapping every equation.

Two-column documents

lineno numbers both columns. With the default left numbers, the right column's numbers fall in the gap between columns; switch moves them to the outer margin so they do not crowd the text.

\documentclass[twocolumn]{article}
\usepackage[switch]{lineno}
\linenumbers
\begin{document}
\section{Text}
This is the first column. It is numbered on the left. The text goes on long
enough to fill a few lines, so the numbers are easy to see in the margin.
\newpage
This is the second column. With the switch option its numbers are printed on
the right, in the outer margin, rather than in the gap between the columns.
\end{document}

What is not numbered

Captions, tables, footnotes and the title block are not numbered by default: lineno numbers the lines of ordinary paragraphs. Reviewers refer to figures and tables by their own numbers, so this is usually what journals expect.

Common mistakes

In journal templates

Errors you may meet

Related

The examples on this page were compiled with pdfLaTeX to check that they work as shown. LaTeX quick reference · LaTeX errors explained