Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allowing includegraphics in LaTeX to include files with arbitrary filenames

Tags:

latex

I have some graphic files with some rather long filenames which includes several periods. includegraphics interprets the first of these as the beginning of the file extension, which makes it impossible for it to guess the proper graphics extension. A typical error message is

LaTeX Error: Unknown graphics extension: .9332.1dwc_kpl_h.log.png

One solution is to rename all files, but they are generated by another program, and I would rather use the naming scheme from there. Is there a way to tell graphics what the image format is, such that the extension will be ignored?

like image 591
Thomas Avatar asked Dec 03 '10 09:12

Thomas


2 Answers

You can also hide the dots from LaTeX by putting extra curly braces in:

\includegraphics{{my.file.with.dots.in.it}.png}

(from https://tex.stackexchange.com/questions/10574/includegraphics-dots-in-filename)

like image 193
keflavich Avatar answered Nov 15 '22 17:11

keflavich


Use the grffile package.

like image 24
Philipp Avatar answered Nov 15 '22 18:11

Philipp