LyXEquation numbering in appendix

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
dlorenz
Posts: 10
Joined: Mon Jul 28, 2008 3:03 pm

Equation numbering in appendix

Post by dlorenz »

Hi everyone,
I am a new user of Lyx and am trying to number equations in a technical paper. In the appendices of the paper, I would like the numbering to restart and to have the letter of the appendix before the number (ex. A.1, A.2, etc., then B.1, B.2,...) Couldn't find the way to do it in Lyx. Anyone can help????
Thanks a lot
Laura

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Re: Equation numbering in appendix

Post by Stefan Kottwitz »

Hi Laura,

welcome to the board!
Which document class are you using? For instance with the report class it's the default behavior. After \appendix the equations will be numbered (A.1) and so on.

Stefan
LaTeX.org admin
dlorenz
Posts: 10
Joined: Mon Jul 28, 2008 3:03 pm

Equation numbering in appendix

Post by dlorenz »

Stefan_K wrote:Hi Laura,

welcome to the board!
Which document class are you using? For instance with the report class it's the default behavior. After \appendix the equations will be numbered (A.1) and so on.

Stefan

Hi Stefan,

Thanks for the reply! I'm using the article class, because I need abstract, references, etc...is there a way to do it without changing class?

Laura
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Equation numbering in appendix

Post by Stefan Kottwitz »

Of course it's also possible with the article class. It's just not the default behaviour.
Use this line inside your document preamble:

Code: Select all

\numberwithin{equation}{section}
The the equations will be numbered by section. Not only in the appendix, also in the main text, but I think this would be consistent.

Stefan
LaTeX.org admin
Ted
Posts: 94
Joined: Sat Jun 23, 2007 4:11 pm

Equation numbering in appendix

Post by Ted »

Stefan_K wrote:

Code: Select all

\numberwithin{equation}{section}
The the equations will be numbered by section. Not only in the appendix, also in the main text, but I think this would be consistent.
Remember that \numberwithin doesn't come from LaTeX. It comes from the amsmath package.
So you'll need a

Code: Select all

\usepackage{amsmath}
in your preamble.

Also note that \numberwithin need not be in the preamble. Putting it just after the \appendix will number appendix equations as desired but will leave the rest of the document using the standard numbering:

Code: Select all

\appendix
\numberwithin{equation}{section}
Last edited by Ted on Mon Jul 28, 2008 4:05 pm, edited 1 time in total.
-- Ted [home/blog]
dlorenz
Posts: 10
Joined: Mon Jul 28, 2008 3:03 pm

Equation numbering in appendix

Post by dlorenz »

Stefan_K wrote:Of course it's also possible with the article class. It's just not the default behaviour.
Use this line inside your document preamble:

Code: Select all

\numberwithin{equation}{section}
The the equations will be numbered by section. Not only in the appendix, also in the main text, but I think this would be consistent.

Stefan


Thanks!!
dlorenz
Posts: 10
Joined: Mon Jul 28, 2008 3:03 pm

Equation numbering in appendix

Post by dlorenz »

Ted wrote:
Stefan_K wrote:

Code: Select all

\numberwithin{equation}{section}
The the equations will be numbered by section. Not only in the appendix, also in the main text, but I think this would be consistent.
Remember that \numberwithin doesn't come from LaTeX. It comes from the amsmath package.
So you'll need a

Code: Select all

\usepackage{amsmath}
in your preamble.

Also note that \numberwithin need not be in the preamble. Putting it just after the \appendix will number appendix equations as desired but will leave the rest of the document using the standard numbering:

Code: Select all

\appendix
\numberwithin{equation}{section}
--Ted
Thanks!!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Equation numbering in appendix

Post by Stefan Kottwitz »

Ted wrote:Remember that \numberwithin doesn't come from LaTeX. It comes from the amsmath package.
So you'll need a

Code: Select all

\usepackage{amsmath}
in your preamble.
I assumed amsmath would already be used when writing a technical paper. That may be set by LyX, so perhaps the line above is not needed if LyX did it. Laura, just in case: look into the menu Document -> Settings -> Math options and change "Use AMS math package automatically" to "Use AMS math package" if needed.

Stefan
LaTeX.org admin
dlorenz
Posts: 10
Joined: Mon Jul 28, 2008 3:03 pm

Equation numbering in appendix

Post by dlorenz »

dlorenz wrote:
Ted wrote:
Stefan_K wrote:

Code: Select all

\numberwithin{equation}{section}
The the equations will be numbered by section. Not only in the appendix, also in the main text, but I think this would be consistent.
Remember that \numberwithin doesn't come from LaTeX. It comes from the amsmath package.
So you'll need a

Code: Select all

\usepackage{amsmath}
in your preamble.

Also note that \numberwithin need not be in the preamble. Putting it just after the \appendix will number appendix equations as desired but will leave the rest of the document using the standard numbering:

Code: Select all

\appendix
\numberwithin{equation}{section}
--Ted
It works perfectly!
nolromer
Posts: 1
Joined: Mon Jul 17, 2023 4:52 pm

Equation numbering in appendix

Post by nolromer »

Thanks, this exactly did the trick! And it looks much better in the sections in my article as well.
Post Reply