Graphics, Figures & TablesArguments for includegraphics command inoperative

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
mehmet.ali.anil
Posts: 3
Joined: Mon May 10, 2010 9:24 pm

Arguments for includegraphics command inoperative

Post by mehmet.ali.anil »

When I upgraded from tetex to texlive 2009 , which was a mandatory upgrade I guess since I cannot find the previous one in the repositories.

I have a problem which arose with this upgrade.

Though It can render everything I could render beforehand, I am having trouble about one thing. I cannot use the additional preferences that can be used to edit an image when using \includegraphics function.

For example:

Code: Select all

\begin{figure} [H]
\centering
\includegraphics[width=0.7\linewidth,angle=-90,trim = 5mm 8mm 10mm 0mm, clip]{example.ps}
\end{figure}
Used to rotate my ps file, trim it, then scale it as specified.
Now, I get an error:

Code: Select all

./Rapor.tex:59:Illegal unit of measure (pt inserted) ...e=-90,trim = 5mm 8mm 10mm 0mm, clip]{example.ps}
If there is only [width=\linewidth] tex doesn't recognize \linewidth and prints:

Code: Select all

./Rapor.tex:59:Missing number, treated as zero...\includegraphics[width=\linewidth]{example.ps}
and the output file has the text within the square brackets, rather than the image.

Somehow there is a problem or a change in how this usage is interpreted. I am using:

Code: Select all

\usepackage{float}
\usepackage{graphicx}
packages that are related to graphics.

I'm using Kile 2.0.85, but the problem is editor independent, I get the same results with Texmaker.
I am using the exact same .tex sources that I used with tetex engine.
What I've tried:
I installed texlive packages from scratch, with Kile.
I changed the graphicx.sty file with a version that I found on the net.

Those didn't help.

Is it a common problem?
I really need help about this.

Thanks in advance.
M.Ali
Last edited by mehmet.ali.anil on Tue May 11, 2010 10:33 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Arguments for includegraphics command inoperative

Post by josephwright »

Please do the following:
  • Create a short, complete example (something we can try out)
  • Add \listfiles to your source
  • Post the example, log and an example graphic file here.
Joseph Wright
mehmet.ali.anil
Posts: 3
Joined: Mon May 10, 2010 9:24 pm

Arguments for includegraphics command inoperative

Post by mehmet.ali.anil »

Thanks for your fast reply, I'm sorry about my vagueness.

I guess I found out what was the problem, but it is still an issue for me:

An easy example would be:

Code: Select all

\listfiles
\documentclass[a4paper,10pt]{article}
\usepackage[turkish]{babel}
\usepackage{graphicx}
\usepackage{float}
\usepackage{xkeyval}

\begin{document}
	\begin{figure}
	\centering
	\includegraphics[width=0.5\linewidth]{devre1.ps}
	\end{figure}
\end{document}
Which outputs:

Code: Select all

*****
*****     LaTeX output: 
*****     cd "/home/mali/Documents/Analog Elektronik Laboratuarı/6"
*****     latex -interaction=nonstopmode 'Rapor2.tex'
*****
This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
 restricted \write18 enabled.
entering extended mode
(./Rapor2.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, farsi, arabic, croatian, bulgarian, ukrainian, russian, czech, slov
ak, danish, dutch, finnish, french, basque, ngerman, german, german-x-2009-06-1
9, ngerman-x-2009-06-19, ibycus, monogreek, greek, ancientgreek, hungarian, san
skrit, italian, latin, latvian, lithuanian, mongolian2a, mongolian, bokmal, nyn
orsk, romanian, irish, coptic, serbian, turkish, welsh, esperanto, uppersorbian
, estonian, indonesian, interlingua, icelandic, kurmanji, slovenian, polish, po
rtuguese, spanish, galician, catalan, swedish, ukenglish, pinyin, loaded.
(/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo))
(/usr/share/texmf-texlive/tex/latex/graphics/graphicx.sty
(/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty)
(/usr/share/texmf-texlive/tex/latex/graphics/graphics.sty
(/usr/share/texmf-texlive/tex/latex/graphics/trig.sty)
(/etc/texmf/tex/latex/config/graphics.cfg)
(/usr/share/texmf-texlive/tex/latex/graphics/dvips.def)))
(/usr/share/texmf-texlive/tex/latex/xkeyval/xkeyval.sty
(/usr/share/texmf-texlive/tex/generic/xkeyval/xkeyval.tex))
(/var/lib/texmf/tex/generic/babel/babel.sty
(/usr/share/texmf-texlive/tex/generic/babel/turkish.ldf
(/usr/share/texmf-texlive/tex/generic/babel/babel.def))) (./Rapor2.aux)
! Missing number, treated as zero.
<to be read again> 
                   \endgroup 
l.11 ...degraphics[width=0.5\linewidth]{devre1.ps}
                                                  
! Illegal unit of measure (pt inserted).
<to be read again> 
                   \endgroup 
l.11 ...degraphics[width=0.5\linewidth]{devre1.ps}
                                                  
[1] (./Rapor2.aux)

 *File List*
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2009/08/28 v1.8 graphics configuration of TeX Live
   dvips.def    1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
 xkeyval.sty    2008/08/13 v2.6a package option processing (HA)
 xkeyval.tex    2008/08/13 v2.6a key=value parser (HA)
   babel.sty    2008/07/06 v3.8l The Babel package
 turkish.ldf    2005/03/31 v1.2m Turkish support from the babel system
 ***********

 )
(see the transcript file for additional information)
Output written on Rapor2.dvi (1 page, 224 bytes).
Transcript written on Rapor2.log.
And the result is 1.pdf attached to this thread.

But when I remove the package babel for turkish, the code is compiled:

Code: Select all

\listfiles
\documentclass[a4paper,10pt]{article}
\usepackage{graphicx}
\usepackage{float}
\usepackage{xkeyval}

\begin{document}
	\begin{figure}
	\centering
	\includegraphics[width=0.5\linewidth]{devre1.ps}
	\end{figure}
\end{document}

Code: Select all

*****
*****     LaTeX output: 
*****     cd "/home/mali/Documents/Analog Elektronik Laboratuarı/6"
*****     latex -interaction=nonstopmode 'Rapor2.tex'
*****
This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
 restricted \write18 enabled.
entering extended mode
(./Rapor2.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, farsi, arabic, croatian, bulgarian, ukrainian, russian, czech, slov
ak, danish, dutch, finnish, french, basque, ngerman, german, german-x-2009-06-1
9, ngerman-x-2009-06-19, ibycus, monogreek, greek, ancientgreek, hungarian, san
skrit, italian, latin, latvian, lithuanian, mongolian2a, mongolian, bokmal, nyn
orsk, romanian, irish, coptic, serbian, turkish, welsh, esperanto, uppersorbian
, estonian, indonesian, interlingua, icelandic, kurmanji, slovenian, polish, po
rtuguese, spanish, galician, catalan, swedish, ukenglish, pinyin, loaded.
(/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo))
(/usr/share/texmf-texlive/tex/latex/graphics/graphicx.sty
(/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty)
(/usr/share/texmf-texlive/tex/latex/graphics/graphics.sty
(/usr/share/texmf-texlive/tex/latex/graphics/trig.sty)
(/etc/texmf/tex/latex/config/graphics.cfg)
(/usr/share/texmf-texlive/tex/latex/graphics/dvips.def)))
(/usr/share/texmf-texlive/tex/latex/xkeyval/xkeyval.sty
(/usr/share/texmf-texlive/tex/generic/xkeyval/xkeyval.tex)) (./Rapor2.aux)
<devre1.ps> [1] (./Rapor2.aux) *File List* article.cls 2007/10/19 v1.4h Standard LaTeX document class size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option) graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR) keyval.sty 1999/03/16 v1.13 key=value parser (DPC) graphics.sty 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR) trig.sty 1999/03/16 v1.09 sin cos tan (DPC) graphics.cfg 2009/08/28 v1.8 graphics configuration of TeX Live dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR) xkeyval.sty 2008/08/13 v2.6a package option processing (HA) xkeyval.tex 2008/08/13 v2.6a key=value parser (HA) devre1.ps Graphic file (type eps) *********** ) Output written on Rapor2.dvi (1 page, 276 bytes). Transcript written on Rapor2.log.
And the result is 2.pdf, which is what I desire, but I cannot remove babel, since I neeed those Turkish characters.

I recognized that babel is run from /var/lib/texmf/tex/generic/babel/babel.sty , which differs in place, I guess those are the packages that are left from Tetex.
I guess it is clearer now.

Thanks,
M.Ali
Attachments
example.zip
For reproducing.
(5.58 KiB) Downloaded 181 times
2.pdf
The second result, NO turkish character support.
(3.84 KiB) Downloaded 343 times
1.pdf
The first Result, no graphics.
(2.69 KiB) Downloaded 321 times
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Arguments for includegraphics command inoperative

Post by gmedina »

Hi,

deactivate the "=" symbol (the turkish option for babel seems to activate it):

Code: Select all

\documentclass[a4paper,10pt]{article}
\usepackage[turkish]{babel}
\usepackage{graphicx}
\usepackage{float}
\usepackage{xkeyval}

\begin{document}

\shorthandoff{=}

\begin{figure}
  \centering
  \includegraphics[width=0.5\linewidth]{devrel}
\end{figure}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
mehmet.ali.anil
Posts: 3
Joined: Mon May 10, 2010 9:24 pm

Arguments for includegraphics command inoperative

Post by mehmet.ali.anil »

Thanks gmedina,

That worked like a charm.

So to conclude for people bumping into this problem:
If Turkish Babel is loaded, it activates the "=" symbol. It results in all options like [width=...] rendered as text, although they are commands. Adding
\shorthandoff{=} right after \begin{document} solves the issue by deactivation this shorthand.

Is this considered to be a bug? Shold I also inform the turkish babel developer?

Thanks for all.
M.Ali
Post Reply