# Numbering equations in Appendix

I am trying to number the formulas in the appendices in a different way than the rest of the document. Throughout the document I am numbering the equations according to the chapter and section. So if an equation is the third equation in the 2nd section of the 1st chapter it will be numbered as (1.2.3).

On the other hand, I am trying to number a formula in the Appendix A as (A.1). Is there a way to do this on lyx?

• Have you tried doing so? Commented Dec 10, 2015 at 14:52
• I don't know how to automatically change the numbering to follow the (A.1) format. When a try to number this formula, it is just numbered in the same format as (1,2,3) Commented Dec 10, 2015 at 14:56

The following code seems to give what you want: numbering equations within sections in the main matter and numbering with chapter in appendices. I have used the \numberwithincommand from amsmath but other solutions exist.

I have no idea about Lyx but, if I remember well, you can always edit your Lyx file with a text editor. The important is to insert the \numberwithin commands.

\documentclass[a4paper,12pt]{book}
\usepackage{amsmath}
\begin{document}
\numberwithin{equation}{section}
\chapter{One}
\section{One}
$$a = b$$
\section{Two}
$$a = b$$
$$a = b = c$$
\chapter{Two}
\section{One}
$$a = b$$
\section{Two}
$$a = b$$

\appendix\newpage\markboth{Appendix}{Appendix}
\renewcommand{\thesection}{\Alph{section}}
\numberwithin{equation}{section}
\section{Appendix}
$$a = b$$
\chapter{Appendix two}
$$a = b$$
\end{document}


Note that I have also modified the headings so that you have now proper headings without defining chapters in the appendix.

• Is there a similar way to do this for when Appendix A is a section instead of a chapter, and still obtain the same numbering (A.1) ? Commented Dec 10, 2015 at 15:42
• Sure. See my modified answer. Commented Dec 10, 2015 at 15:53
• your code has worked thank you very much. However my only problem is that I do not want to label Appendix A as a chapter but as a section, and as a result, the equation is numbered as (.1.1) Commented Dec 10, 2015 at 16:00
• Please see my new code as an edit of the old one. In the new code there is no more chapters in the appendix. Everything works as you seemed to request. Try cutting and pasting the code and compile it. Commented Dec 10, 2015 at 16:30

I am working with Lyx v2.2

I assume you have created an Appendix to the document.

Based on the Default Document settings under Document>Settings>Modules there is available 'Number Equations by Section'. Select this by Adding to the 'Selected' box from the 'Available' box.

Equations in the Main part of the Document should now be numbered by section number eg (2.32) as the 32nd equation in section 2. Provided a section heading has been created in the Appendix, the equations will be numbered by appendix section eg (A.32) as the 32nd equation in appendix section A