7

I was trying to get all the lines numbered in my document, as explained in this question: Show the number of lines in margin

However, when I added the lines:

\usepackage{lineno}
\linenumbers

to the top of my document, the document got split into hundreds of pages - one line per page. How can I get it to work?

EDIT: The preamble of the document looks like this:

\documentclass[12pt,twoside,pra,aps,amssymb,amsfonts,amsmath,tightenlines]{revtex4}

\usepackage{dsfont}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{natbib}
%\usepackage{url}
\usepackage{lineno}
\linenumbers

EDIT 2: Minimal example:

\documentclass[12pt,twoside,pra,aps,amssymb,amsfonts,amsmath,tightenlines]{revtex4}

\usepackage{dsfont}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{natbib}
%\usepackage{url}
\usepackage{blindtext}
\usepackage{lineno}
\pagewiselinenumbers


\begin{document}
\Blindtext

\end{document} 
2
  • Coincidentally my test document also uses RevTeX - and doesn't show the same issue. I think a full MWE would be in order.
    – Chris H
    Sep 24, 2013 at 15:28
  • @ChrisH, the example is provided now. Thanks!
    – Grzenio
    Sep 24, 2013 at 15:32

1 Answer 1

11

Your MWE can be greatly reduced to be

\documentclass{revtex4}
\usepackage{lineno}
\usepackage{blindtext}
\pagewiselinenumbers

\begin{document}
\Blindtext
\end{document} 

With such a simple MWE it becomes clear that the problem is an interaction between revtex4 and lineno. Searching the lineno documentation yields:

  1. if a class changes \output (APS journal class revtex4, e.g.), lineno.sty should be loaded by \RequirePackage[here presumably following some options in brackets]{lineno} preceding \documentclass.

Leading to a working MWE of

\RequirePackage{lineno}
\documentclass{revtex4}
\usepackage{blindtext}
\pagewiselinenumbers

\begin{document}
\Blindtext
\end{document} 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.