Math & ScienceEquation numbering

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
User avatar
Kaspars
Posts: 37
Joined: Mon Feb 14, 2011 11:51 am

Equation numbering

Post by Kaspars »

Here is my latex code:

Code: Select all

\documentclass[12pt,a4paper,fleqn]{article}

\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{polyglossia}
\usepackage{appendix}
\setotherlanguages{english}
\usepackage{graphicx}
\usepackage{amsmath}

\begin{document}
\tableofcontents
\begin{abstract}
\end{abstract}
\section{first section}
\begin{equation}
g(t)=\frac{sin\Omega t}{\pi t}
\end{equation}
\section{second section}
\begin{equation}
g(t)=\frac{sin\Omega t}{\pi t}
\end{equation}
\subsection{Subsection}
\begin{equation}
g(t)=\frac{sin\Omega t}{\pi t}
\end{equation}
\end{document}
If you compile this, you can see something like this:
1. first section
formula ____________(1)
2. second section
formula ____________(2)
2.1. subsection
formula ____________(3)

Please help me with numbering... I want that numbering starts with every new section, so in my file, I want, that it looks like this:
1. first section
formula ____________(1.1)
2. second section
formula ____________(2.1)
2.1. subsection
formula ____________(2.1.1)

Thanks for help :)
Last edited by Kaspars on Thu Feb 24, 2011 8:59 am, edited 1 time in total.

Recommended reading 2024:

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

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

Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

Equation numbering

Post by Frits »

I want that numbering starts with every new section
That can be done by putting the following in the preamble:

Code: Select all

\numberwithin{equation}{section}
You might also want your figures and/or tables in that format, here's how:

Code: Select all

\numberwithin{figure}{section}
\numberwithin{table}{section}
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Equation numbering

Post by localghost »

The amsmath manual suggests to use the following.

Code: Select all

\numberwithin{equation}{section}

Thorsten
User avatar
Kaspars
Posts: 37
Joined: Mon Feb 14, 2011 11:51 am

Re: Equation numbering

Post by Kaspars »

Thanks it, works, but these formulas aren't centred any more, how can I solve this problem?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Equation numbering

Post by localghost »

Drop the fleqn option for the document class. Again I recommend to do some basic reading. And please follow the directions in my last reply.
User avatar
Kaspars
Posts: 37
Joined: Mon Feb 14, 2011 11:51 am

Re: Equation numbering

Post by Kaspars »

Thanks for your time and answer :)
I read forum rules too :)
Post Reply