1

I know this question asked here before, and I've seen all your answer but it didn't work with me

just \includegraphics[width=0.8\textwidth,natwidth=610,natheight=642]{first.png}work, but if I do that then I can't control on the position of graph, so could you help ?

A.khalaf
  • 351
  • If you are using latex rather than pdflatex then you need to tell it the size of the figure (as it can not read the png file to discover it). If you use pdflatex this is not needed as it can read png files. I do not understand your last comment as these size keys have no connection with commands you use to control the position of the figure. – David Carlisle Oct 27 '14 at 16:36
  • 1
    This question should be closed as a duplicate as the earlier one (it even has exactly the same title) However if you are having a problem with positioning the image, please feel free to ask a new question on that, preferably with some example code that shows the problem. – David Carlisle Oct 27 '14 at 16:39
  • how i cant tell it the size of the figure ? – A.khalaf Oct 27 '14 at 16:41
  • Sorry I do not understand that last comment. If you are using pdflatex then you can use \includegraphics[width=0.8\textwidth]{first.png} but if you are using latex you must use natheight and natwidth to tell latex the size of the image. – David Carlisle Oct 27 '14 at 16:43
  • Welcome to TeX.SX! Please tell us how you are compiling your tex file. – Andrew Swann Oct 27 '14 at 16:48
  • I'm usin TeXnic center – A.khalaf Oct 27 '14 at 16:54
  • @DavidCarlisle sorry, i use latex and i use natheight but it didn't work ! – A.khalaf Oct 27 '14 at 16:56
  • did you set it to the correct value, in your question you have specified that the image is 642 postscript points high before scaling, if that is not accurate latex will get confused. In the duplicate question answer are some tools that you can use to determine this exactly, automatically – David Carlisle Oct 27 '14 at 17:08
  • \includegraphics[width=0.8\textwidth,natwidth=610,natheight=642]{first.png} \label{fig:first} \end{figure}

    I did it and there is no error, but now How i can controlling position of the graph ?

    – A.khalaf Oct 27 '14 at 17:10
  • The position is controled by TeX according to an algorithm for floating objects. If you put your image within a figureenvironment then is a floating. – Aradnix Oct 27 '14 at 17:16
  • Your questions are totally confusing. The question about image size is a duplicate, and you hint you have a problem with float placement but unless you say what that problem is (in a new question) no one will be able to guess what the problem is. – David Carlisle Oct 27 '14 at 17:20
  • @DavidCarlisle Finally it's work !! – A.khalaf Oct 27 '14 at 17:28
  • sorry but i was very confusing @DavidCarlisle – A.khalaf Oct 27 '14 at 17:28
  • :-) glad you got it working, welcome to the site:-) – David Carlisle Oct 27 '14 at 17:32

0 Answers0