www.delorie.com/gnu/docs/hp2xx/hp2xxinf_21.html   search  
 
Buy GNU books!


HP2XX, A HP-GL Converter

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.7 TeX formats

This section is a bit historic now, as one can easily embed `eps' graphics in LaTeX and preview the result with xdvi et al. nowadays. I have left it in for the sake of completeness, and for special cases where one might still prefer plain TeX or one of the classical import methods.

TeX was designed for typesetting, not for handling graphics. Putting graphics directly into TeX therefore is always somewhat clumsy. hp2xx offers four different compromises to do that, and much better, though more indirect ways.

`-m mf' generates Metafont source code. Run Metafont and gftopk, and you'll end up with a special pk font containing the single letter Z which represents your picture. Placing this Z somewhere in your document using standard TeX commands draws your picture there.

If you want to avoid fiddling with additional programs and fonts, if you work with LaTeX, and if you do not need high-quality plots, the macros within epic.sty may help you. `-m tex' causes hp2xx to generate appropriate TeX source code which you can `\input{}' into LaTeX sources.

For emTeX users, there are yet another two way: `-m em' creates TeX code containing many commands like `\special{em:...}' for line drawing. The line drawing task will therefore be handled not by TeX itself but by the emTeX drivers which can handle arbitrary line slopes etc. Similarly, `-m cad' produces code based on the same principle, but compatible with program `TeXcad.exe', which is distributed as a part of emTeX, and which offers editing and drawing features for the desired HP-GL figure(s).

Please note that all methods for generation of graphics within TeX are compromises which usually work only for simple graphics. You'll probably prefer using external methods like including EPS vector graphics files with Tom Rokicki's dvips driver, or PCX files via the emTeX drivers, or you'll generate special fonts with convenient programs like F. Sowa's bm2font. hp2xx can help you in all of these cases. The following table shows the pros and cons of the various approaches (all are based on PD software):

 
Internal methods (all allowing DVI previewing of graphs):

via Metafont
  +: Machine-independent; fully compatible with TeX
  -: Slow; capacity problems with Metafont / gftopk / some DVI drivers
            if used with large and/or complex graphics

via epic.sty
  +: Machine-independent; single-step, native LaTeX approach; PD software
  -: Slow; requires LaTeX; low-quality lines; just one line thickness;
            complex graphs may exceed TeX capacity

via emTeX's \special{em:...}
  +: No TeX capacity problem; good line quality; single-step procedure;
            rasterization on demand, giving optimal resolution
  -: Slows down drivers; driver capacity may be exceeded; emTeX required


External methods:

via PCX file inclusion:
  +: Easy and fast; DVI preview of graphics
  -: Requires emTeX drivers (only available on DOS and OS/2)

via special fonts:
  +: Easy, fast, and trouble-free font generation via bm2font;
            DVI preview of graphics (!); portable
  -: Many files for fonts etc.; confusing for novices

via EPS:
  +: High-quality results; easy; no burden for TeX or drivers
  -: No DVI preview (unless ghostscript is available); PostScript 
	    printer (or, e.g., GhostScript) required;
            PostScript previewing is slower than pure DVI previewing.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 2003   by The Free Software Foundation     Updated Jun 2003