# How can I set the 'final' option for the graphicx package in XeTeX?

I'm using XeTeX and wondering how to set the final option of the graphicx package.

I started my document with pdfTeX and the following lines:

\documentclass[a4paper, 12pt, twoside, headsepline, draft]{scrreprt}

...

\usepackage[final]{graphicx}


Then I migrated to XeTeX and got an option clash for the graphicx package. Having removed the graphicx declaration the clash vanished but so did the graphics. Doing some research I came across this and tried to change it from draft to final but unfortunately without success.

-
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. In particular, those two lines alone give no error, so there must be something else causing it. –  egreg Jan 25 at 13:54
add comment

## 1 Answer

It is not completely clear what your problem is. The scrreprt class does not load the graphicx package so

\documentclass[draft]{scrreprt}
\usepackage[final]{graphicx}
\begin{document}
\includegraphics{mill.png}
\end{document}


should work without problems. It is likely that you are loading another package that loads the graphicx package. For example, you get an option clash error with

\documentclass[draft]{beamer}
\usepackage[final]{graphicx}
\begin{document}
\includegraphics{mill.png}
\end{document}


because beamer loads graphicx and gives it the draft option. One way to get around this problem is

\documentclass[draft]{scrreprt}
\usepackage{graphicx}
\makeatletter
\Gin@draftfalse
\makeatother
\begin{document}
\includegraphics{mill.png}
\end{document}


which sets the draft flag to false for graphicx.

-
Keep in mind that you can pass options to package which are loaded inside classes by using \PassOptionsToPackage{<options>}{<package>} before \documentclass. However, I'm not sure about the order between these and class options, so you might end up with final,draft resulting in draft because the latest option, i.e. the most right one, will prevail. –  Martin Scharrer Jan 25 at 15:14
add comment