next up previous
Next: Detailed Example with Marked Up: Convenient Labelling of Graphics, Previous: Convenient Labelling of Graphics,

Introduction

Various pieces of software and techniques exist for using TEX to put labels onto included graphics. All have significant drawbacks or shortcomings. One method that is widely used, and often recommended as best for Encapsulated POSTSCRIPT \ensuremath{^{\mbox{\tiny\textregistered}}}(EPS) files, is to first Typeset the label using TEXTURES on a Macintosh, Copy the resulting typeset window, then Paste the clipboard contents into the image file, having been opened within Adobe's Illustrator application. Among the drawbacks of this technique are: Depending upon the working enviroment, these may not be problems at all; for example, a prepress house would be expected to have the appropriate hardware and software. Similarly an academic may have made the investment to be able to follow this strategy.

However, there is a problem which may cause great difficulties when a manuscript is submitted for publication. Suppose a labelled image needs to be resized or the labels need to be changed for some reason; e.g. the text style chosen does not blend well with the fonts and styles used elsewhere in the publication. Now the EPS file needs to be edited or regenerated in the same way as was done originally. This may no longer be possible--the software used to create it may not be available or the expertise to use it may have been lost.

The WARMreader solution is to use TEX itself, or LATEX, for placing the labels. It uses the XY-pic diagram macros, extending the methods presented at TUG'97[3], and available on the Web. The idea is to create a coordinate system tailored for the size of the imported image, anchoring labels at appropriate places using these coordinates. This effectively creates an overlay which allows the labels to seem to be part of the image, when in fact they have been typeset by TEX. WARMreader takes this further, by automating the process so that a user does not have to be concerned with coordinates when specifying the labels. Since the styles and content of the labels are specified within the TEX or LATEX source, there is no need to alter any EPS files. Furthermore, this can be done for graphics of any format that can be included within a TEX document, by whatever means. The only requirement is the ability to create a .bb file,1containing information in an appropriate form.

For LATEX, the PSfrag package, as described in The LATEX Graphics Companion [1, pp.460-462], provides similar functionality for EPS files, by treating parts of the file as tags to be later replaced by blocks of TEX-typeset material. This technique has several limitations, apart from being available only for LATEX, and not usable with graphics formats other than POSTSCRIPT. For best results, the POSTSCRIPT file ``should ideally be designed with PSfrag in mind'', and for systematic use, it ``requires a good understanding of both the POSTSCRIPT language and the application generating the figures''[1, p.462]. This is because the replacement portions effectively become part of the POSTSCRIPT graphic at the point where the tags occur, so are subject to, and must dovetail with, the POSTSCRIPT graphics state at those places. As this includes color, size, rotation and cropping-region, great care is required to avoid later parts of the graphic obscuring earlier labels or labels being cut off at edges of the graphic. It is not possible to know exactly how the whole thing will appear until the .dvi file has been processed with a POSTSCRIPT-aware viewer or printer, thus making it tedious to fine-tune the placement of labels.

With WARMreader, the labels can be regarded as occurring within a separate layer, controlled completely from within TEX or LATEX. Any graphic from any source, in any format that can be handled by the TEX installation, can be used as a ``backdrop'', provided that a suitable .bb file has been prepared. Each of the following three steps can be done quite independently; e.g. by different people using different software or techniques:

  1. construction of the graphic
  2. make a .bb file, perhaps with text for labels
  3. preparation of code for processing labels within the TEX document
Only the last requires knowledge of TEX or LATEX, though this is desirable if labels are to be completely specified in the .bb file. Indeed it will become apparent below that the greatest control over the final appearance, hence the best results, are obtained when these three tasks are kept completely separate.



Footnotes

... file,1
Such files are used with LATEX's \DeclareGraphicsRule [1, pp.40-41] for holding just the bounding-box information, since this is all that is needed for TEX to leave sufficient space for an image.

next up previous
Next: Detailed Example with Marked Up: Convenient Labelling of Graphics, Previous: Convenient Labelling of Graphics,
Ross Moore 1999-07-30