This is small fragment of my .tex file:
\newtheorem{definition}{Definition}[subsection]
\newtheorem{example}{Example}[subsection]
\newtheorem{theorem}{Theorem}[subsection]
I have subsection, which number is for example 1.2 and within some theorems definitions and examples. The document looks like
definition 1.2.1
definition 1.2.2
definition 1.2.3
exapmle 1.2.1 //should be 1.2.4
example 1.2.2 //should be 1.2.5
theorem 1.2.1 //shoul be 1.2.6
Since I'm newbie to LaTeX, what is the best solution for this problem?
Text Formatting ⇒ Numbering theorems and definitions within subsection
NEW: TikZ book now 40% off at Amazon.com for a short time.
Numbering theorems and definitions within subsection
It's better to use a fully compiliable example, so we can see what packages and document class you're using, but assuming you're using amsthm or similar, you can use the other optional argument to \newtheorem to tell it to use the counter of one already defined, in your case:
\newtheorem{definition}{Definition}[subsection]
\newtheorem{example}[definition]{Example}[subsection]
\newtheorem{theorem}[definition]{Theorem}[subsection]
See the amsthm documentation for more info. If you're not using amsthm, tell us what you are using.
\newtheorem{definition}{Definition}[subsection]
\newtheorem{example}[definition]{Example}[subsection]
\newtheorem{theorem}[definition]{Theorem}[subsection]
See the amsthm documentation for more info. If you're not using amsthm, tell us what you are using.
Numbering theorems and definitions within subsection
Hi,
try
try
Code: Select all
\newtheorem{definition}{Definition}[subsection]
\newtheorem{example}[definition]{Example}
\newtheorem{theorem}[definition]{Theorem}
This will produce compilation errors (you cannot use both optional arguments simultaneously).frabjous wrote: \newtheorem{definition}{Definition}[subsection]
\newtheorem{example}[definition]{Example}[subsection]
\newtheorem{theorem}[definition]{Theorem}[subsection]
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: Numbering theorems and definitions within subsection
That's what I get for not testing, thanks.
Re: Numbering theorems and definitions within subsection
Hi, thanks you all for help, it worked. I'm using amsmath.
Beer for everyone ;]
Beer for everyone ;]