GeneralOption clash of [demo]{graphicx} and {url}?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
sdaau
Posts: 26
Joined: Fri Feb 19, 2010 2:08 pm

Option clash of [demo]{graphicx} and {url}?

Post by sdaau »

Hi all,

I had to write an article in a class derived (apparently) from SIG-ALTERNATE.CLS/ACM_PROC_ARTICLE-SP.CLS. Then, I wanted to build a version without images, so I wanted to use the [demo] option of {graphicx} package. Interestingly, as soon as I tried that, Latex 'crashed' with 'option clash' error.

I think I managed to boil the problem down on this MWE:

Code: Select all

% test.tex
\documentclass[a4paper,12pt]{article}

% with just the below four lines as preamble, all is fine: 
% \usepackage[demo]{graphicx}
% \usepackage{url}
% \usepackage[breaklinks]{hyperref}
% \usepackage{breakurl}

% with this preamble - getting an 'option clash' error
%  when using [demo]{graphicx} (but compiles without demo option)
% (copies SIG-ALTERNATE.CLS/ACM_PROC_ARTICLE-SP.CLS)
\usepackage{epsfig}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage[demo]{graphicx}
\usepackage{url}
\usepackage[breaklinks]{hyperref}
\usepackage{breakurl}


\begin{document}
\includegraphics[width=0.5\linewidth]{demo}
\end{document}
When the uncommented \usepackages are used, `pdflatex test.tex` will fail with:

Code: Select all

! LaTeX Error: Option clash for package graphicx.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.18 \usepackage
                {url}
? X
No pages of output.
Transcript written on test.log.
Notice, however, that \usepackage[demo]{graphicx} and \usepackage{url} do not clash with a more minimal preamble - which to me points that it's either epsfig or one of the ams packages conflicting..

Anyways - does anyone know what is the problem here, and how could I use the [demo] option of {graphicx} without it clashing with {url}, within this kind of a class environment??

Thanks in advance for any answers,
Cheers!
Last edited by sdaau on Sat Feb 05, 2011 8:57 pm, 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.

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Option clash of [demo]{graphicx} and {url}?

Post by frabjous »

I don't think the problem really has anything to do with the url package.

The graphicx package is required by, and already loaded by the epsfig package, and so it is redundant to load it again, and a problem if it was already loaded with different options. However, epsfig passes its options to graphicx, so you can stick the demo option in there:

Code: Select all

% test.tex
\documentclass[a4paper,12pt]{article}

% with just the below four lines as preamble, all is fine:
% \usepackage[demo]{graphicx}
% \usepackage{url}
% \usepackage[breaklinks]{hyperref}
% \usepackage{breakurl}

% with this preamble - getting an 'option clash' error
%  when using [demo]{graphicx} (but compiles without demo option)
% (copies SIG-ALTERNATE.CLS/ACM_PROC_ARTICLE-SP.CLS)
\usepackage[demo]{epsfig}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{url}
\usepackage[breaklinks]{hyperref}
\usepackage{breakurl}


\begin{document}
\includegraphics[width=0.5\linewidth]{demo}
\end{document}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Option clash of [demo]{graphicx} and {url}?

Post by localghost »

The epsfig package is obsolete [1]. It's only become a wrapper for graphicx. frabjous pointed out what to do.

View topic: Obsolete packages and document classes — Avoid usage!


Thorsten
sdaau
Posts: 26
Joined: Fri Feb 19, 2010 2:08 pm

Re: Option clash of [demo]{graphicx} and {url}?

Post by sdaau »

Hi frabjous and localghost,

Just wanted to say thanks for the prompt and quick response! I have tried \usepackage[demo]{epsfig} with the original style file too, works perfect!

Thanks again,
Cheers!
Post Reply