Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

environment undefined

5,139 views
Skip to first unread message

geen...@aol.com

unread,
Jun 4, 2009, 7:34:02 PM6/4/09
to
Hi, Can anyone tell me why I get 'environment undefined' when I try to compile
this? It's a direct, _verbatim_ copy and paste from the LaTeX Wiki, and the
file "presentation.png" exists in the current directory....

\documentclass[11pt]{letter}
\usepackage{geometry}
\geometry{a4paper}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage[greek,frenchb]{babel}
\usepackage{amssymb}
\usepackage{epstopdf}
\usepackage{wrapfig}
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}

\begin{document}

\begin{flushright}lieu, la (date) 2009\\
\end{flushright}

blah blah blah

\begin{figure}[h!]
\includegraphics[width=3in]{presentation}
\end{figure}


\end{document}


---------------------------

The error is ...

Underfull \hbox (badness 10000) in paragraph at lines 16--18


! LaTeX Error: Environment figure undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.19 \begin{figure}
[h!]
?

Enrico Gregorio

unread,
Jun 4, 2009, 7:49:00 PM6/4/09
to
<geen...@aol.com> wrote:

There's no figure environment in the letter class. You probably
want to change it into a center or flushleft environment.

It's not necessary to put an \includegraphics command into a
figure environment, it may go everywhere (sometimes, though,
it needs to be preceded by \protect, not in this case).

Ciao
Enrico

geen...@aol.com

unread,
Jun 4, 2009, 8:26:17 PM6/4/09
to
On 2009-06-04, Enrico Gregorio <greg...@math.unipd.it> wrote ...
I don't understand.

Joris

unread,
Jun 4, 2009, 10:06:52 PM6/4/09
to
On Jun 4, 8:26 pm, geena...@aol.com wrote:
> On 2009-06-04, Enrico Gregorio <grego...@math.unipd.it> wrote ...

The letter document class is designed for letters. Since letters
typically don't have figures in them, the `figure' environment is not
defined. You don't need to use the figure environment to include an
image. Just remove the \begin{figure} and \end{figure} commands and
it will compile fine.

As an aside, you may want to have a look at the documentation for the
letter document class. You don't need the flushright environment to
put the date on and you generally start a new letter with \begin
{letter}{Addressee} some time after \begin{document}; you can then use
\date{....} and it'll appear in the right place.

0 new messages