9

I have been trying to implement the solution that is mentioned here to solve the error, "Cannot determine size of graphic".

However when I want to add \usepackage[dvipdfmx]{graphicx} \usepackage{bmpsize}; I get the error "Option clash for package graphicx."

I am using overleaf and I just can't figure out what is going on because I just copied the following code that I had used there before for another project which was working. Now it gets the error "Cannot determine size of graphic".

\begin{figure}[!htbp]
  \includegraphics[width=\textwidth]{05_cost.png}
  \centering
  \caption{Probability density distribution comparisons of the true target and resampled instance spaces}
  \label{fig:kd}
\end{figure}

One additional thing is, now I had to give the name as 05_cost.png while before, it basically worked only with 05_cost and simply just by using the graphicx package.

I would be so happy to hear some advices.

Thanks a lot.

  • 3
    It looks like the graphicx package is loaded twice. Check carefully your \usepackage declarations. Edit: What happens wihout the bmpsize package? – GuM Jun 09 '16 at 14:13
  • Welcome to TeX.SX! A tip: If you indent lines by 4 spaces or [enclose words in backticks ```](http://meta.tex.stackexchange.com/q/863), they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it). – ebosi Jun 09 '16 at 14:24
  • 1
    the full error message which you have not shown says exactly what the clashing options are. – David Carlisle Jun 09 '16 at 14:25
  • 1
    With the information you give, I'm not sure what really happens but how about passing dvipdfmx option as a global option (like \documentclass[dvipdfmx, <other options>]{article})? It can avoid option clash caused by packages which internally load the graphicx package. – yudai-nkt Jun 09 '16 at 15:11
  • I thought I checked that carefully, now realized there is a package that I use which included graphicx inside. When I removed it, I did not get an error, However now the figure is not actually showed, it is just blank. Would you have any idea ? – usertugce Jun 09 '16 at 18:14
  • 1
    As previously mentioned, you've not provided sufficient information for anybody to diagnose the problem. Did you try @DavidCarlisle 's suggestions? – cfr Jun 09 '16 at 21:09
  • Try loading graphicx, with the options you want, before that other package. If that doesn’t work, try adding \PassOptionsToPackage{<your options>}{graphicx} before the \usepackage declaration for that other package. – GuM Jun 09 '16 at 23:27
  • Thanks a lot, I did remove the package that was including graphicx inside as @DavidCarlisle suggested and this error was gone. However the image then did not show up even though there was no error. (I am using overleaf ) At the end, I just created a new project and removed the standard package (from my class) that I was using for the formatting and everything worked. So i am still not sure what was the problem that was causing the blank image. Thanks a lot for everyone for your helps anyways. Now I have functioning code. – usertugce Jun 24 '16 at 18:10
  • 4
    I'm voting to close this question as off-topic because the op solved it by his own as mentioned in the last comment. – Mensch Jun 28 '16 at 19:08

0 Answers0