Troubleshooting: Image Not Appearing - Tips for Inserting an Image in LATEX

  • Context: LaTeX 
  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    Picture
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 5K views
evinda
Gold Member
MHB
Messages
3,741
Reaction score
0
Hello! (Wave)

I am writing something in LATEX and I want to insert an image.

I wrote at the beginning this:

[m] \usepackage{graphicx}
\graphicspath{ {shm/} } [/m]

[m]shm[/m] is the folder where I saved the picture that I want to upload and then I wrote this: [m] \item \includegraphics{ask2} [/m](I called the graph [m]ask2[/m]) but the picture doesn't appear... Have I written something wrong?
 
Physics news on Phys.org
Four things.
1) Did you type [m]\includegraphics{ask2}[/m] in the preamble? You can't insert images in the preamble.
2) You have to put the file extension after the name. If it is a .png, then write [m]\includegraphics{ask2.png}[/m].
3) If you put the picture in the same folder as the source files, you don't need to specify the graphics path.
4) Why do you have the picture bulleted (the [m]\item[/m] command bullets lists, as I'm sure you know)?
 
jacobi said:
Four things.
1) Did you type [m]\includegraphics{ask2}[/m] in the preamble? You can't insert images in the preamble.
2) You have to put the file extension after the name. If it is a .png, then write [m]\includegraphics{ask2.png}[/m].
3) If you put the picture in the same folder as the source files, you don't need to specify the graphics path.
4) Why do you have the picture bulleted (the [m]\item[/m] command bullets lists, as I'm sure you know)?

I have to write exersices in LATEX and at the second exercise I have to add a picture.

At the beiginning I wrote this:\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english,greek]{babel}
\usepackage{amsmath}
\usepackage{graphicx}
\graphicspath{ {shm/} }and then:\begin{document}.....\includegraphics{ask2.jpg}....\end{document}

But I got the warning message:

[m]

Package pdftex.def Error: File `ask2.jpg' not found. File `ask2.jpg' not found on imput line 81.[/m]
What can I change?
 
It looks right. I don't exactly know what the problem is. All I can suggest is that you put a more explicit path to the image in the [m]\includegraphics[/m] command (i.e. [m] \includegraphics{c: \folder\folder2\...\shm\ask2.jpg}[/m]) and remove the [m]\graphicspath[/m] command in the preamble. Maybe that will help.
Other than that, I'm not exactly sure why it isn't working.