[Tex/LaTex] Ubuntu: beamer not working

beamerpdftexUbuntu

I used to be a regular latex user but haven't touched it in the last two years due to being out of academia. So sorry for what might be a stupid question.

I want to create a beamer presentation. Here is what I start with:

\documentclass{beamer}
\begin{document}
\title{Simple Beamer Class}   
\author{Sascha Frank} 
\date{\today} 

\frame{\titlepage} 

\frame{\frametitle{Table of contents}\tableofcontents} 

\begin{frame}
hi
\end{frame}
\end{document}

For compiling and executing, I use pdflatex filename.tex as I remember doing.

I am getting the following errors:

l.11 \documentclass
               {beamer}
? 
! Undefined control sequence.
l.12 \begin
           {document}
? 
! Undefined control sequence.
l.13 \title
           {Simple Beamer Class}
? 
! Undefined control sequence.
l.14 \author
            {Sascha Frank}
? 
! Undefined control sequence.
l.15 \date
          {\today}
? 
! Undefined control sequence.
l.15 \date{\today
                 }
? 
! Undefined control sequence.
l.17 \frame
           {\titlepage}
? 
! Undefined control sequence.
l.17 \frame{\titlepage
                      }
? 
! Undefined control sequence.
l.19 \frame
           {\frametitle{Table of contents}\tableofcontents}
? 
! Undefined control sequence.
l.19 \frame{\frametitle
                       {Table of contents}\tableofcontents}
? 
! Undefined control sequence.
l.19 ...metitle{Table of contents}\tableofcontents
                                                  }
? 
! Undefined control sequence.
l.21 \begin
           {frame}
? 
[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] )</usr/share/texlive/tex
mf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on presentation.pdf (1 page, 15084 bytes).

I have installed the texlive package from ubuntu's apt. Ubuntu tells me that latex-beamer, (and dependencies pgf latex-xcolor etc) are already installed. A pdf is produced but its just the text with no slides.

Best Answer

The question is solved, it was just the wrong usage of pdftex which does not know of \documentclass command.

The error is not connected directly to Ubuntu but can occur on any operating system.

In order to compile beamer it is necessary to use latex, pdflatex, xelatex or lualatex instead.

For example call on commandline or corresponding menu command/button in a TeX editor

pdflatex foo