# Problem of line-numbering with gather environment [duplicate]

I used

\usepackage{lineno}
\linenumbers


For numbering my lines. I know it has problem with double dollars and for that case I replaced double dollars with  and it worked but now I used \begin{gather*}\end{gather*} to fit an equation but it caused line-numbering doesn't work for a few lines before this equation. Id there any solution for this?

• I added an empty line before and after the gather environment and it solved the problem. But still if there is any other idea, let me know. – AmirHosein SadeghiManesh Apr 4 '17 at 13:18
• One possible solution which does not influence spacing is to wrap displayed math in a linenomath environment. See e.g. this question. – campa Apr 4 '17 at 13:25
• – Ulrike Fischer Apr 4 '17 at 14:07