# latex linenumbers do not work properly

I am having some problem with lineno. Specifically, this happens when I introduce the first equation in my document. I the following example I get a wrong numbering of text lines in the latex resulting pdf. In particular, in all "bla bla" part the numbering is missing.

I will try to make myself clear.

(I apologize to everyone for my previous and wrong post)

Here the example:

\documentclass[review,10pt]{elsarticle}
\usepackage{lineno}

\usepackage{amsmath}
\usepackage{amssymb}

\linenumbers

\begin{document}

\section{bla abcd}
bla bla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla blabla bla
%
%
$$\label{eq.2d.hy} 1+1=2$$
%

abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd

\end{document}



This example works only if I comment the equation or either \usepackage{amsmath} \usepackage{amssymb}.

However, I need both amsmath and amssymb packages.

What I am experiencing is a generla problem or is related only to elsevier package?

Thanks in advance for any kind of help.

Diedro

• tex.stackexchange.com/questions/25784/… does that help? Oct 16, 2020 at 20:53
• From rst if those sections look strange, secondly, lineno has a manual, might be worth a read. Additionally, please always post full minimal examples not sniplets like this that others cannot test without having to add stuff to them Oct 16, 2020 at 20:53
• Welcome to TeX.SX! If I turn your code fragments into a compilable minimal working example (MWE) by adding a documentclass as well as the relevant packages and commands and by correcting the wrong syntax of \section(it should be \section{test} instead), I end up with the following output: i.stack.imgur.com/rCMAB.png If you also want the equation to get a line number, add the mathlines option to the lineno package. Oct 16, 2020 at 20:55

Your MWE works me without any issues, but please follow the order of packages given below:
\usepackage{amsmath}

Option mathlines will helps you to get the linenumber in display math, hope this will solve the issue...