# Problem with \includegraphics in beamer — greek language doesn't work

I use this code:

\documentclass{beamer}

\usepackage{subfigure}

\usepackage[english,greek]{babel}
\usepackage[utf8x]{inputenc}
\graphicspath{{/home/user/images/}}

\begin{document}

\section{intro}
\subsection{intro1}

\begin{frame}
\frametitle{test}
\setbeamercovered{transparent}

\begin{figure}

\includegraphics[scale=0.5]{imag1}

\end{figure}

\end{frame}

\end{document}


and get 100 errors. The problem lies with \includegraphics; if I remove it it's OK. (The image is PNG and it is working with this layout in LaTeX.)

Is there some conflict with babel?

---------------UPDATED----------------------------------------

I noticed that in kile settings at the build section at the PDFLatex ,even though i had it to "xelatex" it showed "pdflatex" ,so i changed it again and now it works BUT now the greek language doesn't work!I can't see anything greek.I haven't changed anything!

--------------------UPDATED 2-----------------------------------------

\documentclass{beamer}

\usepackage{subfigure}

\usepackage[english,greek]{babel}
\usepackage[utf8x]{inputenc}

\newcommand{\gr}{\greektext}
\newcommand{\EN}{\latintext}

\begin{document}

Καλημέρα
\section{Ημέρα}

Καθόλου ελληνικά

\begin{frame}
\frametitle{test}
\setbeamercovered{transparent}

Καλησπέρα

\EN English \gr

\end{frame}

\end{document}

-
No error here. What's the first error message? –  egreg Sep 5 '12 at 21:43
@egreg:Hello,it shows "Missing \$ inserted \end{frame}","Missing { inserted \end{frame}".It shows them a lot of times,also shows " Use of \\ifbeamercolorempty doesn't match its definition \end{frame}".All the errors vanish if i remove "includegraphics".Thanks –  George Sep 6 '12 at 11:38
@egreg:Hello , i updated... –  George Sep 6 '12 at 16:13
Does \includegraphics[scale=0.5]{imag1.png} solve the problem? –  Bluemilk Sep 6 '12 at 16:37
You mustn't use inputenc with XeLaTeX and babel with Greek doesn't work. Use Polyglossia. –  egreg Sep 6 '12 at 16:41

The updated example can't work with XeLaTeX. Here's a version that works

\documentclass{beamer}

\usepackage{fontspec}
\setsansfont{Linux Biolinum O}

\usepackage{polyglossia}
\setmainlanguage{greek}
\setotherlanguage{english}

\begin{document}

Καλημέρα
\section{Ημέρα}

Καθόλου ελληνικά

\begin{frame}
\frametitle{test}
\setbeamercovered{transparent}

Καλησπέρα

English

\end{frame}

\end{document}


Check the documentation of Polyglossia for the environments and commands that deal with language changes (they are not so important for beamer, as hyphenation shouldn't be used and \raggedright is in force).

-
:Ok , it works with \setsansfont{DejaVuSans}. I still can't understand why suddenly stopped to work.Any way..Thank you very much! –  George Sep 6 '12 at 17:22