GeneralIncluding *.eps figure in Latex

LaTeX specific issues not fitting into one of the other forums of this category.
pavel81
Posts: 3
Joined: Sat Aug 23, 2008 9:59 pm

Including *.eps figure in Latex

Post by pavel81 »

Hi,
I need to include a *.eps figure in Latex. I am using the following code:

\begin{figure}[ht]
\centering
\includegraphics[type=eps, read=.eps, width=0.5\textwidth]{LBP_4si.eps}
\caption{abcdefg}
\label{fig:comparisondiagram}
\end{figure}

I have also used \usepackage{graphicx} in the header.

I am getting a blank space for the figure in my output page. but it doesn't show the figure. I have tried to do this with
Latex => PDF
Latex=> PS
Latex=>DVI format.

But got no result in any format. Hope to get some useful tips. Thanks a lot.

BR,
Pavel

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Re: Including *.eps figure in Latex

Post by Stefan Kottwitz »

Hi Pavel,

welcome to the board!
Do you get any warnings?
Check if you used the draft option for graphicx or for your document class.

Stefan
LaTeX.org admin
Veeral
Posts: 8
Joined: Wed Aug 27, 2008 12:00 pm

Re: Including *.eps figure in Latex

Post by Veeral »

Hi,

Even I am encountering similar problem. For me I feel its something to do with my software TeXnic Center, as I had other sample LaTex files and for them also it in not compiling the figures in the file. I am using standard output as PDF, although I tried with PS and DVI too.

Thanks
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Re: Including *.eps figure in Latex

Post by Stefan Kottwitz »

Hi Veeral,

welcome to the board!
What code do you write to include the figure? What format does it have?
Perhaps post your logfile as attachment here, we could try to find the cause by reading it.

Stefan
LaTeX.org admin
Veeral
Posts: 8
Joined: Wed Aug 27, 2008 12:00 pm

Re: Including *.eps figure in Latex

Post by Veeral »

Thanks Stefan

This one is by all the ones used in the example I am using
\begin{figure}[h]
\centering
\epsfig {file = graphruin.eps}
\label{Risk Process}
\caption{Risk Process}
\end{figure}

I tried this one generated by TC
\begin{figure}
\centering
\includegraphics{graphruin.eps}
\caption{Classical Risk Process}
\label{fig:Risk Process}
\end{figure}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Including *.eps figure in Latex

Post by Stefan Kottwitz »

Hi Veeral,

I don't use the old epsfig package, I recommend graphicx instead, with \includegraphics like in your second try. The second code snippet looks well. Don't forget

Code: Select all

\usepackage{graphicx}
in your preamble. Do yo get an error message? Could you post the logfile as attachment? Messages, warnings and errors listed in the logfile may help to solve this problem.

Stefan
LaTeX.org admin
Veeral
Posts: 8
Joined: Wed Aug 27, 2008 12:00 pm

Including *.eps figure in Latex

Post by Veeral »

Hi attaching the log file. There are many other errors. Some of which if I remove, it does not give me a proper output. And I think this is the one right now with which we are working.
! LaTeX Error: Unknown graphics extension: .eps.

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

l.59 \includegraphics{graphruin.eps}

Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.

[3]
Attachments
thesis.log
(18.51 KiB) Downloaded 596 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Re: Including *.eps figure in Latex

Post by Stefan Kottwitz »

Hi Veeral,

pdflatex does not support eps files, that means the output profile LaTeX => PDF is not the right choice. The logfile was produced by pdflatex, that cannot work (only if you convert graphruin.eps to graphruin.pdf using epstopdf or similar tool).
You said you've tried LaTeX => PS => PDF or similar, producing dvi and ps, please show the logfile corresponding to that compilation.

Stefan
LaTeX.org admin
Veeral
Posts: 8
Joined: Wed Aug 27, 2008 12:00 pm

Including *.eps figure in Latex

Post by Veeral »

Thanks a ton Stefan,

In DVI and PS it seems to be working. I think its the change you suggested seems to be working.

Code: Select all

I recommend graphicx instead, with \includegraphics like in your second try. The second code snippet looks well. Don't forget
Code:
\usepackage{graphicx}

Still attaching a similar log file (its not the same but images didnt come up in this one also) just in case if that helps you.
Attachments
Thesis.log
(7.74 KiB) Downloaded 574 times
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Including *.eps figure in Latex

Post by localghost »

Veeral wrote:[...] Still attaching a similar log file (its not the same but images didnt come up in this one also) just in case if that helps you.
You still have invalid code in your document which causes an error. The message is very specific.

Code: Select all

 Section 2.2.
! Undefined control sequence.
l.319 \epsfig
             {file=mapping.eps,width=5.0in}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
Use only the graphicx package with corresponding commands as Stefan already stated and omit the suffix (.eps). In case of further problems provide a minimal working example (MWE) and attach an EPS file if necessary.


Best regards
Thorsten¹
Post Reply