5

I'm trying to insert a .eps figure into my document. I'm using LuaLaTeX. I have already tried to remove the ".eps" extension from the \includegraphics{} command, but it didn't work. Makes no difference (do not compile) It always says the error:

Unknown graphics extension: .eps

I also tried the package epstopdf, but that didn't work either. It shows the error:

Package pdftex.def error: File 'fig/VocSOCGeneric-eps-converted-to-.pdf not f [I think it is "not found"].

In the path "fig/" no pdf is created (and no pdf is created in the project directory also). I also tried to insert the -shell-escape and --enable-write18 commands, but unsuccessfully.

It seems that all alternatives from converting eps to pdf are only suitable for pdfLaTeX, and not for LuaLaTex. Also, there is almost no documentation about eps figures AND LuaLaTeX, leading me to think that LuaLaTeX should deal naturally with eps graphics. But I don't know how!

Code example below.

\documentclass[addressstd,a4paper,10pt]{report}

\NeedsTeXFormat{LaTeX2e}
\RequirePackage[2015/01/01]{latexrelease}

\RequirePackage{fix-cm}

\RequirePackage{tabularx}
\RequirePackage{url}

\RequirePackage{amsmath}
\RequirePackage{unicode-math}

\RequirePackage{luatextra}
\RequirePackage{fontspec}
\RequirePackage{lmodern}

\RequirePackage{graphicx}
\RequirePackage{caption}
\RequirePackage{chngcntr}

%\RequirePackage{epstopdf}

\counterwithout{figure}{chapter}
\renewcommand{\thefigure}{\arabic{figure}}
\renewcommand{\figurename}{Figura}

\captionsetup[figure]{labelsep=endash,         justification=justified,singlelinecheck=false,format=hang}

\begin{document}

    Text before

    \begin{figure}[h!]
    \centering
    \caption{Curva Característica Voc SOC de uma bateria Li-ion NCA.}
    \includegraphics[scale=1]{fig/VocSOCGeneric.eps}
    \label{fig:cap1VocSOC}
    \end{figure}

    Text after

\end{document}

marked as duplicate by Martin Schröder, egreg errors Jan 3 '16 at 16:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • PDF images work! Only EPS don't work! – Chrystian Dec 30 '15 at 20:44
  • 1
    Remove the .eps extension in your \includegraphics lines – Joseph Wright Dec 30 '15 at 20:53
  • 1
    epstopdf works fine with lualatex, but if you have miktex you must call lualatex with --shell-escape as shell-restricted is not activated see sourceforge.net/p/miktex/bugs/2415 – Ulrike Fischer Dec 30 '15 at 21:02
  • @JosephWright I have already tried removing .eps extension from the comand \includegraphics. Doesn't work – Chrystian Dec 30 '15 at 21:44
  • @UlrikeFischer I tried the --shell-escape option before, but it didn't work. But now that you told about that, I looked again in some foruns and realized that the problem was the position of the command --shell-escape in the line. I will publish in the answer. – Chrystian Dec 30 '15 at 21:48
5

I made it work. And the answer is simple. As --shell-escape is an option, it should be placed before the .tex (%wm). My problem was that I was placing it after the .tex. These examples can explain better:

This one worked:

-synctex=-1 -max-print-line=120 -interaction=nonstopmode --shell-escape "%wm"

This one was not working before:

-synctex=-1 -max-print-line=120 -interaction=nonstopmode "%wm" --shell-escape 

Thanks to UlrikeFischer, I had this idea after your comment.

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