1

When I use fleqn equation for amsmath package, I found that the paragraphs followed by equation is not numbered by lineno package. An example is

\documentclass{article}
\usepackage[fleqn]{amsmath}
\usepackage{lineno}
\usepackage{blindtext}
\begin{document}
\linenumbers
\blindtext[2]
\begin{equation}\label{eq:test}
    a^2+b^2=c^2
\end{equation}
\blindtext[3]
\end{document}

If the fleqn option is not used in the above code, the lineno package works well and all the text lines is numbered.

How can I make lineno work when the fleqn option is used?

2

You need to use a linenomath environment around the equation.

\documentclass{article}
\usepackage[fleqn]{amsmath}
\usepackage{lineno}
\usepackage{blindtext}
\begin{document}
\linenumbers
\blindtext[2]

\begin{linenomath}
    \begin{equation}\label{eq:test}
        a^2+b^2=c^2
    \end{equation}
\end{linenomath}

\blindtext[3]
\end{document}
  • 1
    Thanks for your answer. By adding a empty line between the text paragraph and the equation, the paragraph can be numbered. But the additional empty lines introduce the extra large vertical space between the text and math equation. My goal is to numbered the text paragraph with the normal space. – Ice0cean Aug 16 at 7:24
  • @Ice0cean yeah sorry, it was just to make it easier to see. Use the linenomath environment around the equation. – Niklas Aug 16 at 7:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.