1

I want to include an eps figure whose filename contains more than a dot. As discussed here one should insert { } in the filename without the extension. However, pdflatex still complains that it does not recognize the file type.

Source of a minimal example:

\documentclass [a4paper, 12pt]{article}
\usepackage{graphicx}

\begin{document}
\includegraphics{{test.0}.eps}
\end{document}

Using pdflatex I get

! LaTeX Error: Unknown graphics extension: .0.eps.

Using the suggestions of this answer

\documentclass [a4paper, 12pt]{article}
\usepackage{graphicx}

\begin{document}
\includegraphics[type=eps,ext=.0.eps,read=.0.eps]{test}
\end{document}

remove the error. However, pdflatex produces a pdf with an empty box.

pdflatex --version gives

pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019/Arch Linux)
kpathsea version 6.3.1

My grffile.sty has

Version: 2017/06/30 v1.18
cesco
  • 165
  • 1
    with current releases it should just work without any {} (the pdftex version isn't important, the ltex and graphics versions would b. on older releases use the grffile package (which does nothing in current releases so it soesn't hurt to load that anyway) – David Carlisle Feb 01 '20 at 08:37
  • @DavidCarlisle \includegraphics{test.0.eps} gives the same error Unknown graphics extension: .0.eps – cesco Feb 01 '20 at 08:39
  • then you have an old release but as I say grffile package should make it parse that as extension .eps – David Carlisle Feb 01 '20 at 08:40
  • @DavidCarlisle my grffile is from 2017, see updated question – cesco Feb 01 '20 at 08:44
  • 1
    the version of grffile is irrelevant to the example posted that does not use it, but an up to date texlive 2019 should have \ProvidesPackage{grffile}% [2019/11/11 v2.1 Extended file name support for graphics (legacy)] – David Carlisle Feb 01 '20 at 08:56
  • 2
    in any case, since pdflatex can not include eps, it is simpler to convert it to pdf with a command such as epstopdf test0.eps and then use the pdf file with \includegraphics – David Carlisle Feb 01 '20 at 08:58

0 Answers0