Math & Science ⇒ Numbering Results
Numbering Results
I wonder if anybody could help me out with an issue regarding numbering of results. I am currently writing my first large report in LaTeX, and am using the book document class, to enable me to use chapters as well as the various sectioning commands. Within each chapter, I have a number of theorem environments (such as Lemmas, Propositions etc.) and I have these numbered within a chapter. However, I also want to label specific formula's within the text (e.g. a specific line within a proof). I am using the align environment to do this. However, it naturally numbers the formula's in chapter 3 say as 3.1, 3.2, 3.3, the same numbering as I have for my theorems, thus causing ambiguity when I refer to them. Is there an easy way round this problem?
Sorry if this is really basic, or if I am not describing the problem very well, but I am very new to LaTex.
Thanks in advance for all your help.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Numbering Results
A minimal working example showing how you currently have things set up (e.g., are you using amsthm to create numbered environments as is, or something else, etc.)?
Numbering Results
Code: Select all
\documentclass{report}
\newtheorem{theorem}{Theorem}[chapter]
\usepackage{amsmath}
\begin{document}
\chapter{Chapter 1}
\begin{theorem} Theorem 1
\end{theorem}
Proof:
\begin{align}
y & = & mx+c
\end{align}
\hfill q.e.d.
\begin{theorem} Theorem 2
\end{theorem}
\end{document}
Numbering Results
If so, then maybe something like this would be appropriate. See the greekctr and chngcntr package documentation for more info.
Code: Select all
\documentclass{report}
\usepackage{amsmath}
\usepackage{greekctr}
\usepackage{chngcntr}
\newtheorem{theorem}{Theorem}[chapter]
\counterwithin{equation}{theorem}
\renewcommand{\theequation}{\thetheorem.\greek{equation}}
\begin{document}
\chapter{Chapter 1}
\begin{theorem} Theorem 1
\end{theorem}
Proof:
\begin{align}
y &= mx+c\label{something}\\
z &= mx+d
\end{align}
\hfill q.e.d.
\begin{theorem} Theorem 2
\end{theorem}
Proof.
\begin{align}
k &= nh + l\\
w &= ej - 4
\end{align}
Let's refer to equation \ref{something}
\chapter{Another}
\begin{theorem} A new theorem.
\end{theorem}
Proof:
\begin{align}
2 + 2 &= 4\\
6 &= 3 + 3
\end{align}
\end{document}
Re: Numbering Results
My ideal situation would be for the equations within proofs of things in chapter 0 say, to be numbered 0.alpha, 0.beta, so "enumerated" within the chapter, but with an enumeration that distinguishes them easily from that of my theorems (theorem 0.1, lemma 0.2 etc.).
If this isn't possible, don't worry, as what you have suggested looks as if it will do the job just fine.
Numbering Results
Are you always such a pessimist? As I noted, pretty much anything is possible.If this isn't possible, don't worry, ...
I think this preamble should give you what you want:
Code: Select all
\documentclass{report}
\usepackage{amsmath}
\usepackage{greekctr}
\usepackage{chngcntr}
\newtheorem{theorem}{Theorem}[chapter]
\counterwithin{equation}{chapter}
\renewcommand{\theequation}{\thechapter.\greek{equation}}
Re: Numbering Results
One final question, but being fairly new to LaTeX, where should I have the chngcntr.sty file on my computer (I use a windows Pc, and use MikTex 2.8). I currently have it in the directory which my project is in, however ideally I would like it in one of LaTeX's directories so that I can use it all the time (no matter which directory my project is saved in). I have tried searching for advice on this, but the advice available just seems to creat error messages!
Again, sorry if this is a really trivial question, but thanks in advance for all of your help.
Numbering Results
On further testing, however, it appears not to be strictly necessary for this set-up. This by itself does the trick:
Code: Select all
\documentclass{report}
\usepackage{amsmath}
\usepackage{greekctr}
\newtheorem{theorem}{Theorem}[chapter]
\renewcommand{\theequation}{\thechapter.\greek{equation}}
Re: Numbering Results
Sorry for all the basic questions, but thanks for all of your help.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Numbering Results
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10