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

  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    Picture
AI Thread Summary
To insert an image in LaTeX, ensure the following steps are correctly followed. First, the \includegraphics command should not be placed in the preamble; it must be within the document environment. Include the file extension in the command, such as \includegraphics{ask2.png} or \includegraphics{ask2.jpg}. If the image is in the same folder as the source files, specifying the graphics path is unnecessary. Additionally, avoid using the \item command for images, as it is intended for list items. If encountering a "File not found" error, consider providing a full path to the image in the \includegraphics command and removing the \graphicspath command to troubleshoot the issue.
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.
 

Similar threads

Replies
5
Views
3K
Replies
3
Views
2K
Replies
2
Views
3K
Replies
2
Views
2K
Replies
2
Views
3K
Replies
2
Views
6K
Replies
2
Views
5K
Replies
7
Views
3K
Replies
1
Views
8K
Back
Top