Thomas
Thomas

Reputation: 2849

Allowing includegraphics in LaTeX to include files with arbitrary filenames

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?

Upvotes: 20

Views: 10628

Answers (2)

keflavich
keflavich

Reputation: 19215

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)

Upvotes: 24

Philipp
Philipp

Reputation: 49842

Use the grffile package.

Upvotes: 7

Related Questions