Latex Graphics Acts Like Nothing Happened, Baffles Student.

  • Context: LaTeX 
  • Thread starter Thread starter buttermellow7
  • Start date Start date
  • Tags Tags
    Graphics Latex Student
Click For Summary
SUMMARY

The discussion focuses on issues related to including graphics in LaTeX documents, specifically using the \includegraphics command from the graphicx package. The user faced challenges with images not displaying, despite following correct syntax and ensuring the image files were in the same directory as the LaTeX file. Solutions provided included using the float package, adjusting figure placement, and utilizing \begin{figure*} for multi-column environments. Ultimately, the user successfully resolved the issue by implementing a suggested solution from the forum.

PREREQUISITES
  • Familiarity with LaTeX document structure and commands
  • Understanding of the graphicx package for image inclusion
  • Knowledge of figure environments in LaTeX
  • Basic troubleshooting skills for LaTeX log files
NEXT STEPS
  • Learn about LaTeX figure placement options and the float package
  • Explore the differences between image formats supported by LaTeX, such as PDF, JPG, and EPS
  • Research how to troubleshoot common LaTeX errors and warnings in log files
  • Investigate advanced figure management techniques in multi-column documents
USEFUL FOR

Students, researchers, and academics who are preparing lab reports or documents in LaTeX and need to include graphics effectively.

buttermellow7
Messages
9
Reaction score
0
Hi everyone,
I'm trying to put graphics into a lab report in LaTeX, and the images simply won't show up. I've tried doing it several ways, including this:
\begin{figure}[h]
\begin{center}
\includegraphics{SeminalEmulsion.jpg}
\caption{default}
\label{default}
\end{center}
\end{figure}

and this:
\begin{figure}[placement specifier]
SeminalEmulsion.jpg
\end{figure}

I never get any error messages, it seems like the program is just completely ignoring the command. I made sure the picture file and the latex file were in the same folder, and I included \usepackage{graphicx} and \usepackage{float} at the beginning of my document. This isn't the first time I've had this problem. I think the problem might be that I don't have the packages actually installed, but I'm not sure where to check for them, and I feel like I should get an error if I instruct it to use a package it doesn't have (in fact, I tested my theory, and I do get an error when I ask it to use a blatantly ridiculous package). I'd really appreciate help, if anyone has any idea what might be wrong.
 
Physics news on Phys.org
Your images need to be in .eps format, for starters.
 
So I'm discovering. Is there a quick way to convert them? Will changing the file type and replacing \includegraphics{SeminalEmulsion.jpg} with \psfig{file=FileName.eps} solve the problem?
 
Well at least now I'm getting an error: its ays Unknown graphics extension: .eps, and also \epsfig{file=Emulsion.eps} gets a question mark. I was under the impression that TeXShop could handle PDF's but not EPS's. Now it seems like this is the case. Help?
 
You do not need your images to be eps if you're using texshop.
 
Yeah, I've gone back to trying PDF's and JPEG's. I'm using the following text

\begin{figure}[h]
\begin{center}
\includegraphics[scale=0.5]{Emulsion}
\caption{One of the photographic emulsion plates obtained by Lattes, Powell, et. al. \cite{LP2}depicting the decay of a pion ($m_1$) into a muon($m_2$). The photograph was obtained at Ilford Nuclear Research via Boron-Loaded C2 Emulsion. It is completely unretouched.}
\label{Figure}
\end{center}
\end{figure}

(I've tried JPEG and GIF, and tried alternately using the extension in the names and not)

and it still seems to be completely unaware that I've entered anything. If I put it in line with text, it doesn't even create a break.
 
Try the \includegraphics directly into your document, not inside a figure. That will check whether the problem is with the graphics file or the figure environment. Figures can sometimes "get lost" completely if LaTeX thinks they are a crazy size compared with your page size, etc.

Also check the .log file to see if there are any messages that TeX doesn't count as errors, but are not what you expected to see.

If that doesn't help, can you attach the .jpg here, or post a link to it (on photobucket or somewhere). Without seeing the file, any other suggestions are mostly guesswork.

I don't use TeXShop, but there are certainly TeX implementations that can include both graphics in .pdf and .jpg format successfully.

EDIT: I hadn't seen your #6 when I wrote this, but it still applies.

Another bit of info: if LaTeX "loses" a figure, it usually outputs a message saying "floats lost", but this doesn't actually count as an error.
 
Thanks! It seems like it's because I'm using the multi-column environment, so that means I can't use floats. I'm pretty sure it's working if I just use the \includegraphics command, but is there any way to still include captions? I don't think my prof. would be okay with it if I left those out :)
 
You might be able to get floats working by using the float package and then changing the position specified from h to H. Also, consider changing your scale to something like \columnwidth ...just a few ideas that may or may not work.
 
  • #10
According to my favoriite "LaTeX cheat sheet", #9 should work, but you may have to play about with the exact placement of the floats in your document to make sure they will actually fit "Here" without over-running the page height etc, and there may be problems if you have a float in the last column of you document.

Another workround is \begin{figure*} ... \end{figure*} which should give you a float that is the full page width, which makes more sense if you put the float at the top or bottom of the page, not "here". This doesn't need the "float" package.
 
  • #11
I'll be a little contrarian here (I think... unless that's already been addressed!), and suggest that you use the graphicx package (with an \usepackage{graphicx} near the beginning)--it should treat the whole thing as a float, and will allow for the use of captions:
http://en.wikibooks.org/wiki/LaTeX/Importing_Graphics
 
  • #12
Thanks, everyone! Suggestion number 9 worked perfectly. Lab=success!
 

Similar threads

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