4

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}
darthbith
  • 7,384
Chrystian
  • 101
  • 1
  • 4

1 Answers1

6

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.

ictl
  • 160
Chrystian
  • 101
  • 1
  • 4