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.\nolinenumbersstops 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
- Put
\linenumbersin the preamble or straight after\begin{document}; placed later, earlier pages stay unnumbered. - Loading lineno twice (once in the class, once by you) can give an option clash; with a review option of the class, do not load it yourself.
- Remove line numbers from the final accepted version unless the journal wants them; a journal's production staff usually typeset from your source.
In journal templates
- acmart: the
reviewoption numbers the lines, for example\documentclass[sigconf,review]{acmart}. - revtex: the
linenumbersclass option loads lineno and numbers the lines. - elsarticle: the
reviewoption widens the line spacing but does not number lines; load lineno and call\linenumbersyourself. - IEEEtran: neither
peerreview(a cover page for anonymous review) nordraftcls(wider line spacing) numbers lines; add lineno if the journal asks for them. - Two-column journal classes: use lineno's
switchoption so numbers stay in the outer margins.
Errors you may meet
- LaTeX Error: Option clash for package <name>A package is loaded twice with different options, often because the class or another package loaded it first. Load it once, with all options.
- Undefined control sequence.LaTeX met a command it does not know: usually a typo, or a command whose package is not loaded. The log's l. line ends with the culprit.
Related
- Double spacing a LaTeX manuscript for submissionDouble-space a LaTeX document with the setspace package (\doublespacing, \setstretch), or a journal class's review option.
- Show changes between two versions of a LaTeX paperMark a revision's changes for reviewers: latexdiff compares old and new .tex files; the changes package marks additions and deletions by hand.
The examples on this page were compiled with pdfLaTeX to check that they work as shown. LaTeX quick reference · LaTeX errors explained