Document Classes ⇒ lineno package
lineno package
Hi. I'm a true beginner in Latex, and I have a problem:
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)??
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)??
Re: lineno package
Try to add the "displaymath" option to the lineno package.
Re: lineno package
no, that did not help. Actually, it made things worse. A lot of the text with formulas was removed in the tranformation to PDF.
lineno package
This document should help:
http://www.ctan.org/tex-archive/macros/ ... lineno.pdf
http://www.ctan.org/tex-archive/macros/ ... lineno.pdf
Re: lineno package
I have the same problem. I have tried several options of the package but the number is not continuous. The line with equation is not counted.
What should I do?
What should I do?
Re: lineno package
I might have solved the problem. I use the \begin{linenomath} and \end{linenomath} before and after the equation commando. it did the work for me.
rotis
rotis
Re: lineno package
I'm trying to add line numbers to a document and have tried the previous suggestions. When I use \linenumbers prior to \begin{document}, it will print line numbers but randomly skip lines and paragraphs. At least I think it is random.
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.
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
Thanks! That did the trick - though I had to rename my file - otherwise I kept getting a "missing \begin{document}" error.
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.