## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ No Graphics Extension recognized Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
nicoo
Posts: 4
Joined: Thu Jul 28, 2011 6:22 pm

### No Graphics Extension recognized

Hello all!

I am using PDFLaTeX to compile a document. Until now it was working fine, but suddenly it stopped recognizing any graphics extension.
\documentclass{article}\usepackage{graphicx} \begin{document}    \begin{figure}[h]     \includegraphics[width=0.3\linewidth]{anusha.jpg }     \end{figure}\end{document}

and I get this error:
! LaTeX Error: Unknown graphics extension: .jpg . See the LaTeX manual or LaTeX Companion for explanation.Type  H <return>  for immediate help.  ...                                               l.192 ...raphics[width=0.3\linewidth]{anusha.jpg } ?

And this for whatever extension .jpg,.pdf,.eps etc.

What is happening?

Thank you for your attention!
Last edited by localghost on Mon Oct 21, 2013 7:28 pm, edited 1 time in total.
Reason: Longer passages of source code are tagged as code block, not as in-line code.

Tags:

Johannes_B
Site Moderator
Posts: 4163
Joined: Thu Nov 01, 2012 4:08 pm
A wild guess would be that you are now compiling with latex instead of pdflatex. Additionally, you should leave out the file extension. The white space at the end of the file name could be something that confuses LaTeX as well. EDIT: It's definitely the extra space in the MWE above.

Best regards
Johannes
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
Johannes' assumption is correct. And the error message also indicates the reason.
! LaTeX Error: Unknown graphics extension: .jpg .

Note the blank space after the suffix. The compiler searches for a file with the suffix ".jpg␣". And as Johannes already mentioned, you can drop suffixes completely. The graphicx package will search for acceptable file formats on its own.

By the way, with LaTeX almost nothing happens suddenly. Most problems are caused due to user action.

Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

nicoo
Posts: 4
Joined: Thu Jul 28, 2011 6:22 pm
Wow, I can't believe a simple extra space can mess everything up! Anyway, I hope this post will help other people not going through this trouble. Thank you for the quick response!