LaTeX Troubleshooting Image Display in LaTeX

  • Thread starter Thread starter Rectifier
  • Start date Start date
  • Tags Tags
    Images Latex
AI Thread Summary
The issue with images not displaying in LaTeX is often due to incorrect usage of environments and file paths. The correct command to include images is \includegraphics, but it should not be placed within a non-existent "graphics" environment; instead, it can be used directly or within a "figure" environment. If the image is in the same directory as the LaTeX file, only the file name should be specified without any folder path. Users are advised to check their file paths and ensure they are using the correct syntax for including graphics. Properly addressing these points should resolve the image display issue in LaTeX.
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 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 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 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

Back
Top