In LyX 2.1 I added some graphics (jpeg) to my paper by using a floating figure.
In the LaTeX source code, this is:
\begin{figure}[H]
\includegraphics[scale=0.6]{\string"blank billard 7\string".eps}\caption{A Billiard table $B_{\alpha}$ with a barrier of length $\alpha$.}
\end{figure}
but it gives this error:
! LaTeX Error: Unknown graphics extension: .eps.
l.191 ...0.6]{\string"blank billard 7\string".eps}
\caption{A Billiard table ...
I am not sure where the .eps is coming from since I added the graphic in the form of a jpeg.
How can I fix this?
Update:
%% LyX 2.1.4 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english,reqno]{amsart}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{float}
\usepackage{amsthm}
\usepackage{graphicx}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\numberwithin{figure}{section}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\makeatletter
\renewcommand{\section}{%
\@startsection{section}
{1}
\z@
{1\baselineskip plus \baselineskip}
{-1em}
{\normalfont\bfseries}% \scshape
}
\makeatother
\makeatletter
\usepackage{etoolbox}
\patchcmd{\@maketitle}% <cmd>
{\ifx\@empty\@dedicatory}% <search>
{\smallskip
\begin{center}
\footnotesize% Size of the address content
\begin{tabular}{c}
University of \\
Department of \\
440 \\
USA
\end{tabular}
\end{center}
\ifx\@empty\@dedicatory}% <replace>
{}{}% <success><failure>
\makeatother
\raggedbottom
\allowdisplaybreaks
\makeatother
\usepackage{babel}
\begin{document}
.
\begin{figure}[H]
\includegraphics[scale=0.6]{\string"blank billard 7\string".eps}\caption{A Billiard table $B_{\alpha}$ with a barrier of length $\alpha$.}
\end{figure}
\end{document}
Best Answer
Not really an answer why it does not work for you, but much to long for a comment …
Try the following:
lyxtest
.example-image.jpg
to that new folder or directory.File
→New
(or press Ctrl-N)File
→Save as
to save the new file aslyxtest.lyx
in the folder generated in the first step.Insert
→Graphics
, select the fileexample-image.jpg
and pressOK
.File
→Save
If you now open
lyxtest.lyx
in a standard text editor it should look similar to (note, this has been made using LyX 2.2.1 not LyX 2.1.1):Document
→View [PDF (pdflatex)]
You should get something like:
If this was successful, inserting of JPEG does work. Let's start again with insertion of an EPS:
lyxtesteps
.File
→New
(or press Ctrl-N)File
→Save as
to save the new file aslyxtesteps.lyx
in the folderlyxtesteps
generated in the first step.Insert
→Graphics
, select the fileexample-image.eps
and pressOK
.File
→Save
If you now compare
lyxtest.lyx
andlyxtesteps.lyx
you will find, that it differs only in line:vs.
Document
→View [PDF (pdflatex)]
.You will see the same result as above. But if you have a look at the temporary directory used by LyX (you can find the location of the directory in
Tools
→Preferences…
→Paths
, open it with a file manager and look for a folder withlyx
in its name) you will find there not only*example-image.eps
but also*example-image.pdf
. And thelyxtesteps.tex
in the temporary directory will look like:So indeed LyX has converted the
eps
file into apdf
file.Do one last step:
File
→Export
→LaTeX (pdflatex)
This would create the file
lyxtesteps.tex
in the directorylyxtesteps
of the first step in this session. It should look like:And you will find also the new file
example-image.pdf
in the same directory. Now you can runpdflatex
forlyxtesteps.tex
and would also get the result:Note: If you use a new LyX you can even copy the LyX file shown above into a text editor (e.g.
vi
,kate
,texmaker
), save it aslyxtest.lyx
and open this file with LyX. But I do not know whether or not LyX 2.1.1 can open a file from LyX 2.2.1. Nevertheless, you can do the steps with your LyX and add the result into your question if it is not successful. You even can export a TeX file, see if this also creates a PDF from an imported EPS and show use the TeX file in your question.