Register to reply

How do I insert an image on a LaTex doc?

by Saladsamurai
Tags: image, insert, latex
Share this thread:
Saladsamurai
#1
Feb5-09, 10:34 PM
Saladsamurai's Avatar
P: 3,015
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.



Thanks,
Casey
Phys.Org News Partner Science news on Phys.org
NASA team lays plans to observe new worlds
IHEP in China has ambitions for Higgs factory
Spinach could lead to alternative energy more powerful than Popeye
robphy
#2
Feb5-09, 10:50 PM
Sci Advisor
HW Helper
PF Gold
robphy's Avatar
P: 4,119
What is your error message?

did you use \usepackage{graphics} or \usepackage{graphicx}?
http://www.artofproblemsolving.com/L..._L_PictMan.php
Saladsamurai
#3
Feb5-09, 10:58 PM
Saladsamurai's Avatar
P: 3,015
Quote Quote by robphy View Post
What is your error message?

did you use \usepackage{graphics} or \usepackage{graphicx}?
http://www.artofproblemsolving.com/L..._L_PictMan.php
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?

Saladsamurai
#4
Feb5-09, 11:01 PM
Saladsamurai's Avatar
P: 3,015
How do I insert an image on a LaTex doc?

Where does the mage need to be saved? Does that matter?
Saladsamurai
#5
Feb5-09, 11:03 PM
Saladsamurai's Avatar
P: 3,015
Error message:

Saladsamurai
#6
Feb5-09, 11:34 PM
Saladsamurai's Avatar
P: 3,015
Quote Quote by robphy View Post
What is your error message?

did you use \usepackage{graphics} or \usepackage{graphicx}?
http://www.artofproblemsolving.com/L..._L_PictMan.php
So I went to this site and copy/pasted this into a doc:

\documentclass{article}
\usepackage[pdftex]{graphicx}
\begin{document}

This is my first image.

\includegraphics{myimage.png}

That's a cool picture up above.
\end{document}

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?
Saladsamurai
#7
Feb6-09, 01:29 PM
Saladsamurai's Avatar
P: 3,015
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

../../Users/me/moon.jpg

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?
nrqed
#8
Feb8-09, 07:39 PM
Sci Advisor
HW Helper
P: 2,887
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

\usepackage{graphicx}

then where I want my figure I use

\begin{figure}[h]
\begin{center}
\scalebox{0.80}{\includegraphics{propagator.eps}}
\caption{\label{mprop} Majorana propagator.}
\end{center}
\end{figure}

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%.
cristo
#9
Feb8-09, 08:28 PM
Mentor
cristo's Avatar
P: 8,305
Quote Quote by Saladsamurai View Post
It appears to have put the entire file path which I am not sure why the website does not?
Is your image in the same folder as your tex file? If so, then you should not need the entire path.


Register to reply

Related Discussions
Insert Dielectric Introductory Physics Homework 3
LaTeX Image Question Math & Science Software 1
Insert image Forum Feedback & Announcements 0
Convert a text file into an image (or generate an image with fortran) Computing & Technology 1
Image Arrays in LaTeX Math & Science Software 0