[Tex/LaTex] includegraphics problem in beamer

beamerepsgraphics

I am using Texlive. It generates pdf using latex+dvipdf. I add some eps. When I didn't scale or resize it, there is no problem. When I changed something like below.

\documentclass[mathserif]{beamer}

\mode<presentation>
{
\usetheme{Singapore}
\usecolortheme{dolphin}
\setbeamercovered{transparent}
}
\usepackage{graphicx}
\usepackage[turkish]{babel}
\usepackage[utf8]{inputenc}

\usepackage{mathptmx}
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
\usepackage[T1]{fontenc}

\title{Title}

\AtBeginSubsection[]
{
\begin{frame}<beamer>
\frametitle{Outline}
\tableofcontents[currentsection,currentsubsection]
\end{frame}
}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}
\frametitle{Outline}
\tableofcontents
\end{frame}

\section{Section}

\begin{frame}
\begin{figure}[ht]
\includegraphics[width=\textwidth,height=\textheight,keepaspectratio]{fig/MarSua09_preprint_007.eps}
\end{figure}
\end{frame}

\end{document}

It outputs. Where I expected to see image.

==@default==@default

Best Answer

When you do \usepackage[turkish]{babel} the symbol = has its catcode set to 13 (active). This causes problems with arguments such as width=\textwidth. You can prevent this behaviour by doing

\usepackage[turkish,shorthands=off]{babel}

Alternatively, if shorthands are important to you, you can temporarily switch them off. This only worked for me if I placed the switches outside the frame.

\shorthandoff{=}
\begin{frame}
\begin{figure}[ht]
\includegraphics[width=\textwidth,height=\textheight,keepaspectratio]{whatever.eps}
\end{figure}
\end{frame}
\shorthandon{=}

See the babel package documentation for more details.