3

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.

yayu
  • 5,237
  • I suggest you stick to \begin{frame} and \end{frame} and drop the \frame command. I'd also write the \title, \author and \date in the preamble. – Dox Jul 10 '14 at 14:38
  • @Dox I made those changes, still the pdflatex compiler is giving me an error undefined control sequence on every single line command. – yayu Jul 10 '14 at 14:40
  • Could you post the result of the command (in the terminal) locate beamer | grep cls? – Dox Jul 10 '14 at 14:41
  • Your code works fine in my machine. Please check that your installation is Ok. – Dox Jul 10 '14 at 14:44
  • @Dox no cls is grepped. I am dumping the output for locate beamer here: http://pastebin.com/pb9Pqajf – yayu Jul 10 '14 at 14:45
  • So your installation includes no beamer! X-) It is crazy. A not-so-clever advise would be to install the complete set of texlive packages using sudo apt-get install texlive-full.... Do not try it if your internet connection is slow!!! – Dox Jul 10 '14 at 14:47
  • 1
    off-topic comment (I admit it ;-)) LaTeX is used outside academia as well ;-) –  Jul 10 '14 at 14:47
  • @Dox yeah, I installed texlive as texlive-full would be way too big. texlive basic is supposed to have beamer but I cannot run it. Trying to install it separately it tells me that latex-beamer is already the newest version. – yayu Jul 10 '14 at 14:49
  • 1
  • Did you have a look in /usr/share/texmf/tex/latex/beamer for beamer.cls? If you have installed texlive today, there is perhaps no updatedb run for locate so far, so it can be found with locate. Perhaps you have to update the TeX hash tables. Try as root user: texconfig rehash –  Jul 10 '14 at 14:53
  • @ChristianHupfer there is a beamer.cls in /usr/share/texmf/tex/latex/beamer/base – yayu Jul 10 '14 at 14:56
  • @ChristianHupfer I ran a sudo texconfig rehash but I get the same errors. – yayu Jul 10 '14 at 14:57
  • @yayu: I wonder a little bit about beamer/base, since this is not the case for my distribution (I just checked the very old texlive2012, 2013 and the fresh 2014 version) –  Jul 10 '14 at 14:59
  • Does kpsewhich beamer.cls say anything useful? –  Jul 10 '14 at 15:00
  • @ChristianHupfer tex --version gives me TeX 3.1415926 (TeX Live 2013/Debian) – yayu Jul 10 '14 at 15:01
  • @ChristianHupfer kspewhich returns /usr/share/texmf/tex/latex/beamer/base/beamer.cls – yayu Jul 10 '14 at 15:02
  • Why does it say documentclass is line 11? What are the prior ten lines? – Jim Hefferon Jul 10 '14 at 15:24
  • @JimHefferon those were % comments :) I have removed them and shared everything, including the log here: http://pastebin.com/5N98AvrW – yayu Jul 10 '14 at 15:32
  • 2
    @yayu: Did you really run pdflatex presentation? The log file rather hints to pdftex presentation –  Jul 10 '14 at 15:40
  • @ChristianHupfer I am stupid. Yes, that was the problem. Please post this as an answer. Thanks a lot!! – yayu Jul 10 '14 at 15:41
  • @yayu: Added the answer, just to close. So, this was a heavy run ;-) I wish, I had looked into the log file earlier. –  Jul 10 '14 at 15:47

1 Answers1

6

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