LaTeX forum ⇒ Document Classes ⇒ Option clash for package graphicx

Information and discussion about specific document classes and how to create your own document classes.
akira32
Posts: 45
Joined: Tue Nov 13, 2007 10:32 am

Option clash for package graphicx

I Add the line as below:
\usepackage{graphicx}
But it appears a error message as the attached picture:
LaTex Error: option clash for package graphicx.

My report project is a new project that just add the line of " \usepackage{graphicx} " and " \includegraphics[width=\textwidth , bb= 20 20 575 575]{test.jpg}".
I compress my report project to test1.zip include all files.
Attachments
Test1.rar
Test1 is my new report project and add two line commands
\usepackage{graphicx}
latex usepage graphicx.JPG (8.51 KiB) Viewed 54080 times

balf
Posts: 158
Joined: Sat Jan 12, 2008 1:11 am
Probably you have another package or your document class that loads graphicx with an option. What is your preamble?

B.A.

Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am
You are loading the graphicx package twice, the first one right after \documentclass and the second one here:
```\ifpdf %%Einbindung von Grafiken mittels \includegraphics{datei}
\usepackage[pdftex]{graphicx} %%Grafiken in pdfLaTeX
\else
\usepackage[dvips]{graphicx} %%Grafiken und normales LaTeX
\fi
```

By the way, you are using obsolete patterns. LaTeX can detect automatically if compilation is done via pdfLaTeX or via normal LaTeX. So graphicx is loaded with the appropriate driver. The \ifpdf conditional is not really necessary. If you do want to keep it, at least replace this
```\newif\ifpdf
\ifx\pdfoutput\undefined
\pdffalse              %%normales LaTeX wird ausgef¸hrt
\else
\pdfoutput=1
\pdftrue               %%pdfLaTeX wird ausgef¸hrt
\fi
```

by this
`\usepackage{ifpdf}`

You don't need the \DeclareGraphicsExtensions command too... Or \pagestyle{empty} before \maketitle.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.

akira32
Posts: 45
Joined: Tue Nov 13, 2007 10:32 am
Thank you! I had solved this problem.
I remove the line of " \usepackage{graphicx} ", then no error appears.