Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How do I insert an image on a LaTex doc?

  1. Feb 5, 2009 #1
    I googled this, but all articles assume previous knowledge of Latex.

    I am brand new to Latex. I am using TeXshop on my Mac.

    I have a template open and I want to insert a jpg in the document.

    I clicked on the "Graphics Template" and then pasted the the name of my picture in there like the template implies. But that doesn't do it (nor do I think it should). Clearly I am missing something here.

    Here is a screenshot of my attempt.


  2. jcsd
  3. Feb 5, 2009 #2


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    What is your error message?

    did you use \usepackage{graphics} or \usepackage{graphicx}?
    http://www.artofproblemsolving.com/LaTeX/AoPS_L_PictMan.php [Broken]
    Last edited by a moderator: May 4, 2017
  4. Feb 5, 2009 #3
    I tried \usepackage{graphicx} but got nothing... noob question: I put "\usepackage{graphicx} " with all the other "usepackages" at the top of the page right?
    Last edited by a moderator: May 4, 2017
  5. Feb 5, 2009 #4
    Where does the mage need to be saved? Does that matter?
  6. Feb 5, 2009 #5
    Error message:

  7. Feb 5, 2009 #6
    So I went to this site and copy/pasted this into a doc:

    I saved an image as "myimage.png"

    I compiled and got nothing.

    So I deleted everything except document class and such.

    Then I just drag-and-dropped the image from my desktop to the doc and it worked!

    It appears to have put the entire file path which I am not sure why the website does not?
    Last edited by a moderator: May 4, 2017
  8. Feb 6, 2009 #7
    This is kind of annoying. The template implies that you only need to put in the argument {moon.jpg} but when I do that, it does not work.

    When I drag and drop an image it automatically prints the line with the entire address. But the address looks like this


    It literally prints the dots "..."

    I use a Mac and cannot figure out how to find the address for certain files?

    On PC its just right-click-->properties and you're there.

    But with Mac?
  9. Feb 8, 2009 #8


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Not sure if that will be helpful (because I am on a Windows machine and use TeXnicCenter and MikTeX) but the following works for me:

    after the declaration of my document class I have


    then where I want my figure I use

    \caption{\label{mprop} Majorana propagator.}

    where the file propagator.eps is in the same directory as my TeX file. The factor of 0.80 simply scales down the figure to 80%.
  10. Feb 8, 2009 #9


    User Avatar
    Staff Emeritus
    Science Advisor

    Is your image in the same folder as your tex file? If so, then you should not need the entire path.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook