Various pieces of software and techniques exist for using TEX
to put labels onto included graphics.
All have significant draw-backs or short-comings.
One method that is widely used, and often recommended as best
for Encapsulated POSTSCRIPT
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 draw-backs of this technique are:
However there is a further 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 Encapsulated POSTSCRIPT
file needs to be edited, or regenerated in the same way
as was done originally. This may no longer be possible--the
software that created it may not be available or the expertise to use it
may have been lost, due to the original operator being no longer around
(having graduated or taken another job).
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 the TUG'97 meeting, described in [3] and is available on the Web. Here the idea is to create a coordinate system specially tailored to the size of the imported image, then to anchor labels to appropriate places using these coordinates. This effectively creates an overlay which allows the labels to seem to be part of the image, when in actual fact the labels have been typeset by TEX. WARMreader takes this idea a step further, by automating the process to the extent that a user does not have to be concerned with the actual coordinates, when specifying the labels within the TEX or LATEX document.
These methods can be used on any computing platform.
Since the styles and content of the labels are specified within the
TEX or LATEX source, there is no need to alter any Encapsulated POSTSCRIPT
files.
Furthermore, these techniques can be used 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,
containing information in an appropriate form.
For LATEX, the PSfrag package, as described in The LATEX Graphics Companion[1, pp.460-462],
provides similar functionality when using Encapsulated POSTSCRIPT
files,
by treating parts of the POSTSCRIPT file as tags,
to be later replaced by blocks of TEX-typeset material.
The 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''.
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.
Indeed 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 very 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 three steps: