LaTeX forum ⇒ Graphics, Figures & TablesNo Graphics Extension recognized Topic is solved

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

No Graphics Extension recognized

Postby nicoo » Mon Oct 21, 2013 7:12 pm

Hello all!

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

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

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.


User avatar
Site Moderator
Posts: 4163
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Oct 21, 2013 7:21 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
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

User avatar
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Mon Oct 21, 2013 7:28 pm

Johannes' assumption is correct. And the error message also indicates the reason.
  1. ! 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.

LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes

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

Posts: 4
Joined: Thu Jul 28, 2011 6:22 pm

Postby nicoo » Mon Oct 21, 2013 7:29 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!

Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 3 guests