Document Classes ⇒ lineno: no line numbers but one line per page
lineno: no line numbers but one line per page
Hi,
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}
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.

-
- Posts: 55
- Joined: Thu Oct 30, 2008 4:12 pm
lineno: no line numbers but one line per page
On the one occasion I used the lineno package, I used it as an environment, thus:
Does that help?
Code: Select all
Code, edit and compile here:
\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
Unfortunately not, I tried both variants, using the environment for parts of the document and for the whole.
The result is always the same.
Thanks,
Robert
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
Have you had any success with this yet? Have you tried reordering the packages to see if that makes a difference? Have you tried paring down what packages you have to make a minimum working (but buggy!) example?
Re: lineno: no line numbers but one line per page
I haven't had any success. I gave up after reading that the revtex package I need is generally not working with lineno, and that this problem is currently unsolved.
Good luck,
Robert
Good luck,
Robert
-
- Posts: 707
- Joined: Tue Mar 25, 2008 5:02 pm
lineno: no line numbers but one line per page
From the APS web site:
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
I had the same problem. But with adding the line
\RequirePackage{lineno}
at the beginning of the document it also works for me with revtex4.
I hope it'll also works for you
\RequirePackage{lineno}
at the beginning of the document it also works for me with revtex4.
I hope it'll also works for you