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

Discussion Overview

The discussion revolves around issues related to including graphics in a LaTeX document, specifically within a lab report context. Participants explore various methods for inserting images, troubleshooting errors, and addressing compatibility with different file formats.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant describes attempts to include a JPEG image using the \includegraphics command but encounters issues with the image not appearing.
  • Another participant suggests that images need to be in .eps format, prompting a question about converting file types.
  • A participant reports receiving an error message regarding unknown graphics extensions when trying to use .eps files, indicating confusion about TeXShop's capabilities.
  • Some participants clarify that .eps files are not necessary when using TeXShop, suggesting alternatives like PDF and JPEG formats.
  • One participant mentions that using the multi-column environment may prevent the use of floats, leading to questions about including captions without floats.
  • Another participant proposes using the float package and adjusting the position specifier to H to potentially resolve float issues.
  • Suggestions include using \begin{figure*} for full-page width floats and ensuring proper placement of floats to avoid page height issues.
  • One participant advocates for the graphicx package, which allows for captions and treats images as floats.
  • A later reply confirms that a suggested solution worked for the original poster, leading to a successful outcome.

Areas of Agreement / Disagreement

Participants express differing views on the necessity of .eps files and the use of floats in multi-column environments. While some solutions are proposed, there is no consensus on a single approach, and various methods are discussed.

Contextual Notes

Participants mention limitations related to the multi-column environment and the potential for floats to be lost if not properly managed. There are also references to specific LaTeX packages and commands that may not be universally applicable depending on the user's setup.

Who May Find This Useful

This discussion may be useful for students and users of LaTeX who are facing challenges with including graphics in their documents, particularly in academic or lab report contexts.

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
3K
  • · 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
13K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K