The previous example shows how labels can be accurately positioned, using the locations of the marked points of the first example. The marked points are away from ``busy'' parts of the graphic. They indicate where labels can be placed near to that part of the image being labelled, but not interfere unduly with other parts of the image.
While this is an intuitive strategy for selecting places to be marked, it can mean that adjustments, by ``nudging'', are required to position the labels to best effect. Some trial-and-error is usually required before finalising the positions of all labels by choosing the best <factor>s.
\WARMprocessEPS{Fig5.4.1}{eps}{bb2}
\renewcommand{\labelmathstyle}{\scriptstyle}
\renewcommand{\labeltextstyle}{\footnotesize}
\begin{xy}
\xyMarkedImport{}
\xyShowMarkPoints{*++[red][F-:red]@{*}}{-}
\xyMarkedMath +!DR{1}
\xyMarkedMath +++!D{2}
\xyMarkedMath +!U{3}
\xyMarkedTxt +!DL{4}
\xyMarkedMath +!L{5}
\xyMarkedMath +!UR{6}
\xyMarkedMath +!DL{7}
\end{xy}
When the marked points are chosen this way, the labels can usually be well-positioned by specifying just margins, and an edge or corner to be where the reference point of the label should occur. There is little need for delicate ``nudging'' and <factor>s.
On the other hand, extreme accuracy is not at all necessary when choosing positions for the marked points. Indeed the .bb files for all the examples in this paper were generated using low-resolution preview images. In practice these are not accurately scaled-down versions of the higher resolution images rendered by POSTSCRIPT. The resulting inaccuracies can be accommodated using XY-pic adjustments.
Another significant advantage of this strategy becomes apparent when the image or labels need to be resized or restyled, perhaps for use in a different context. This will almost certainly change the relative size of the labels and the image. Smaller-sized labels remain anchored to places near to what they refer. On the other hand, relatively larger labels can have been anchored so as to expand over portions of the image that are otherwise empty. In either case there may be no need to make any adjustments to the coding of labels.
\WARMprocessEPS{Fig5.4.1}{eps}{bb2}
\renewcommand{\labelmathstyle}{\displaystyle}
\renewcommand{\labeltextstyle}
{\large\bfseries\sffamily}
\begin{xy}
\xyMarkedImport{}
...
... (same as previous) ...
...
\end{xy}
Although the above examples have used LATEX, the WARMreader macros work equally well with Plain-TEX, and most other formats, as does XY-pic. The only requirement is to be able to import the graphic, and customise the expansion of a single macro, \xyWARMinclude, to suit. This macro takes as argument the name of the image file. As a practical default, it expects to be able to use the \includegraphics command from LATEX's graphics package; e.g.
\def\xyWARMinclude#1{\includegraphics{#1}}
This definition can be overridden, by replacing the \includegraphics with \psfig or \epsfig or \epsfbox or whatever other command the user chooses, for placing imported graphics within the TEX or LATEX document.
There must be just a single argument for the filename.
The result should be an \hbox of exactly the size required
for the image to occupy. (This is so that
\xyWARMinclude{<filename>} can be used
as the argument to an \xyimport command.)
Note that some macros for including graphics are not suitable. For example, the \centerpicture macro from TEXTURES' picmacs.sty file cannot be used, since it puts stretchable `glue' to span the whole page-width; whereas \picture from the same file can be used.
The requirements stated in the previous subsection allow scaling, rotating and resizing of imported graphics. For example, a rescaling can be achieved using LATEX as follows:
\newcommand{\scaledfig}[2]
{\scalebox{#1}{\includegraphics{#2}}}
\renewcommand{\xyWARMinclude}[1]
{\scaledfig{.7}{#1}}
It is only the image which is resized or rescaled;
the size and style of labels is controlled independently,
as discussed
sizstyle.
When different images require different scale-factors,
then the definition of \scaledfig belongs in the document preamble,
and a re-definition of \xyWARMinclude
should precede a figure, if needed. (See
a later figure
for an example.)
Optional arguments to \includegraphics, or other command,
can be incorporated in a similar way.