2

I have a figure name "L=10_W=8.00.eps", I put it in the \figure environment by

\includegraphics{L=10_W=8.00.eps}

compile it with xelatex, but get error: File ended prematurely

After I renamed it to "L=10_W=8.eps", the error goes away.

David Carlisle
  • 757,742
Tim
  • 193
  • latex uses the file extension (by default) to determine the file type and .00.eps is an unknown filetype, see the graphicx package documentation for keys you can use to specify the filetype without having to parse the filename – David Carlisle Jun 26 '14 at 20:48
  • This question was tagged floats but is unrelated to floats (you would see the same wherever you used \includegraphics – David Carlisle Jun 26 '14 at 20:49
  • 2
    @olga.saucedo hm I suppose I should answer there, the question is duplicate but the mechanism built in to graphicx to deal with this isn't mentioned in the answers to the other question. – David Carlisle Jun 26 '14 at 21:06
  • as said in http://tex.stackexchange.com/questions/10574/includegraphics-dots-in-filename

    put the filename in {} is a simple solution.

    \includegraphics{{L=10_W=8.00}.eps}
    
    – Tim Jun 26 '14 at 21:15
  • @Tim It seems to work but by accident (as I can say with some certainty as it's my code:-) the {} hide the extension from the scanner but one would have expected them not to be dropped when referring to a file name, just as \input{{a.b}.tex} does not work. – David Carlisle Jun 26 '14 at 21:21

1 Answers1

6

This works for me, tell latex it is eps type and the extension to use for the file itself and to find the bounding box

\documentclass{article}

\usepackage{graphicx}

\begin{document}


\includegraphics[width=5cm,ext=.1.eps,type=eps,read=.1.eps]{example}

\end{document}

this includes example.1.eps using xelatex.

David Carlisle
  • 757,742