4

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.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[switch*, displaymath,pagewise, mathlines]{lineno}
\leftlinenumbers
\linenumbers

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

\begin{document}
\begin{Align}
x+y=10
\end{Align}
\end{document}
AYBRXQD
  • 737

1 Answers1

2

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

\newenvironment{Align}%
  {\linenomathNonumbers\align}%
  {\endalign\endlinenomath}
gernot
  • 49,614
  • 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