[Tex/LaTex] How to have a single vertically centred equation number for multiline equation in LyX

equationslyxnumbering

I want a single equation number located between the second and third lines (vertically centered behind the lines):

Screenshot of four-line equation with number to right

as in Section 18.6 of the LyX detailed Math manual:

Screenshot from manual

In Lyx, I choose "insert" → "Math" → "numbered formula", then right-lick the written equation to choose AMS align environment, and use \hspace and Ctrl+Space to adjust manually, but I get all lines numbered!

Screenshot showing a number to the right of each line of a four-line equation

I try to delete the unwanted numbers by right clicking and unticking "number this line". This removed only the last number: the top three are still numbered, which is weird:

Screenshot showing a number to the right of the first three lines of a four-line equation

Best Answer

You should select first Insert/Math/Numbered Formula ("Formule numérotée" in my French version of Lyx), and then Insert/Math/Aligned Environment ("Environnement aligné" in French). If I export the resulting program to LaTeX, it contains the aligned environment.

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{luainputenc}
\usepackage{amsmath}
\usepackage{babel}
\begin{document}
\begin{equation}
\begin{aligned}1 & 2\end{aligned}
\end{equation}

\end{document}