TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am not sure this has been asked before, but I couldn't find it and I am hoping to get a solution or at least a good explanation of why this is a bad idea. (there are questions about using underscore or spaces, but as far as I can tell nothing about full stops).

I started using full stops to replace spaces in file names but LaTeX does not seem to accept this. For example, when I name the figure figSE.pdf the code compiles fine, but if I name it instead fig.SE.pdf I get the error message

ERROR: LaTeX Error: Unknown graphics extension: .SE.pdf.

I know I can just rename the file, but I quite like my new system and if there is a way to make LaTeX accept it I would prefer (and I don't want to use hyphens nor underscores).

Here is a MWE





And an example of a figure can be found here: http://dl.getdropbox.com/u/1885087/fig.SE.pdf

share|improve this question
up vote 10 down vote accepted

First things first:
You don't have to include any graphicx extension.


works, too.

Now, LaTeX uses the first period to find out what extension you're using, but you can hide that:


or even:

share|improve this answer
I should have known this. I feel embarrassed now. – Vivi Oct 8 '12 at 1:19
@Vivi Ah, no problem. LaTeX 101: If something fails, add a pair of braces. :) By the way, there is a 1 included in your graphic. – Qrrbrbirlbel Oct 8 '12 at 1:26
I don't understand what you mean by "there is a 1 included in your graphic" – Vivi Oct 8 '12 at 1:30
@Vivi In your fig.SE.pdf is the digit “1” embedded in the graph (at around (1977 | –0.02)). – Qrrbrbirlbel Oct 8 '12 at 1:33
I hadn't seen that! Thanks! This figure was generated by tikzDevice in R, and either the code came with the 1 or I accidentally put it there when handling the file. In any case, I plan on getting a much better version, probably by writing the tikz file myself, at a later stage. This is more like a place holder at the moment. – Vivi Oct 8 '12 at 2:18

Use braces like \includegraphics{{fig.SE}.pdf}. This method works even if you have space like \includegraphics{{fig SE}.pdf}.

Another way of including graphics files with spaces is to use the package grffile. Simply put


in your preamble.



    \includegraphics{fig SE.pdf}

share|improve this answer
Great! Your answer has some very useful points, but since Qrrbrbirlbel answered it first I am accepting his answer (as both answer my question). – Vivi Oct 8 '12 at 1:21

Package grffile adds support for multiple dots to graphics file names:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.