Graphics, Figures & TablesIncluding eps file using TexMaker

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
ynchoir
Posts: 6
Joined: Sat Aug 28, 2010 2:50 am

Including eps file using TexMaker

Post by ynchoir »

Hi,

I am a new user of TexMaker, using MikTex2.9 and TexMaker 4.4.1.
I have a question regarding the tex file I got from my coauthor.
When I run the tex file, it runs normally with no errors.
However, the eps file does not show up in the pdf output when I hit 'QuickBuild'.
Could you tell me where it went wrong?

I have been struggling for so long, and start to wish I had not left Scientific Workplace...

Code: Select all

\documentclass[12pt]{article}
\usepackage[display]{texpower}
\usepackage[landscape]{geometry}
\usepackage[scaled=0.92]{helvet}	% set Helvetica as the sans-serif font
\renewcommand{\rmdefault}{ptm}		% set Times as the default text font
\usepackage{fancybox}
\input seteps
\usepackage{longtable}
\usepackage{graphicx}
\begin{document}
> Here is the code to call the eps file. Of course, I save XXX.eps file in the same folder as the tex file.

\begin{center}
\seteps{0in}{8in}{3.5in}{XXX.eps}
\end{center}

> Finally, here is the 'seteps.tex'.

\def\seteps#1#2#3#4{\vskip#3\relax\noindent\hskip#1\relax
 \special{eps:#4 x=#2, y=#3}}
\def\centereps#1#2#3{\vskip#2\relax\centerline{\hbox to#1{\special
  {eps:#3 x=#1, y=#2}\hfil}}}

THANK YOU FOR YOUR HELP.
\end{document}
Last edited by Johannes_B on Thu Jan 22, 2015 12:00 am, edited 2 times in total.

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
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Including eps file using TexMaker

Post by Johannes_B »

Hi and welcome, without looking too closely at the code i would have said that you cannot run pdflatex cause it cannot work with eps. Looking closer at all this \specials i can tell you, that you cannot use pdflatex.
You have to go the classical route, compile to dvi, then compile to ps, then compile to pdf (i think texmaker can do all this for you with one click).

Is there a special reason why you guys are sticking with this bit complicated route?

Hint: Package graphicx can be used to include graphicx more easy into your document. Modern distributions like TeX Live (in a current version) can handle eps files with pdflatex. Well, to be honest, without you noticing it, the graphics are converted to pdf once and are then reused.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
ynchoir
Posts: 6
Joined: Sat Aug 28, 2010 2:50 am

Re: Including eps file using TexMaker

Post by ynchoir »

Thanks a lot, Johannes.

I guess I do not want to radically change the file, as the tex file produces pdf with graphics with no problem with my coauhtors environment. And simply running 'Dvi->PS', 'PS->PDF' does not seem to do the trick.

One specific question I had, after reading several related manuals, is why we do not need \includegraphics{} anywhere in the code? At first, I thought seteps.tex should be calling the XXX.eps graphics, but seteps.tex does not seem to have anything like that.

Best,
ynchoir
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Including eps file using TexMaker

Post by Johannes_B »

Yes, seteps does that. Using a mix of LaTeX, TeX and PostScript. To understand that, you have to read documentation that is still valid, but more than 20 years old.


Please ask your coworker for help, he has the experience with the setup, he might be able to help you setup everything.


My advice would be to switch to the way everybody uses graphics, using package graphicx, being around for twenty years.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

Re: Including eps file using TexMaker

Post by Stefan Kottwitz »

Perhaps support your coauthor in changing to a modern setup using pdfLaTeX, epstopdf and graphicx. Feel free to invite him or her to our forum, we gladly help. As you use a modern MiKTeX of the newest version, you could improve the code. We can work out all the details together. Perhaps ask your coauthor what he or she is using.

Stefan
LaTeX.org admin
Post Reply