Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

babel packace with Turkish seems to interfere with graphicx (bug?)

526 views
Skip to first unread message

Emre Sevinc

unread,
Mar 15, 2006, 10:04:37 AM3/15/06
to

Dear TeX experts,

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

Enrico Gregorio

unread,
Mar 15, 2006, 11:20:44 AM3/15/06
to
Emre Sevinc <em...@bilgi.edu.tr> wrote:

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

Morten Høgholm

unread,
Mar 15, 2006, 11:21:08 AM3/15/06
to
On Wed, 15 Mar 2006 16:04:37 +0100, Emre Sevinc <em...@bilgi.edu.tr> wrote:

> 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

Emre Sevinc

unread,
Mar 15, 2006, 12:35:27 PM3/15/06
to
>>>>> "ES" == Emre Sevinc <em...@bilgi.edu.tr> writes:

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.

Hendri Adriaens

unread,
Mar 16, 2006, 10:41:31 AM3/16/06
to
> A simple solution for you is to load the xkeyval package _before_
graphicx.

Actually, it also works when loading it after graphicx ;-)

-Hendri.


0 new messages