Document Classes ⇒ lineno: no line numbers but one line per page
lineno: no line numbers but one line per page
I am trying to add linenumbers to a document using lineno. When using the \linenumbers command, it does not add any line numbers but shows one line per page. So that my document has as many pages as lines.
I have already added the solutions suggested elsewhere in this forum, for solving problems with amsmath.
Thanks for suggestions,
Robert
Here is my preamble:
\documentclass[preprint,aps,prb,endfloats*]{revtex4}
\usepackage{dcolumn}
\usepackage{amsmath,revsymb}
\usepackage{graphics}
%\usepackage{ednotes}
\usepackage[displaymath]{lineno}
%\usepackage{numline}
\newcommand*\patchAmsMathEnvironmentForLineno[1]{%
\expandafter\let\csname old#1\expandafter\endcsname\csname #1\endcsname
\expandafter\let\csname oldend#1\expandafter\endcsname\csname end#1\endcsname
\renewenvironment{#1}%
{\linenomath\csname old#1\endcsname}%
{\csname oldend#1\endcsname\endlinenomath}}%
\newcommand*\patchBothAmsMathEnvironmentsForLineno[1]{%
\patchAmsMathEnvironmentForLineno{#1}%
\patchAmsMathEnvironmentForLineno{#1*}}%
\AtBeginDocument{%
\patchBothAmsMathEnvironmentsForLineno{equation}%
\patchBothAmsMathEnvironmentsForLineno{align}%
\patchBothAmsMathEnvironmentsForLineno{flalign}%
\patchBothAmsMathEnvironmentsForLineno{alignat}%
\patchBothAmsMathEnvironmentsForLineno{gather}%
\patchBothAmsMathEnvironmentsForLineno{multline}%
\patchAmsMathEnvironmentForLineno{array}%
\patchAmsMathEnvironmentForLineno{split}%
}
\linenumbers
\begin{document}
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
-
- Posts: 55
- Joined: Thu Oct 30, 2008 4:12 pm
lineno: no line numbers but one line per page
Code: Select all
\begin{document}
...
\begin{linenumbers}
numbered lines of text blah-de blah blah
\end{linenumbers}
...
\end{document}
Re: lineno: no line numbers but one line per page
The result is always the same.
Thanks,
Robert
-
- Posts: 55
- Joined: Thu Oct 30, 2008 4:12 pm
lineno: no line numbers but one line per page
Re: lineno: no line numbers but one line per page
Good luck,
Robert
-
- Posts: 707
- Joined: Tue Mar 25, 2008 5:02 pm
lineno: no line numbers but one line per page
Section 4 of ulineno.pdf ("Numbering modes") essentially tells you that the way lineno.sty tricks TeX into giving it the ability to number the lines is by pretending that the page actually ends after every line. In RevTeX4, they've obviously done something that forces lineno.sty's pretend world to become reality....Why does the \linenumbers command cause page breaks at each line?
REVTeX 4 is incompatible with lineno.sty. We are working on fixing this for the next release. Meanwhile, please refer to CTAN's User's Guide. Section 4, "Numbering modes," gives details on running line numbers and pagewise line numbers.
Re: lineno: no line numbers but one line per page
\RequirePackage{lineno}
at the beginning of the document it also works for me with revtex4.
I hope it'll also works for you