Discussion:
option clash for package graphicx
wolf python london
2012-03-27 09:28:37 UTC
Permalink
Hey ,maintainer(s) of texlive

I'm running Debian Sid with texlive-2011 installed. I have a tex souce file :

%%%%%%%%%%%%%%%%%%%%%%
\documentclass[11pt]{article}
\usepackage{fontspec}
\usepackage{listings}
\usepackage{color}
\usepackage[BoldFont,SlantFont,CJKchecksingle]{xeCJK}

\usepackage{amsmath}

\usepackage[dvips]{graphicx}
...
%%%%%%%%%%%%%%%%%%%%%%

when compiling it with xelatex, it shows** ! LaTeX Error: Option clash
for package graphicx**.
Obviously , graphicx has been loaded before \usepackage[dvips]{graphix}.
However , it compiles fine in Funtoo, which has texlive-2011-r1.
I'm not sure whether this is a bug or anything else. Can any
maintainer point something out for
me? Thanks in advance.
--
________________________
Yes, I use Debian GNU/L
wolf python london(WPL)
Do as you soul should do !
________________________
Frank Küster
2012-03-27 10:06:52 UTC
Permalink
Post by wolf python london
when compiling it with xelatex, it shows** ! LaTeX Error: Option clash
for package graphicx**.
Obviously , graphicx has been loaded before \usepackage[dvips]{graphix}.
Yes, looks like.
Post by wolf python london
However , it compiles fine in Funtoo, which has texlive-2011-r1.
I'm not sure whether this is a bug or anything else. Can any
maintainer point something out for
me?
I tried with this document:

\documentclass[11pt]{article}
\usepackage{fontspec}
\usepackage{listings}
\usepackage{color}
\usepackage[BoldFont,SlantFont,CJKchecksingle]{xeCJK}

\usepackage{amsmath}

\usepackage[dvips]{graphicx}

\begin{document}
foo
\end{document}

and got no error and this log:
Frank Küster
2012-03-27 10:58:11 UTC
Permalink
Post by Frank Küster
Post by wolf python london
when compiling it with xelatex, it shows** ! LaTeX Error: Option clash
for package graphicx**.
Obviously , graphicx has been loaded before \usepackage[dvips]{graphix}.
Yes, looks like.
Post by wolf python london
However , it compiles fine in Funtoo, which has texlive-2011-r1.
I'm not sure whether this is a bug or anything else. Can any
maintainer point something out for
me?
[...]
Rubbish, that was on a stable system, sorry.

However, on an unstable system, I get a different error:

(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1enc.def)
(/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1lmr.fd)kpathsea: Invalid fontname `[lmroman10-regular]', contains '['

! Font EU1/lmr/m/n/10=[lmroman10-regular]:mapping=tex-text at 10.0pt not loadab
le: Metric (TFM) file or installed font not found.
<to be read again>
relax
l.100 \fontencoding\encodingdefault\selectfont

?
But anyway the log shows that graphics.sty is loaded early:

(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3names.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty))
(/usr/share/texlive/texmf-dist/tex/latex/etex-pkg/etex.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/color.sty
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/color.cfg)
(/usr/share/texlive/texmf-dist/tex/xelatex/xetex-def/xetex.def))
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty

Actually fontspec requires expl3.sty, and that has now a

\ifodd \***@expl@***@drivers@bool \relax
\else
\RequirePackage { color , graphics }
\fi

I don't grok the boolean setting, but anyway moving the graphics line
before loading fontspec "fixes" the error for me. Meaning I still get
the font errors, and it still writes a PDF which doesn't make any sense
with a dvips driver.

Regards, Frank
--
Frank Küster
Sprecher B90/Grüne OV Miltenberg und Umgebung
VCD Miltenberg, ADFC Aschaffenburg-Miltenberg
Debian Developer (TeXLive)
wolf python london
2012-03-27 13:39:02 UTC
Permalink
Post by Frank Küster
Post by Frank Küster
Post by wolf python london
when compiling it with xelatex, it shows** ! LaTeX Error: Option clash
for package graphicx**.
Obviously , graphicx has been loaded before \usepackage[dvips]{graphix}.
Yes, looks like.
Post by wolf python london
However , it compiles fine in Funtoo, which has texlive-2011-r1.
I'm not sure whether this is a bug or anything else. Can any
maintainer point something out for
me?
[...]
Rubbish, that was on a stable system, sorry.
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1enc.def)
(/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1lmr.fd)kpathsea: Invalid fontname `[lmroman10-regular]', contains '['
! Font EU1/lmr/m/n/10=[lmroman10-regular]:mapping=tex-text at 10.0pt not loadab
le: Metric (TFM) file or installed font not found.
<to be read again>
                  relax
l.100 \fontencoding\encodingdefault\selectfont
?
yeah, graphics.sty is loaded , but not graphicx.sty :-)
Post by Frank Küster
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3names.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty))
(/usr/share/texlive/texmf-dist/tex/latex/etex-pkg/etex.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/color.sty
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/color.cfg)
(/usr/share/texlive/texmf-dist/tex/xelatex/xetex-def/xetex.def))
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
Actually fontspec requires expl3.sty, and that has now a
\else
 \RequirePackage { color , graphics }
\fi
I don't grok the boolean setting, but anyway moving the graphics line
before loading fontspec "fixes" the error for me. Meaning I still get
the font errors, and it still writes a PDF which doesn't make any sense
with a dvips driver.
It did fix the error , but led to another error. \includegraphics
cannot load the file .
To simplify the problem and still keep the situation I come across:
files: test.tex and sequence.1(generated by metapost)

1.
$ cat test.tex
\documentclass[11pt]{article}
\usepackage{fontspec}
\usepackage{listings}
\usepackage{color}
%\usepackage[BoldFont,SlantFont,CJKchecksingle]{xeCJK}
\usepackage{amsmath}
\usepackage[dvips]{graphicx}
\begin{document}
foo\\

\includegraphics{sequence.1}
\end{document}

it compiles with error : ! LaTeX Error: Option clash for package graphicx.

2.
put the \usepackage[dvips]{graphicx} before fontspec, and save it as
test1.tex .
$ diff test1.tex test.tex
2d1
< \usepackage[dvips]{graphicx}
7a7
Post by Frank Küster
\usepackage[dvips]{graphicx}
it compiles with error: ! Unable to load picture or PDF file 'sequence.1'.

3.
put the dvips option in \documentclass and remove the
\usepackage[dvips]{graphicx},
then save it as test2.tex.
$ diff test2.tex test.tex
1c1
< \documentclass[11pt,dvips]{article}
---
Post by Frank Küster
\documentclass[11pt]{article}
6a7
Post by Frank Küster
\usepackage[dvips]{graphicx}
it compile fine and generated the expected PDF with sequece.1 in it.

Anyway, graphicx is loaded earlier than I expect and putting it
before fontspec cannot fix
the problem completely.
Post by Frank Küster
Regards, Frank
--
Frank Küster
Sprecher B90/Grüne OV Miltenberg und Umgebung
VCD Miltenberg, ADFC Aschaffenburg-Miltenberg
Debian Developer (TeXLive)
--
________________________
Yes, I use Debian GNU/L
wolf python london(WPL)
Do as you soul should do !
________________________
Loading...