25

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.

1
  • 11
    Please fix spelling of "Plancherel" in your real document. Dec 16, 2013 at 16:04

1 Answer 1

22

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.

6
  • 7
    You might want to more clearly point out that a missing \newtheorem is the real problem ;)
    – yo'
    Dec 16, 2013 at 15:54
  • Ahh that's very useful, I think I had misunderstood a few things there.
    – Hannah
    Dec 16, 2013 at 15:54
  • @Hannah: And the environment has an optional argument instead of a mandatory. Dec 16, 2013 at 15:54
  • @Hannah Well, I'm tempted to say RTM -- read the manual ;)
    – yo'
    Dec 16, 2013 at 15:55
  • 4
    no actual environments are predefined by any class or package supporting theorem-class objects -- it's not known what an author might want to call them, especially if said author is working in a language other than english. so \newtheorem is always required. if you're working with a tex live installation, try typing texdoc amsthm at a prompt to view the (amsthm) manual. Dec 16, 2013 at 18:19

You must log in to answer this question.

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