0

I get the error

\begin{document} ended by \end{theorem}. \end{theorem} and Environment theorem undefined. \begin{theorem}

when trying to compile this latex document.

Here is the problematic code:

\documentclass[a4paper, 12pt, notitlepage]{report}

\usepackage{amsfonts} % if you want blackboard bold symbols e.g. for real numbers
\usepackage{graphicx} % if you want to include jpeg or pdf pictures
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{float}

\newtheorem{thm}{Theorem}[section]
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{Def}[thm]{Definition}
\newtheorem{cond}[thm]{Condition}
\newtheorem{rem}[thm]{Remark}
\newtheorem{conj}[]{Conjecture}
\newtheorem*{post}{Postulate 1}
\newtheorem*{post2}{Postulate 2}
\newtheorem*{ex}{Exercise}
\newtheorem{exa}[thm]{Example}

\title{An Introduction to Geometric Measure Theory} % change this
\author{x} % change this
\date{\today} % change this

\numberwithin{equation}{subsection}

\begin{document}    

\appendix
\chapter{Covering Theorems}    

\begin{theorem}
    Let $X$ be boundedly compact metric space and $\mathcal{B}$ a family of closed      balls in $X$ such that 
    \begin{equation}
    sup\{d(B):B \in \mathcal{B}\}
    \end{equation}
\end{theorem}

\end{document}
  • 1
    When asking questions it is better to provide a full minimal working example (MWE) both in order to demonstrate what you are trying to do and to help others help you. The MWE should like like \documentclass...\begin{document}...\end{document}, it should compile and contain close to the minimal amount of code needed to explain/demonstrate what you are asking. This saves a lot of time for everyone. – user30471 Oct 19 '14 at 11:47
  • 1
    Btw, you can highlight code blocks in your posts either by indenting them by 4 spaces or by using the '{}' on the gui. – user30471 Oct 19 '14 at 11:48
  • Apologies was not aware of this – Trajan Oct 19 '14 at 12:07
  • 3
    The problem is that the theorem environment is not defined in preamble – only a thm, which displays ‘theorem’. Replacing theorem with thm compiles perfectly. – Bernard Oct 19 '14 at 12:15
  • 2
    You get the Environment theorem undefined error; always look at the first error message, not the last one. – egreg Oct 19 '14 at 12:24
1

When you type

\newtheorem{thm}{Theorem}[section]

it means that it will number by sections, write "Theorem" and you refer to it using the environment name thm.

You need to write

\begin{thm}
    Let $X$ be boundedly compact metric space and $\mathcal{B}$ a family of closed      balls in $X$ such that 
    \begin{equation}
    sup\{d(B):B \in \mathcal{B}\}
    \end{equation}
\end{thm}

or you can obtain same result

{\thm
    Let $X$ be boundedly compact metric space and $\mathcal{B}$ a family of closed      balls in $X$ such that 
    \begin{equation}
    sup\{d(B):B \in \mathcal{B}\}
    \end{equation}
}
  • 2
    If you use {\thm <statement>} in your own documents, fine. But it's very wrong and it shouldn't be even told to newbies. And you shouldn't use it, I add: the result is definitely not the same and it's not the only reason for declaring this wrong. – egreg Oct 19 '14 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.