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

Discussion Overview

The discussion revolves around troubleshooting issues related to inserting images in LATEX documents. Participants explore various potential problems and solutions regarding the correct usage of commands and file paths.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant questions whether the \includegraphics command was placed in the preamble, noting that images cannot be inserted there.
  • Another participant suggests that the file extension must be included in the command, recommending the format \includegraphics{ask2.png} if the image is a PNG file.
  • It is mentioned that if the image is in the same folder as the source files, specifying the graphics path may not be necessary.
  • A participant raises a concern about using the \item command, which is typically used for bulleting lists, questioning its appropriateness for inserting an image.
  • One participant expresses uncertainty about the issue, suggesting that a more explicit path to the image might resolve the problem and recommending the removal of the \graphicspath command.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the exact cause of the issue, and multiple competing views on potential solutions are presented.

Contextual Notes

Participants note various assumptions regarding file paths and command usage, but these remain unresolved. Specific error messages and warnings are referenced without a clear resolution.

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