0

My line numbers are restarting midpage whenever there is a new section heading or a new environment (like an indented quote). Is there something I need to add to these commands (below) in order to make sure that the page numbers are continuous within each page?

\reversemarginpar
\begin{pagewiselinenumbers}

\linenumbers
\modulolinenumbers[5]
  • 1
    Welcome to TeX.SX! I intended your code by four spaces in order to get better formatting. Please give us a full but minimal code which reproduces your problem. We do not want to set the problem up for you. In your last sentence you talk about page numbers. Is that correct? – LaRiFaRi Jan 13 '15 at 10:22
  • In essence, my problem was that I wanted the line numbering to restart based on page breaks, but it was restarting with "5" (because it only numbers every five lines) in random places. In any event, I did not get to try your fix, since I tried the other answer first and now the line numbering works. But... it is still a mystery why (see that comment). – Greg Jan 16 '15 at 16:38
2

Using lineno package, don't use double dollar $$ $$ but use \[ \] instead.

It works perfectly.

\documentclass{report}
\usepackage{lineno,lipsum}

\begin{document}
\lipsum[2]

\section{title}

\lipsum[1]
\begin{quotation}
    \lipsum[2]
\end{quotation}

\lipsum[2]
\end{document}

enter image description here

  • Thank you for your answer. I changed the $$ to [ ] as you suggested. It fixed the problem but suddenly other commands I had used stopped working properly. Oddly, after I changedthe [ ] back to $$, the numbers have been working still ! I don't know why. I had already trashed the aux files several times before trying your fix, so I don't think that did it. Mystery, but it is working. So, thank you. – Greg Jan 16 '15 at 16:35

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.