4

I'm trying to include .eps figures in my .tex file (I'm using MiKTeX 2.9). I need to include graphics in this particular way:

\usepackage{graphics} % or graphicx 
...

\begin{figure}
 \caption{\label{tha_label} ....}
 \includegraphics{the_graphics.eps}
 \end{figure}

But that way doesn't work, because it produces the error Unknown graphics extension: .eps. Of course, I can use \uspackage{eps-to-pdf} and include my graphics without errors, but I do not need to use that usepackage (the method above is only allowed). How can I do it?

Henri Menke
  • 109,596
user48115
  • 218
  • 1
    If you can't use epstopdf and must include eps-figures you can't use pdflatex but must compile with latex + dvips (or dvipdfmx) (or xelatex). – Ulrike Fischer Mar 17 '14 at 13:24
  • If the problem with eps-topdf is you can't run external processes then (a) delete the extension and just have \includegraphics{the_graphics.eps} (that is a good idea anyway) and then make a .pdf version of teh eps before running pdflatex ps2pdf the_graphics.eps then latex/dvips will use the .eps file and pdflatex will use the .pdf – David Carlisle Mar 17 '14 at 13:47
  • Not to forget: Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. But also a suggestion: Do us a favour and change your username to something more telling than "user1234". – Speravir Mar 18 '14 at 02:15

2 Answers2

2

Try using these commands in the cmd:

latex filename.tex
dvipdfm filename

I've compiled the codes

\documentclass{report}
\usepackage{graphics} % or graphicx 
\begin{document}
\begin{figure}
...
 \end{figure}
\end{document}

and they worked.

Torbjørn T.
  • 206,688
NguyenDV
  • 130
  • To add code highlighting as you can see from my edit, select the code and hit Ctrl + K, or click the button marked {} above the text field. – Torbjørn T. Mar 17 '14 at 14:08
2

You must …

… either compile your code in a mode, that produces DVI files and then further process the DVI file with dvips/dvipdfm/dvipdfmx (how it is done in Nguyen’s answer) or use XeLaTeX (produces interim XDVI files); VTeX seems also to be possible – cf. for this Heiko Oberdiek in Graphics file extensions and their order of inclusion when not specified – …

… or you use the package epstopdf (that’s actually the name, without dashes!). This works, when you load this after graphics/graphicx. See also my answer: Including pdf figures in Latex document using TexnicCenter (the question title is misleading here).

Speravir
  • 19,491