I was having no problem with this until a couple of hours ago. Everything was working perfectly, until pdftex suddenly decided to throw errors on including graphics (example is png, but was originally pdf).
The following are the packages I'm using:
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{colortbl}
\usepackage{placeins}
\usepackage[margin=2.5cm]{geometry}
\usepackage{multirow}
The following is the code I'm using to load the image:
\begin{figure}[h]
\centering
\includegraphics[width=0.8\textwidth]{ test.png }
\end{figure}
geometry driver: auto-detecting geometry detected driver: pdftex
LaTeX Warning: No \author given.
./.Report.tex.swp:15: LaTeX Error: Unknown graphics extension : .png .
See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ...
l.15 ...egraphics[width=0.8\textwidth]{ test.png
./.Report.tex.swp:15: ==> Fatal error occurred, no output PDF file produced! Transcript written on /tmp/.Report.tex.log.
I've also tried specifying the type and extension, but it provides me with a different error. So, for the code...
\begin{figure}[h]
\centering
\includegraphics[width=0.8\textwidth, type=png, ext=.png]{ test }
\end{figure}
with the following error...
geometry driver: auto-detecting geometry detected driver: pdftex
LaTeX Warning: No \author given.
./.Report.tex.swp:15: LaTeX Error: Cannot determine size of g raphic in test .png (no size specifed).
See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ...
l.15 ...0.8\textwidth, type=png, ext=.png]{ test } ./.Report.tex.swp:15: ==> Fatal error occurred, no output PD F file produced! Transcript written on /tmp/.Report.tex.log.
Few things of note: I'm using Gummi, but pdflatex has the same errors when I run it in a terminal. The images are generated by python's matplotlib library. This all seemed to start when I first used the grffile package (as my original files had multiple ., now removed) but it's definitely not being used anymore.
I presume something has gone wrong with the installation here, but I thought I would ask in case I'm missing something. Please let me know if you want any additional details.
Thanks
.png
” (with a space at the end). The input should be\includegraphics[<options>]{test.png}
(or without the extension, but no space).pdflatex
on a swap file (.Report.tex.swp
) instead of a regular (non-hidden).tex
file? (Nothing to do with your error, just curious. It seems a dangerous naming scheme, if intentional. The only swap files that I know of are binary temporary lock files, such as those created byvim
.)