LaTeX Latex Graphics Acts Like Nothing Happened, Baffles Student.

AI Thread Summary
A student encountered issues with inserting graphics into a LaTeX lab report, where images failed to display despite using correct commands and ensuring files were in the same directory. The problem was traced to the use of a multi-column environment, which interfered with the float mechanism for figures. Suggestions included using the float package, adjusting figure placement, and employing the \begin{figure*} command for full-width floats. Ultimately, a solution was found by using the graphicx package, which resolved the issue and allowed for successful image inclusion. The student confirmed that the lab report was completed successfully after implementing the suggested fixes.
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
Views
3K
Replies
3
Views
2K
Replies
2
Views
3K
Replies
5
Views
3K
Replies
7
Views
12K
Replies
8
Views
12K
Replies
4
Views
3K
Replies
7
Views
3K
Back
Top