# Inserting an image in plain TeX

I used the OzTeX implementation of TeX, also I used to typeset my docs in plain TeX, not LaTeX for me, so I had no problem to insert an image using the OzTeX, now I'm back to TeX docs, am using the TeXWorks frontend, but I can't insert an `.eps` image file, it seems the `\includegraphics` macro its only for LaTeX, so I can't use it, any idea on how to insert an image when using plain TeX?

-
Welcome to TeX.sx! A tip: You can use backticks ``` to mark your inline code as I did in my edit. –  Joseph Wright Jul 18 '12 at 18:25
Thank you, I will use backticks in the future. :) –  Sergio Varela Jul 18 '12 at 18:35

By far the easiest approach here is to use `miniltx` to allow you to use LaTeX's `graphics` package with plain TeX:

``````\input miniltx %
\input graphicx.sty %
\includegraphics{<filename>}
\bye
``````

The only thing you will need to watch is that TeXworks is designed around a PDF-based workflow. Thus you will need to convert your `.eps` files to `.pdf` format using `epstopdf` and then use pdfTeX in TeXworks. (In LaTeX, there is now automatic conversion method from `.eps` to `.pdf` files, but this does not apply to plain TeX.)

-
Is there a difference between this and simply `\input graphicx.tex` (no `miniltx`)? –  Alan Munn Jul 18 '12 at 18:27
@AlanMunn I've simply gone with 'what I know'. A quick look at `graphicx.tex` shows it loads `miniltx`, adds a default driver line (`dvips`) and tidies up the catcode of `@` using `\resetatcatcode`. The last point might make it very slightly preferable, but it's not a bit difference. –  Joseph Wright Jul 18 '12 at 18:32

You can use the simple `epsf` package which is designed for plain TeX:

``````\input epsf
%optional \epsfxsize=dimen or \epsfysize=dimen
\epsfbox{filename.eps}
``````
-