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}
5
  • 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
    Commented Oct 19, 2014 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
    Commented Oct 19, 2014 at 11:48
  • Apologies was not aware of this
    – Trajan
    Commented Oct 19, 2014 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
    Commented Oct 19, 2014 at 12:15
  • 2
    You get the Environment theorem undefined error; always look at the first error message, not the last one.
    – egreg
    Commented Oct 19, 2014 at 12:24

1 Answer 1

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}
}
1
  • 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
    Commented Oct 19, 2014 at 16:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .