Firstly and fore-mostly I am a complete new comer to the world of LaTeX and so please do bear with me. I will try to be as accurate as I can but if you need any more info please let me know.

All I want is to figure out how to import a graphic into LaTeX (MacTeX).

I am using the following in my code:


Then in my document section I'm using

\includegraphics[width = 50mm]{Name.jpg}

Once I compile the document, the area for the picture has been allocated but there is no image, I have tried .png and .pdf files also.

I know that this is a very simple question and I hope there is a simple solution but I cannot find anything on the net about this (which may mean I'm being dim).

Also I'm using Latexian but I have tried 4 different editors and it doesn't work in any.

migrated from stackoverflow.com Feb 16 '12 at 8:52

This question came from our site for professional and enthusiast programmers.

  • In order to include a JPG image, you cannot compile using latex. You need to compile with a different compiler - pdflatex, for example. – Werner Feb 16 '12 at 7:29
  • Are you specifying the draft option with \documentclass? – egreg Feb 16 '12 at 9:09
  • 2
    You should always make small but complete examples like the one of Peter instead of sending code snippets. This will avoid that you left out important informations (like "are you using draft or not?"). You should also look in the log-file if there are errors or messages. If you don't understand the log: make it available on the net (remove confidential informations like your name if necessary but let everything else untouched). – Ulrike Fischer Feb 16 '12 at 11:07
  • Thank you everybody, It was in fact, that I was using the draft tag (this was automatically added to the preamble using a wizard). I apologise for not including the full code I was using. I was trying to be as specific as possible (due to the big ugly warning I got prior to posting the question) but unfortunately this back-fired. I do however know this for the future and will always try to include as much as I can. I suspect that as I become more acquainted with this very nice piece of software I will become more efficient at portraying my difficulties. Thanks again, your help is much apprecia – DazBaldwin Feb 16 '12 at 19:00
  • As suggested below I have now added the \documentclass that was causing the issue, when draft was changed to final, all worked – DazBaldwin Feb 16 '12 at 21:15

In the same directory where I have the file with the code below I have the file EiffelTowerNight.jpg. Typesetting the code below with pfdlatex results in the image being produced:

enter image description here


  • If you add the demo option to the graphicx package as in \usepackage[demo]{graphicx} then this will be displayed as

    enter image description here

  • If you use the draft option to the class as in \documentclass[draft]{article}, then this will be displayed as:

    enter image description here



    \includegraphics[width = 50mm]{EiffelTowerNight.jpg}
  • I believe that if you leave the file extension off (.jpg, .pdf, etc), assuming you have the appropriate versions of your image file available, both the latex and pdflatex compilers will search for their 'preferred' image format and insert the image. I have done this successfully but do not have the TeX code on hand. Drop me a response if you'd like me to dig it up. – Carl Witthoft Feb 16 '12 at 14:06
  • 1
    In view of the OP's comment, would you add the information about the draft option in \documentclass, that can be countermanded calling graphics with the final option? – egreg Feb 16 '12 at 19:07
  • let me know if you want anything else adding – DazBaldwin Feb 16 '12 at 21:15
  • @egreg: Added two failure modes: draft option for \documentclass and demo option for graphicx. – Peter Grill Feb 17 '12 at 0:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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