I couldn't compile the code provided below. I'm using MIKTeX
(and also Cygwin's tetex).
When I try to use babel (turkish) together with graphicx and
pass some parameters to includegraphics, pdflatex complains!
Either I have to use includegraphics without parameters
or I have to remove the line that includes babel-turkish.
However I need them both! This seems to be a "bug", at least
#latex people suggested that I report this as a bug but
I want to be sure before I start that.
::: Problematic LaTeX code (same problem reproduced both with MIKTeX and Cygwin's tetex):
\documentclass[a4paper,10pt]{book}
\usepackage[latin5]{inputenc}
\usepackage{verbatim}
\usepackage{amsfonts}
\usepackage{color}
\usepackage{makeidx}
%\usepackage{graphicx}
\usepackage[pdftex]{graphicx}
\usepackage[pdftex,colorlinks=true,bookmarks=true,linkcolor=blue,citecolor=blue,urlcolor=blue]{hyperref}
%if I remove the line below, everything's fine
\usepackage[turkish]{babel}
\begin{document}
\begin{figure}[!h]
\includegraphics[scale=0.40]{comment.png}
\end{figure}
\end{document}
--
Emre Sevinc
eMBA Software Developer Actively engaged in:
http:www.bilgi.edu.tr http://ileriseviye.org
http://www.bilgi.edu.tr http://fazlamesai.net
Cognitive Science Student http://cazci.com
http://www.cogsci.boun.edu.tr
The turkish babel option activates some characters: ":", "!" and "=".
The problem is with "=" so you have to deactivate it before using
\includegraphics. Probably you need also to deactivate "!" before using
"figure", if you insist on giving it as an option to the environment.
\shorthandoff{!}
\begin{figure}[!h]
\shorthandoff{=}
\includegraphics[scale=0.4]{comment}
\shorthandon{=}\shorthandon{!}
\caption{...}
\end{figure}
\shorthandon{!}
If you don't employ the shorthands (possible, since you are using
the latin5 input encoding), then you can disable the shorthands
by saying (in the preamble)
\addto\extrasturkish{\shorthandoff{=}\shorthandoff{!}\shorthandoff{:}}
In case of need you can enable them locally.
Otherwise you need that concoction (but you can define new
environments and commands to take care of the matter automatically).
Ciao
Enrico
> When I try to use babel (turkish) together with graphicx and
> pass some parameters to includegraphics, pdflatex complains!
> Either I have to use includegraphics without parameters
> or I have to remove the line that includes babel-turkish.
> However I need them both! This seems to be a "bug", at least
> #latex people suggested that I report this as a bug but
> I want to be sure before I start that.
It has been reported before, see
<http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=babel/3523>.
A simple solution for you is to load the xkeyval package _before_ graphicx.
--
Morten
ES> Dear TeX experts,
ES> I couldn't compile the code provided below. I'm using MIKTeX
ES> (and also Cygwin's tetex).
ES> When I try to use babel (turkish) together with graphicx and
ES> pass some parameters to includegraphics, pdflatex complains!
ES> Either I have to use includegraphics without parameters or I
ES> have to remove the line that includes babel-turkish. However
ES> I need them both! This seems to be a "bug", at least #latex
ES> people suggested that I report this as a bug but I want to be
ES> sure before I start that.
Thank you very much for possible workarounds.
Actually, it also works when loading it after graphicx ;-)
-Hendri.