Document Classes ⇒ lineno package
lineno package
I'm trying to use the lineno-package to numerate the lines in my manuscript.
It does not work properly: The first 70 lines got a number, but after that it seems to me to be only random lines that get number. This problem only occurs in a part with a lot of equations.
Any hint how to solve the problem (I’m using WinEdt, and writing in an elsart-environment)??
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Re: lineno package
Re: lineno package
lineno package
http://www.ctan.org/tex-archive/macros/ ... lineno.pdf
Re: lineno package
What should I do?
Re: lineno package
rotis
Re: lineno package
I have tried \begin{linenumbers} ... \end{linenumbers} within the document, but then I get the error, "missing \begin{document} ". At this point, even "undoing", i.e. ^Z to get my original document back will erase this error. Any other suggestions? Thanks for any help.
lineno package
Maybe this will help... (though it might be a solution to a different lineno problem) Take a look at the fix at:rotis wrote:This problem only occurs in a part with a lot of equations.
To make a long story short(er), lineno is not very compatible with popular amsmath environments. So you need to patch them all to get them to automatically play nice with lineno. I tried to make this simple with the following (insert in your preamble):
Code: Select all
\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}%
}
Code: Select all
\patchAmsMathEnvironmentForLineno{environment_name}
Code: Select all
\patchBothAmsMathEnvironmentsForLineno{environment_name}
It's not perfect, but IIRC, it's a big improvement.
Re: lineno package
lineno package
I don't quite understand the file renaming thing.lubejob wrote:Thanks! That did the trick - though I had to rename my file - otherwise I kept getting a "missing \begin{document}" error.
You may notice that some math environments receive two numbers. I haven't figured out a good way to solve that problem. In fact, I'm not quite sure it's possible while using lineno. It's a tradeoff. At least the line numbers in the rest of the text are still there.