[Tex/LaTex] Unknown graphics extension: .1.png

errorsgraphics

I have a file called xxxx_0.1.png, and want to import it as an image in my document. I am using graphicx with the following command:

\includegraphics[width=0.5\textwidth]{images/xxxx_0.1.png}

and LaTex gives me the error:

Unknown graphics extension: .1.png

Basically, it is treating everything after the first dot as the file type, rather than only the stuff after the last dot.

Other than the obvious solution (renaming the files so it only has one dot), does anyone know if there a way to get LaTex to play ball?

Best Answer

The LaTeX graphics/graphicx package uses the first dot to find the extension. Package grffile changes the algorithm to check for known extensions (option multidot, enabled by default):

\usepackage{graphicx}
\usepackage{grffile}