Graphics, Figures & TablesImages not showing up

Information and discussion about graphics, figures & tables in LaTeX documents.
Epideme90
Posts: 21
Joined: Tue Apr 24, 2012 5:41 pm

Images not showing up

Post by Epideme90 »

Hey, i'm new to this board, and i'm here mostly out of latex frustrating me :)

Images are not showing up when I call them - they just give an appropriate size outline with the filename written inside. I have read other posts and it is not that I have a draft class in place:

Code: Select all

\documentclass[a4paper,12pt]{article}
\usepackage{graphicx}
\begin{document}
\section{section}
some writing...
\begin{figure}[h!]
\centering
\includegraphics[width=0.6\textwidth]{parity2.jpg}
\caption{Parity operation action on a left-handed particle's wave function, is equivalent to a right handed particle}
\label{fig:parity}
\end{figure}
some more writing...
\end{document}
I have 2 images that are doing this - the images are both in the same folder as my tex file, there is however one image that works fine. But it is done from the exact same image template - and i'm a bit stumped. I'm not totally new to LaTeX - however i am more than a little clueless about it :P Any help would be much appreciated...

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

Images not showing up

Post by Stefan Kottwitz »

Hi,

welcome to the board!

Do you have spaces or special characters in the file name or path? For example, \includegraphics can have problems with spaces, which can be fixed by loading the grffile package, or of course by removing the spaces in the file name.

Stefan
LaTeX.org admin
Epideme90
Posts: 21
Joined: Tue Apr 24, 2012 5:41 pm

Re: Images not showing up

Post by Epideme90 »

Nope - i don't think so, the file path to this image is:
C:/Users/Nick/Desktop/Masters2/charge1.jpg
I also tried entering the full file path - no avail.
I entered a load more images into the document aswell - 4 more to be precise - all 4 have done this same thing, leaving only 1 that showed up. Aswell as this they don't really go where they are meant to, they have a tendency to go to the top of the next page, which is odd since i put in [h!]. I#ll load that package anyway - see what happens...
Epideme90
Posts: 21
Joined: Tue Apr 24, 2012 5:41 pm

Re: Images not showing up

Post by Epideme90 »

It refuses to compile if i add in /usepackage{grrfile}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

Images not showing up

Post by Stefan Kottwitz »

\usepackage requires a backslash, and the package name is grffile, not grrfile.

Besides this, perhaps post your .log file as attachment to a post. There could be useful debugging information.

Stefan
LaTeX.org admin
Epideme90
Posts: 21
Joined: Tue Apr 24, 2012 5:41 pm

Re: Images not showing up

Post by Epideme90 »

Ah, that was a typo when writing it on here, but i reran with it just to check, and no change. I can't find a .log file, I can find .lot and .lof, but no .log
Epideme90
Posts: 21
Joined: Tue Apr 24, 2012 5:41 pm

Re: Images not showing up

Post by Epideme90 »

I do have this from the output though:
LaTeX warning: File 'parity2.jpg' not found on line 76
package pdftex.def error: file 'aprity2.jpg' not found
see pdf documentation et cetera et cetera
User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

Images not showing up

Post by Stefan Kottwitz »

Epideme90 wrote:I do have this from the output though:
LaTeX warning: File 'parity2.jpg' not found on line 76
package pdftex.def error: file 'aprity2.jpg' not found
see pdf documentation et cetera et cetera
It looks like a typo again: 'aprity2.jpg'. If you try to load that, but it's called 'parity2.jpg', it would not be found. Well, perhaps you did not copy & paste and it's only a typo here. Just ensure, that the file name is exactly the same as you try to load it, i.e. also capitalization must be the same.

Perhaps attach parity2.jpg if you like, and we test it with your code example.

Stefan
LaTeX.org admin
Epideme90
Posts: 21
Joined: Tue Apr 24, 2012 5:41 pm

Images not showing up

Post by Epideme90 »

It is a typo here - annoyingly it wouldnt let me copy and paste. Attached parity2.jpg - no capitalisations involved. If it matters i'm using MiKTex2.9 and TeXNicCentre. Everything is saved in that same folder - and 1 image definitely works which is called ideogram.jpg - uploaded that too in case you can spot a difference. The code for ideogram seems identical (i've just included the graphic code snippet here)

Code: Select all

\begin{figure}[h!]
\centering
\includegraphics[width=0.6\textwidth]{ideogram.jpg}
\caption{Plot of the measurements listed in the table above, taken from PDG Live. $A_{CP}$ is plotted as a decimal (i.e. 2 orders of magnitude less) here, and the error bars are scaled by 1.8}
\label{fig:ideo}
\end{figure}
Attachments
Working Image
Working Image
ideogram.jpg (36.44 KiB) Viewed 14711 times
Not Working Image
Not Working Image
parity2.jpg (33.34 KiB) Viewed 14711 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

Images not showing up

Post by Stefan Kottwitz »

I tried your code from above, and the picture. No error, the output is as expected:
example.png
example.png (23.32 KiB) Viewed 14710 times
Did you try your small example above? If not, please do (in the same folder as the image) and tell us, if this example works or not.

If it's just your main document, which fails, there would be an error in code which you did not show yet. Actually, it should be a problem which is easy to fix, it just requires some troubleshooting, especially providing more information.

If the main document fails (in contrast to the small example), produce a Infominimal working example by hacking down (visit the link), producing a reduced copy, not a new document.

Stefan
LaTeX.org admin
Post Reply