Since I want to add line number in my manuscript, I have to wrap align environment into linenomath environment to have right numbering. I wanted to define new environment in preamble in which I want Latex to put the math inputting into these environments, but It didn't work. Can you help me please? Here is my codes.

\usepackage[switch*, displaymath,pagewise, mathlines]{lineno}

\newenvironment{Align}{\begin{linenomath*}  \begin{align}}{\end{align}   

  • Not clear what you want. Should lines of display maths be numbered or not? – Bernard Sep 25 '16 at 12:28
  • 2
    ... "but it didn't work". Please be more specific. E.g., do tell us if you get an error and/or warning messages. – Mico Sep 25 '16 at 12:38
  • @Bernard I guess line numbers should be omitted for aligned math. – gernot Sep 25 '16 at 13:31
  • @gernot: But that is the default! B.t.w., the displaymath is obsolete: it's the default now. – Bernard Sep 25 '16 at 13:33
  • @Bernard True. Strange. So the purpose remains a mystery, but the problem is solved ;-) – gernot Sep 25 '16 at 13:37

This is a particular problem of the align environment, see also newenvironment: error with \begin{align} and \end{align}. In your case, you have to define your environment as

| improve this answer | |
  • Yes, but lineno doesn't seem to work correctly with align: it displays two consecutive numbers (one above the other) for the last line, even if there's only one line. – Bernard Sep 25 '16 at 13:32
  • @Bernard Well, no harm is done: \linenomathNonumbers suppresses line numbers. – gernot Sep 25 '16 at 13:42

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