# How to have a single vertically centred equation number for multiline equation in LyX

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

as in Section 18.6 of the LyX detailed Math 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!

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:

• Before any numbering is done, can you just right-click on the line that you want numbered and click on "Number this line" ? (that is to say, I don't understand why you are starting with all lines numbered). Mar 23 '16 at 4:48
• But I want the number to be located between the second and third lines (vertically centered behind the lines), as in the Section 18.6 of LyX detailed Math Manual Version 1.5.6. I have updated the manual section into my question. Mar 23 '16 at 4:58
• @Wendy If you have worked it out, please record your solution as an "answer": comments are ephemeral, and don't show up in searches. It would also help enormously if you supplied what code you can. In LyX, go to the menu and select View > Source Pane to show the code (see this example). The more of this kind of thing you can do, the better help you will get! Mar 23 '16 at 11:43
• Thx David, I just did it. It is exciting to write my first answer on this site: ) Mar 23 '16 at 12:19

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{aligned}1 & 2\end{aligned}

\end{document}

• Thank you for your reply. I followed your instruction, and two blue boxes appeared. Then which part shall I put in each box? Could you please provide a step-by-step guide (in LyX, as I have limited knowledge in LateX) on how I can get the result I want as shown by the first picture? That is, the number is located between the second and third lines (vertically centered behind the lines). This question bothered me for many hours! Mar 23 '16 at 5:23
• W in the first box, =a+b+c+d+e+f+g in the second. Then add a new line (there is a button in the math tool line for it) and do similar things for the other lines. Sorry, I've got not enough time for more help until this evening… Mar 23 '16 at 5:30
• I think the missing step for Wendy might be to right click and then click on on "Number Whole Formula" (or "label"). Mar 23 '16 at 5:31
• Thx a lot for both of your prompt help. Franck's second post works perfectly. Scttkosty's second post may help others but not for the mistake I made: I right click the written equation to choose the AMS aligned, instead of inserting AMS aligned first, and then copy relevant parts into the two blue boxes. Mar 23 '16 at 5:58
• My tip for those who have the same problem in the future: ensure your mouse is at the end of the line you just entered, so that it is within the slightly smaller four pink rectangles (not the most outside four pink rectangles), then click "Add row" from the math panel. Mar 23 '16 at 6:18

I have the following final solution based on the prompt and great help from the experts. According to the suggestion, I included the source code as well: