[Tex/LaTex] Using amsthm but still getting “Environment theorem undefined”

amsthmenvironmentstheorems

I'm trying to write up all my university theorems and I cant get the theorem environment to work. Here is a mini example of what I'm trying to do.

\documentclass[a4paper,12pt]{article}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amssymb,amsmath,amsthm, amsfonts}

\newcommand{\vect}[1]{\vect{\underline{#1}}}
\newcommand{\bi}[1]{\textit{\textbf{#1}}}

\title{Theorems\\ Y3 S1}
\author{Hannahl}

\begin{document}
\maketitle

\section{Mathematical Methods}
\begin{theorem}{Placheral's Theorem}
||F||^2_2 =2\pi ||u||^2_2 
\end{theorem}
\end{document}

I get this error

! LaTeX Error: Environment theorem undefined.

I am using windows 7 have MikTex 2.9 installed and am using TexMaker.
From what I have read the theorem environment should be part of the amsthm package which I have. But it isn't working!

Any help will be much appreciated.

Best Answer

This is a more proper way to do it:

\documentclass[a4paper,12pt]{article}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amssymb,amsmath,amsthm}

\newtheorem{theorem}{Theorem}

\usepackage{mathtools} % Bonus
\DeclarePairedDelimiter\norm\lVert\rVert

\begin{document}

\section{Mathematical Methods}
\begin{theorem}[Placheral's Theorem]
  \begin{equation*}
\norm{ F }^2_2 =2\pi \norm{ u }^2_2 .
\end{equation*}
\end{theorem}
\end{document}

As one might have guessed \newtheorem constructs theorem environments. Use it to define your Theorem, Lemma, etc. environments. You might want to have a look at \theoremstyle as well. Here is a handy method for defining an example env which is not italic.

\theoremstyle{definition} % amsthm only
\newtheorem{example}{Example}

As tohecz mentions, you may want to read up on this subject. Details for amsthm, can be found in amsthdoc.pdf.

The \newtheorem syntax should be covered by any standard LaTeX introduction.