[Tex/LaTex] Problem sizing the image with \includegraphics

graphicsscaling

This question is very similar to Image from \includegraphics showing in wrong image size, but not quite the same.

The size of the image that appears in my manuscript depends entirely on the dpi setting I give it in IrfanView. It doesn't matter which width or scale settings I use – these settings only determine the horizontal and vertical offset of my image. Now I have tried including the same image in both .png and .pdf format, always the same result.

However, I have used .eps figures a lot, and there it very easy to change the size with a simple width. Is it somehow possible to do the same with figures that are not .eps? I will be dealing with a lot of figures in the next few months and would prefer controlling the image size directly from within LaTeX, instead of having to go through another program.

I am using pdflatex with the graphicx package and define my figure as such:

\begin{figure}[ht]
  \centering
  \includegraphics[width=0.8\textwidth]{MyFigure.png}
  \caption{My Caption}
  \label{fig::myFig}
\end{figure}

Best Answer

After a few hours of trial and error it turns out that a package setting for a different package was causing the problem in graphicx. I was using a template given to me by someone else which had:

\usepackage[usenames,dvips]{color}

defined. Alas, the dvips option was causing the problem. Removing it I am now able to include a .png with \includegraphics and set the size with the the width option.