Next: B. Command Lines   Previous: 9 Graphics With Frills


A. EPS Graphics

In this Appendix we will outline the method for including graphics in encapsulated postscript format (EPS); the advantages and disadvantages of the method were outlined in Section 2.

 

A..1 Installing a Dummy EPS Printer

As many Windows applications can't save to EPS format, one has to generate EPS files by installing a dummy EPS printer and printing to a file.

 

Installation

The steps necessary to install the printer in Windows 98 are as follows:
  1. Open the printers folder in Control Panel and double click `add printer'.
  2. Select `Local Printer'.
  3. More or less any type of postscript printer will do, though if you want colour graphics you will need to choose a colour printer. In this case we will choose manufacturer `HP', and model `HP Color LaserJet PS'. If this model is not available select something similar. Note that you may need your Windows 98 CD for this operation.
  4. Select `FILE:' as the port.
  5. Call the printer what you like, don't make it the default printer, and don't print a test page.

 

Configuration

Before we can generate EPS files, we need to configure the printer:
  1. Back in the printers folder right-click on the printer you just installed and select `Properties'.
  2. On the `PostScript' tab of the dialog box, set `PostScript output format' to `Encapsulated PostScript EPS'. This is essential.
  3. On the `Advanced' dialog, you may want to deselect the sending of any ctrl-D's.

 


A..2 Generating EPS Output

The instructions here are specific to graphics generated with Microsoft Powerpoint, but the procedure is similar in other Windows applications.

 

Printing to a File

  1. Select the slide you want to print.
  2. Do `File/Print', and select the printer you just installed and `current slide' -- unfortunately it is necessary to print each slide separately.
  3. You will be prompted for a file name. Select `All files (*.*)' for the `Save as type', and then select a directory and type a filename with a .eps extension.

 

Tweaking with GhostView

If you find that either DVIPDFM or LATEX2HTML / NETPBM mess up the graphic (e.g. truncate a landscape graphic or mess up the border of the graphic), you can try using the Ghostscript Viewer (`GSVIEW32.exe'), which is available from Aladdin.com, to generate the .eps fle in a slightly different way.

The following instructions are specific to Powerpoint and verson 3.4 of GSVIEW32.exe:

 

  1. Install the dummy postscript printer as before, but this time on the `PostScript' tab of the properties dialog box set the `PostScript output format' to `Postscript (optimize for portability - ADSC)';
  2. Follow the instructions given above for printing the Powerpoint slide, but this time save the file with the extension `.ps'. (Note that although with .ps format one could print all slides at once, it is still necessary to print them one at a time in order for Ghostscript to convert them.)
  3. Open the .ps file in the Ghostscript Viewer;
  4. Select `File/PS to EPS' and make sure that `automatically calculate bounding box' is selected;
  5. You'll then be asked for an output filename, which can be anything with a .eps extension.

Experience has shown that the new .eps file will work properly, if you include it in you LATEX document using the instructions that follow in the next section (including rotating and trimming of landscape graphics as necessary.)

 

A..3 Including the EPS Graphic

Basics

Suppose that the full path to the .eps file is in c:\tex\graphics\graph.eps. Then with the document preamble as in Section 4, to include the graphic use:
\includegraphics{c:/tex/graphics/graph.eps}

This code will include the graphic in both the HTML and PDF documents. You should also be able to preview it in YAP. Note that:

  • We have given the full path. This is because the various converters called by LATEX2HTML can't find the file otherwise.
  • We have used forward-slashes (/) rather than back-slashes (\) in the pathname.
  • You still have to comment out the \usepackage{dvipdfm} and re-run LATEX before running LATEX2HTML. See Section 3.1

If you tweaked a landscape graphic with Ghostview as described in Section A.2, you may need to rotate or trim the image. A suitable command might be:

\includegraphics[scale=0.35,angle=270,trim=-40 -40 -40 -40]
  {c:/tex/graphics/graph.eps}

 

Frills

Many of the techniques used with \includegraphics in Section 9 work in this context also. Further, the good thing about this method is that the single command deals with the PDF and DVI and HTML versions together.

Note that it is worth checking the LATEX2HTML manual for more options for the \htmlimage command, which is very useful in this way of doing things.

For example, here is the full source for a document containing the image graph.eps, reduced by 50%, and placed in a boxed figure with a caption and ALT text:

\documentclass[12pt,a4paper,dvipdfm]{article}
\usepackage[dvips]{graphicx}
\usepackage[usenames,dvipsnames]{color} 
\usepackage{html}
% Comment the next line out 
% and re-run LaTeX before running LaTeX2HTML
\usepackage[dvipdfm,latex2html]{hyperref}
%
\begin{document}
\begin{figure}
\centering
\htmlimage{alt="This is ALT text"}
\fbox{\includegraphics[scale=0.5]{c:/tex/graphics/graph.eps}}
\caption{A scaled EPS image in a box}
\end{figure}
\end{document}


Back Home Up Next




© Charles Clayton 2000. Please use this information at your own risk.

 

 

Hit Counter