Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. –  Speravir Apr 22 at 2:56
    
As far as I know you have to set all images to the same dpi before you use them in TeX. See DPI for imported bitmaps. And Uncertain about dpi in LaTeX and comments. Or in general the tag resolution. –  Speravir Apr 22 at 3:07
1  
The package graphics knows the following driver options: dvips, xdvi, dvipdf, dvipdfm, dvipdfmx, xetex, pdftex, dviwindo, emtex, dviwin, oztex, textures, pctexps, pctexwin, pctexhp, pctex32, truetex, tcidvi, vtex. Each DVI driver or TeX engine has different capabilities regarding images. Therefore it is quite important to know, which driver you are using. Also add a MWE to clarify, what you are doing. I know about keys width and scale for \includegraphics of package graphicx. But \width and \scale settings could mean something different. –  Heiko Oberdiek Apr 22 at 3:57
    
Thank you for your suggestions and my excuses for not being very clear. I have found and posted the solution, and have added details to the original question. –  chnaideur Apr 22 at 6:02

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
2  
Never set options such as dvips or pdftex to color, xcolor or graphicx; this limits portability and those packages are able to figure out the current typesetting engine by themselves. –  egreg Apr 22 at 10:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.