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
Click For Summary
SUMMARY

The discussion focuses on troubleshooting image insertion issues in LaTeX using the graphicx package. Key points include the necessity of specifying the correct file extension when using the \includegraphics command, ensuring images are not included in the preamble, and the importance of the correct file path. Users are advised to remove the \graphicspath command if the image is in the same directory as the source files and to provide an explicit path if necessary.

PREREQUISITES
  • Understanding of LaTeX document structure and commands
  • Familiarity with the graphicx package for image handling
  • Knowledge of file paths and extensions in LaTeX
  • Basic troubleshooting skills for LaTeX error messages
NEXT STEPS
  • Research the use of the \includegraphics command in LaTeX
  • Learn about the graphicx package and its options
  • Explore common LaTeX error messages and their resolutions
  • Study best practices for organizing LaTeX project files and images
USEFUL FOR

LaTeX users, students writing documents with images, and anyone troubleshooting image insertion in LaTeX documents.

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 ·
Replies
5
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 1 ·
Replies
1
Views
8K