Hi all,
I'm having a few problems with line numbers appearing for text around equations in my document. I have done all the basics (\usepackage \linenumbers etc), and it all works fine, however for the text above an equation and for a paragraph of text afterwards, the text is not line numbered. It seems this whole section is left out and it will begin again after the equation (starting from the line number value BEFORE the equation).
I have tried all the things i can think of, removing empty lines, new line commands and so on but nothing is working. I have added an attachment of the .txt file here. Does anyone have any idea of how I can keep the line numbers running smooth and continuously? This happens before and after every equation throughout my work and is very annoying...
I'm rather new to Latex and still learning, so please give any help in simple step-by-step form!
Thanks!
Math & Science ⇒ Problems with Line numbers and Equations
Problems with Line numbers and Equations
- Attachments
-
- linenumbers.tex
- (3.02 KiB) Downloaded 606 times
Last edited by glxej on Sat Oct 16, 2010 12:00 pm, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.

Problems with Line numbers and Equations
Hi,
enclose every displayed equation inside a linenomath (or, linenomath* if the lines of the equation should also be numbered) environment. An example:
enclose every displayed equation inside a linenomath (or, linenomath* if the lines of the equation should also be numbered) environment. An example:
Code: Select all
\documentclass[twocolumn]{article}
%
\linespread{1.6}
\usepackage{parskip}
\usepackage[running]{lineno}
\usepackage{mathptmx}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{amsmath}
%
%
\begin{document}
\linenumbers
\section{Equations and Line Numbers?}
\label{sec:3}
Lots of random text, all correctly line numbered. Sunset, the ditch which it all gulped it by my mother was omnipotent in my sister. `Who said the way to help to agree with an armchair, with the identity of a long before dusk, my sister had been referred to me only prevented him profit by its being common, and have tucked up by a tiresome journey of the top of Swine is no Constable in the Carols. `Ah! well!' observed at me. It's only that, if she had seen Miss Havisham's to-morrow morning after ringing the brewery, was dogs, Pip? Don't you go and don't mean in the danger in my first fancies regarding what my never to hunt a jug in the bars with such ophthalmic steps proceed to the little state of having the plea of 'em, Pip. A handsome premium for binding me -- but sometimes to being your temper. This was too sour to him! -- who married Mr Wopsle had tumbled from, and we practically should not so thick, that I had no shadow of these things, seems to go fast, because I could not, however, collect the kitchen fire, and cried. As I should come back again at the warmest intimacy with stop short run, and saw pistols in some more uncomfortable and shivered, and a little window was equal to me; their tramp, tramp -- and, surveying the wide open, and Uncle Pumblechook and she's got some.
This body of text is not numbered..and i dont know why any ideas? (Equation ~\ref{equation1}):
\begin{linenomath}
\begin{gather}
\label{equation1}
\frac{\partial c_j}{\partial t} +\frac {\partial (u_y c_j)} {\partial x}+\frac {\partial (u_y c_j)} {\partial y}+\frac {\partial (u_y c_j)}{\partial z}\\
= \frac{\partial ^2(k_yc_j)}{\partial x^2}+ \frac{\partial ^2(k_yc_j)}{\partial y^2}+ \frac{\partial ^2(k_yc_j)}{\partial z^2} + \phi \notag
\end{gather}
\end{linenomath}
This wont be correctly numbered.... pitchy blaze, which is very correct, for the marshes, through thinking that got leave this state of mind than anything like to be Pomp- eyed. But presently I should not be alarmingly meditative, had been made out nothing else taking him profit by several times, he showed ourselves. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
\begin{linenomath}
\begin{equation}
\label{equation2}
M(x,y) = \sum^{H}_{i=1} \quad \sum^{\phi max}_{j= \phi min} M^{0}_{i ,j} f_{i,j} (x,y)
\end{equation}
\end{linenomath}
Text with line numbers begins here again, pitchy blaze, which is very correct, for the marshes, through thinking that got leave this state of mind than anything like to be Pomp- eyed. But presently I should not be alarmingly meditative, had been made out nothing else taking him profit by several times, he showed ourselves.
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: Problems with Line numbers and Equations
Excellent. It works now. Thank you!