Troubleshooting Image Display in LaTeX

  • Context: LaTeX 
  • Thread starter Thread starter Rectifier
  • Start date Start date
  • Tags Tags
    Images Latex
Click For Summary

Discussion Overview

The discussion revolves around troubleshooting image display issues in LaTeX, specifically regarding the use of the \includegraphics command. Participants explore potential reasons for images not appearing in the document, focusing on directory assignments and the correct usage of environments.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant expresses difficulty in getting images to display using the \includegraphics command and seeks assistance.
  • Another participant suggests that issues often stem from incorrect directory assignments, although they admit limited knowledge of LaTeX.
  • A participant points out that there is no "graphics" environment and recommends using the "figure" environment instead or placing \includegraphics directly in the document.
  • Contradicting the previous point, another participant asserts that if the image is in the same directory as the LaTeX file, the command should not include a folder name, only the file name.
  • One participant acknowledges the clarification regarding the inclusion of the folder name and expresses gratitude for the correction.

Areas of Agreement / Disagreement

The discussion contains conflicting viewpoints regarding the use of environments and the inclusion of folder names in the \includegraphics command. No consensus is reached on the best approach to resolve the image display issue.

Contextual Notes

Participants express uncertainty about the correct environment to use and the implications of directory structure on image display. There are unresolved assumptions regarding the LaTeX setup and the specific context of the user's issue.

Rectifier
Gold Member
Messages
313
Reaction score
4
Hey!

I can't get my images to appear in ##LaTeX## :(
Could you please help me out?

I have read that you can use \includegraphics but when I add it in my code nothing happens.

Code:
\documentclass[a4paper,11pt]{article}
\usepackage[swedish]{babel}
\usepackage{graphicx}

\begin{document}

\begin{graphics}
\includegraphics[width=0.7\textwidth]{folder/test.jpg}
\end{graphics}

\end{document}

Where image is in the same folder as the LaTeX file.

What am I doing wrong?
 
Last edited:
Physics news on Phys.org
There are many threads on the problem, they are listed below as related discussions - see if comments in these threads don't help.

AFAIR in most cases it is a problem of correctly assigning directories, but I know next to nothing about LaTeX.
 
  • Like
Likes   Reactions: 1 person
There is no such thing as a "graphics" environment. If you want a floating figure, try instead
Code:
\begin{figure}
...
\end{figure}
Otherwise, you can simply put the \includegraphics by itself.

If you figure resides in the same directory as the LaTeX file, don't explicitly include a folder name, just the name of the file.
 
Last edited:
  • Like
Likes   Reactions: 1 person
DrClaude said:
If you figure resides in the same directory as the LaTeX file, do explicitly include a folder name, just the name of the file.

I think Dr Claude means, "If your figure resides in the same directory as the LaTeX file, don't explicitly include a folder name, just the name of the file."

In other words, if the file test.jpg is in the same folder as the latex file, the includegraphics line should read:

Code:
\includegraphics[width=0.7\textwidth]{test.jpg}
 
  • Like
Likes   Reactions: 1 person
Will try that out when I am home thank you all.
 
phyzguy said:
I think Dr Claude means, "If your figure resides in the same directory as the LaTeX file, don't explicitly include a folder name, just the name of the file."
Thanks for spotting that!
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
8K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
3
Views
5K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 2 ·
Replies
2
Views
3K