2

I like to include an image with

\includegraphics[width=5cm]{./images/My_Image.svg.png}

where the image is an png file that had been converted with inkscape from an svg and therefor the filename-ending is .svg.png on linux.

Now pdflatex does not recognize it as an png

! LaTeX Error: Unknown graphics extension: .svg.png.

What can I do, besides renameming the file? Renaming does not work, because the files are needed in exacly that name from somewhere else, my last idea would be to use symlinks, but I would prefer a "latex-only" solution

  • Try this \includegraphics[width=5cm]{./images/My_Image} and let latex figure it out. I agree that it would be nice to have a way to force a format, e.g. \includegraphics[format=png, ...]{...} but I don't know how to do it. – alfC Aug 03 '14 at 07:15
  • thanks, I tried but it didn't work: it says "file not found" (even there is one .svg and one .svg.png - looks like it only searches for one dot) and extension letters without more dots – user2567875 Aug 03 '14 at 07:18
  • I see. I was always puzzled about how latex handles extensions, for example a similar problem is http://tex.stackexchange.com/questions/24773/how-to-avoid-automatic-tex-extension-in-filenames – alfC Aug 03 '14 at 07:20
  • Try loading package grffile: the standard LaTeX routine is designed around files with a standard <filename>.<extension> format with one .; grffile extends the code to cover multiple . chars in the name. – Joseph Wright Aug 03 '14 at 07:43
  • Thanks Joseph: your hint worked very well, I would mark this as the accepted answer if possible; Werner: you're right, didnt find it while searching, it looks like there are several ways to solve it, thanks! – user2567875 Aug 03 '14 at 08:12

0 Answers0