  %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %%
 %%%%%   LabelFig.tex FOR LABELLING FIGURE INSERTS %%%%%
  %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %%
 %%%  AUTHOR: Laurent Siebenmann
  %%    lcs@matups.matups.fr
  %%
 %%%  VERSION: July 1991
  %%
 %%%  PURPOSE:
  %%  Occasionally, figures imported into TeX lack some labels.
  %%  It may then be most convenient to use TeX to provide
  %%  the labels.  Several macro sets, notably the 
  %%  LaTeX picture environment, provide means to insert 
  %%  labels.  LabelFig.tex is a macro set 
  %%  offering labelling capability for other TeX formats such
  %%  as Plain and AmSTeX. Unlike most graphics tools it is fast
  %%  and small (costing about1 Ko of compiled memory
  %%  and 50 control sequences). Hopefully it will work in 
  %%  essentially all TeX environments.
  %%
 %%%  THE IDEA:
  %%  Nothing distinctly new here. 
  %%  Each label is located with respect
  %%  to a grid laid down on the figure --- as in LaTeX.
  %%  The device of using TeX to print the grid in proof versions
  %%  is not in LaTeX but has been since used by others.
  %%  Many thanks to to Raymond Seroul (Strassbourg) for
  %%  pointing it out to me back in 1989.  
  %%  (It was used in a Plain TeX hack of the picture  
  %%  environment by Desarmenien, Ostromoukhov, and Seroule,
  %%  which seems never to have been released.)
  %%
 %%%  POSTINGS : anonymous ftp
  %%  ---  ftp 28.146.7.200 (alias shape.mps.ohio-state.edu);
  %%  login: anonymous;  password: <anything>; 
  %%  directory pub/osutex
  %%  ---  ftp 130.84.128.100 (alias rsovax.circe.fr);
  %%  login: anonymous; password: <anything>; directory
  %%  [anonymous.siebenmann]
  %%
 %%%% DOCUMENTATION:
  %%  --- see Labelfig.doc 
  %% (may be included at end, after \endinput)
  %%
 %%%% EXAMPLE OF USAGE:
  %%    \input \LabelFig.tex
  %%    \SetLabels
  %%      (.3*.7) first label\\
  %%         % label will go to position .3 from left 
  %%         % and .7 from bottom
  %%      \L(.61*.333) $\Lambda_1\leq\Gamma$\\
  %%         % \L places left edge of label 
  %%         % (rather than the center)
  %%         % similarly use \R for right edge;
  %%         % and \B for bottom or \T for top
  %%      \T\R(.3*.7) last label \\
  %%    \endSetLabels
  %%    \ShowGrid
  %%         % lays grid on figure to label; 
  %%         % delete for final printing
  %%    \AffixLabels{\BoxedEPSF{MyFigure}}
  %%         % argument of \AffixLabels#1 should be a TeX box
  %%         % covering the inserted figure to be labelled.
  %%         % (Here \BoxedEPSF is the figure insertion macro
  %%         % of the package \BoxedEPS.tex (same sources) 
  %%         % for inserting encapsulated PostScript graphics. 
  %%         % But any other means of inserting 
  %%         % the figure can be used.)
  %%         


 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 %%%%% FORBID REREADING %%%%%
  %
  \ifx\LabelFigloaded\MYundefined\relax
  \else
    \message{ !!! LabelFig.tex ALREADY loaded !!!}
  \endinput\fi

  \def\LabelFigloaded{\relax}% now loaded

  %%% Beyond this point we use some control sequences
  %%% that are 'padlocked'  with @ of category 11

  \chardef\LabelFigCatAt\the\catcode`\@
  \catcode`\@=11

 %%temporarily suppress Plain's logging of allocations
 \let\LabelFigwlog@ld\wlog
 \def\wlog#1{\relax}

 \ifx\\\MYundefined@
    \let\\\relax
 \fi

 %%%%%%% end of preamble

  \def\ms@g{\immediate\write16}

 \def\N@wif{\csname newif\endcsname }
 \def\Temp@ {\N@wif\ifIN@}
 \ifx\INN@\MYundefined@
    \else \let\Temp@\relax
 \fi
 \Temp@

  %%% \IN@0#1@#2@ : Is 1st exp of #1 in 1st exp of #2 ??
   %% Answer in \ifIN@
  %\newif\ifIN@ %% conserve if's
  \def\IN@{\expandafter\INN@\expandafter}
  \long\def\INN@0#1@#2@{\long\def\NI@##1#1##2##3\ENDNI@
    {\ifx\m@rker##2\IN@false\else\IN@true\fi}%
     \expandafter\NI@#2@@#1\m@rker\ENDNI@}
  \def\m@rker{\m@@rker}
 
  %%%  \SPLIT@0#1@#2@  :  Split 1st exp of #2 at 1st exp of #1
   %%  \Initialtoks@ , \Terminaltoks@ will contain pieces
  \newtoks\Initialtoks@  \newtoks\Terminaltoks@
  \def\SPLIT@{\expandafter\SPLITT@\expandafter}
  \def\SPLITT@0#1@#2@{\def\TTILPS@##1#1##2@{%
     \Initialtoks@{##1}\Terminaltoks@{##2}}\expandafter\TTILPS@#2@}

   %%% \Shifted@@#1#2#3 puts #3 in \hbox
   %% leaves basepoint as is
   %% then translates ink only by dims #1,#2
   %% with Postscript convention
   %% For simplicity use only on scrunched boxes
 \def\Shifted@@#1#2#3{\setbox0=\hbox{#3}%
   \raise -\dp0\vbox {\kern-#2%
       \hbox {\kern#1\box0\kern-#1}%
           \kern#2}}

 \newcount\gridcount
 \newbox\auxGridbox@ \newbox\hGridbox@ \newbox\vGridbox@
 \newbox\Labelbox@ \newbox\auxLabelbox@
 \newbox\Coordinatebox@
 \newtoks\Labeltoks@
 \newdimen\Wdd@ \newdimen\Htt@

 \def\hRule@{\advance\gridcount -2%
   \vskip-.2pt\hrule\vskip-.2pt\vfil
   \llap{\smash{\raise -2.5pt
     \hbox{.\number\gridcount\kern2pt}}}%
           \vskip-.2pt\hrule\vskip-.2pt\vfil}

 \def\vRule@{\advance\gridcount 2%
   \hskip-.2pt\vrule\hskip-.2pt\hfil
   \setbox\auxGridbox@=\vbox to 0pt
      {\vskip \Htt@\vskip 2pt
        \hbox{\kern-3.5pt.\number\gridcount}\vss}%
      \wd\auxGridbox@=0pt \box\auxGridbox@
   \hskip-.2pt\vrule\hskip-.2pt\hfil}

 \def\PlaceGrid@@{\gridcount=10%
  \setbox\hGridbox@=%
    \hbox{\hbox{\hskip-.4pt\vrule
             \vbox to \Htt@{\offinterlineskip\parindent=\z@\relax
                \vskip-.4pt\hrule\vfil
                \hRule@\hRule@\hRule@\hRule@
                  \vskip-.2pt\hrule\vskip-.2pt\vfil
                \hbox to \Wdd@{\hfil}%
             \hrule\vskip-.4pt}%
         \vrule\hskip-.4pt}}%
  \gridcount=0%
  \setbox\vGridbox@=
     \hbox{\vbox{\offinterlineskip\parindent=0pt\hsize=0pt
       \vskip-.4pt\hrule%
             \hbox to \Wdd@{%
                \hskip-.4pt\vrule\hfil
                \vtop to \Htt@{\vfil}%
                     \vRule@\vRule@\vRule@\vRule@
                     \hskip-.2pt\vrule\hskip-.2pt\hfil
             \vrule\hskip-.4pt}%
         \hrule\vskip-.4pt}}%
  %
  \wd\hGridbox@=0pt\ht\hGridbox@=0pt
  \wd\vGridbox@=0pt\ht\vGridbox@=0pt
  %
  \hbox{\box\hGridbox@\box\vGridbox@}%
  }

 \def\LabelsGlobal{\def\LabGl@b{\global}}
 \def\LabelsLocal{\def\LabGl@b{}}
 \LabelsLocal %% default

 \def\SetLabels#1\endSetLabels{%
   \LabGl@b\Labeltoks@={#1()\\}%
   }

 \LabGl@b\Labeltoks@={()\\}

 \let\PlaceGrid@\relax
 \def\ShowGrid{\let\PlaceGrid@\PlaceGrid@@}

 \def\bAdjust@@{%
     \setbox\auxLabelbox@=\hbox{\raise \dp\auxLabelbox@
            \box\auxLabelbox@}}
 \def\bAdjust@{\let\vAdjust@\bAdjust@@}

 \def\tAdjust@@{%
     \setbox\auxLabelbox@=\hbox{\raise-\ht\auxLabelbox@
            \box\auxLabelbox@}}
 \def\tAdjust@{\let\vAdjust@\tAdjust@@}

 \let\vAdjust@\relax

 \def\lAdjust@{\let\hAdjust@\rlap}
 \def\rAdjust@{\let\hAdjust@\llap}

 \let\hAdjust@\relax\let\vAdjust@\relax

 \def\FetchLabel@#1(#2)#3\\{%
     \IN@0#2@@\ifIN@
        \setbox0=\hbox{\ignorespaces#1#3\unskip}%
        \ifdim\wd0>0pt
           \ms@g{}%
           \ms@g{ !!! Bad label(s)? !!!}%
           \message{ #1(#2)#3}%
        \fi
        \def\LabelMole@##1\endFetchLabel@{%
            \IN@0()\\@##1@%
            \ifIN@\def\Temp@{\FetchLabel@##1\endFetchLabel@}%
            \else\def\Temp@{}%
            \fi
            \Temp@
           }%
     \else
       \ignorespaces#1\unskip
       \setbox\auxLabelbox@=%
         \hbox to 0pt{\hss\ignorespaces\hAdjust@
          {\ignorespaces#3\unskip}\hss}%
       \vAdjust@
       \let\hAdjust@\relax\let\vAdjust@\relax
       \AugmentLabelBox@@{#2}%
       \ht\Labelbox@=0pt\dp\Labelbox@=0pt
       \let\LabelMole@\FetchLabel@%
     \fi\LabelMole@}

 \newtoks\XYSep@ %\XYSep@{*}
 \def\SetXYSeparator#1{%
     \IN@0#1@@\ifIN@\XYSep@{*}%
     \else
     \XYSep@{#1}%
     \fi
     }

 \SetXYSeparator*

 \def\AugmentLabelBox@@#1{%
     \IN@0\the\XYSep@ @#1@\ifIN@
       \SPLIT@0\the\XYSep@ @#1@%
       \setbox\Labelbox@=\hbox to 0pt{%
         \box\Labelbox@
         \Shifted@@{\the\Initialtoks@\Wdd@}%
         {\the\Terminaltoks@\Htt@}%
         {\box\auxLabelbox@}}%
     \else
         \ms@g{}%
         \ms@g{ !!! Bad insertion point. !!!}%
         \message{ (#1this point was rejected.)}%
     \fi
    }
 

 \def\PlaceLabels@@{\bgroup\mathsurround=0pt%
     \def\Cr@{\\}%
     \let\L\lAdjust@\let\R\rAdjust@
     \let\B\bAdjust@\let\T\tAdjust@
     \expandafter\FetchLabel@\the\Labeltoks@\endFetchLabel@
     \box\Labelbox@\egroup
     }%

 \let \PlaceLabels@\PlaceLabels@@

 \def\AffixLabels#1{\setbox\Coordinatebox@=\hbox{#1}%
      \Wdd@=\wd\Coordinatebox@ \Htt@=\ht\Coordinatebox@
      \advance\Htt@ \dp \Coordinatebox@
      \hbox{\copy\Coordinatebox@\kern-\Wdd@%
           \Shifted@@{0pt}{-\dp\Coordinatebox@}%
            {\PlaceGrid@\PlaceLabels@}%
           \kern\Wdd@}
      \let\PlaceGrid@\relax
      \LabGl@b\Labeltoks@{()\\}%
      }
 
 %%% Restoring
   \let\wlog\LabelFigwlog@ld %%restore logging
   \catcode`\@=\LabelFigCatAt  %%12 or 13

  \endinput

 %% end of  LabelFig.tex
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %% LabelFig.doc
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %%
 %%%%%   LabelFig.tex FOR LABELLING TEX FIGURE INSERTS %%%%%
  %%
  %%                        DOCUMENTATION
  %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
              
                 by Laurent Siebenmann
                 lcs@matups.matups.fr
    
                 VERSIONS: July 1991, Oct 1991


INTRODUCTION

      This small labelling package is intended for TeX users who
rely on non-TeX sources for for their graphics inserts.  It
provides means for adding TeX labels to such inserts with a
minimum of fuss. 

       For most labels, TeX users have in the past found it
reasonably convenient to rely on non-TeX sources. Typical
occasions when an inescapable need for TeX labels seemed to arise
are 

 (a) when the graphics program lacks certain exotic or complex
mathematical symbols
 (b) when the very highest typographical quality is wanted for the
labels.

       Since this package first appeared, many users, who in the past
scarcely dreamed of using TeX labels, have come to use nothing
but.  So it is now appropriate to add

     Sanity Warning:  TeX labels can be addictive. 

     Given a fast preview you may find that this package
provides an agreeable paste-up environment; see extra
applications at end.


BASIC INSTRUCTIONS

    After reading in the macro file using

    \input LabelFig.tex

preview or proof your figure with a coordinate grid printed on
top, by typing the following:

    \ShowGrid  % without this the grid will be absent
    \AffixLabels{<the graphics insertion>}

Here <the graphics insertion> is what you would type to insert
the graphics object alone without the grid.  This must provide
for the space around it. For example <the graphics insertion>
might well be \BoxedEPSF{MyFigure scaled 700} using the
BoxedEPSF.tex package (from same source); this provides a TeX box
containing the encapsulated PostScript insert specified by the
file MyFigure. \AffixLabels{...} provides the grid (supposing
\ShowGrid is present) and later, once you have specified labels
using the grid, it will "tack on" the labels.

        The grid is a sort of (usually elongated) checkerboard of
ten rows and ten columns and its (internal) partitions are
numbered  .1, ... ,.9  both horizontally (X-coordinate running
left to right) and vertically (Y-coordinate running bottom to
top).  Thus the points enclosed by the grid correspond to the
points of the unit square in the cartesian "X-Y" plane, the lower
left corner corresponding to the origin (0,0).  By extrapolation,
the full page corresponds to a larger rectangle in the plane.

        These coordinates serve to position labels as follows.
Before the \AffixLabels{...} command type label specifications:

  \SetLabels
   (<X-coordinate>*<Y-coordinate>) <first label> \\
   .
   .
   .
   (<X-coordinate>*<Y-coordinate>)  <last label> \\
  \endSetLabels

Each row specifies one label and is terminated by \\.  In each
row the position indicator comes first; it is written as a
standard cartesian point except that the X- and Y- coordinates
are separated by * rather than a comma because TeX allows a
comma as decimal point. There are no dimension units to specify
as the unit is the grid itself.

        Normally, this point specifies where the middle of the
baseline of the label will be located.  However if you precede
the point by \L [or \R] the left [or right] edge of the baseline
will be located there. Similarly you may also precede the point
by \T or \B to vertically align the top or bottom of the label box
at the specified point.  Thus, in all there are nine standard
positions of the label with respect to the insertion point ---
corresponding to the eight principal points of the compas plus
its center

                     \L\T      \T    \R\T

                      \L        0      \R

                     \L\B      \B    \R\B

Beware however that the baseline for a label will often coincide
with the bottom level (as happens for "X" but not "g"), in which
case you have 6 distinct positions rather than 9.

        It is convenient to think of this specification of label
position as attaching the label by a thumb-tack to the coordinate
grid. There are nine positions of the thumb-tack on the label,
while the position of the thumb-tack on the coordinate grid is
arbitrary.  Normally, one choses the position of the thumb-tack on
the label to be the one that is the closest to the item being
labeled.  There are two good reasons for this "rule of thumb":

   (a)  It facilitates correct positioning at first try.

   (b)  If the scale of the figure must be altered after labels
have been affixed, the labels have a good chance of remaining well
positioned.

The second reason is important. Indeed it often happens that scale
has to be altered after labelling begins, in order to either
provide space for the labels, or to adjust proportions between the
labels and the figure.  The size of labels is unaffected by
scaling.

        Here is an artificial but self-contained test which uses
TeX rules to make a graphics object.

TEST

    Do not skip this!

 %%%%%%%%%%%%%%%%%%  --- cut
\input LabelFig

 %%%%%% useful ad hoc macros

 %%% \FrameIt#1 frames what it finds in #1
 \def\FrameIt#1{\hbox{\vrule$\vcenter {\hrule\kern3pt%
             \hbox {\kern3pt #1\kern3pt}%
               \kern3pt\hrule}$\vrule}}

 %%% \Caption#1#2 gives framed caption width #1
  %%  containing #2
 \def\Caption#1#2{\FrameIt{%
       \vtop {\hsize=#1\relax \parindent=0pt
         \leftskip=0pt \rightskip=0pt plus15pt
         \parfillskip=0pt
         \lineskip=1pt\baselineskip=0pt
         #2}}}

 \def\FirstQuadrant{\hbox to 100pt{\vrule\vbox to 100pt{%
        \hbox to 100pt{\hfil}\vfil\hrule}\hss}}

 %%% the test proper begins

  \SetLabels
    \R(.5*.2) $\zeta\,\cdot$\\
    (.9*-.10) $\xi$\\
    \R(-.03*.9) $\eta$\\
    \T(.5*.9) \Caption{70pt}{%
          \it The norm of
          $g(\xi+i\eta)$ is indicated on
          contours of this invisible surface.}\\
  \endSetLabels

  %\ShowGrid  % this makes the grid visible (once)
  \AffixLabels{\FirstQuadrant}

  \end

 %%%%%%%%%%%%%%%%%% --- cut

 
GETTING IT DOWN PAT

        Complicated labeling deserves the same respect as
complicated mathematics.  It is a good idea to do  complicated
labelling in a separate file involving just  the figure being
labelled;  a texpert will know how to \dump TeX's current state as
a temporary format that restarts rapidly at each retry.  Usually,
one then pastes the completed labelled figure back into the main
TeX file,  but, of course, one can also \input it as an auxiliary
file.  

        If you do not have a TeXpert at handy, here is a first 
approximation to an efficient setup. By deletions reduce a copy  of
your article to just a few lines before and after the figure. Now
label the figure, and finally, copy and paste the labelled figure to
the original article. Then copy the next figure to label into this
testbed and repeat. The TeXpert can improve the  speed  at
which TeX starts up, by compiling a format specifically for your
article; just one caution: best NOT include in the format ephemeral
details of setup like \Set<mydriver>ArtSpecials --- this reads 
figure dimensions which you may change during your work session.

        Before using LabelFig.tex to attach labels to a graphics
object inserted using BoxedEPSF.tex or BoxedArt.tex, make it a
firm rule to carefully adjust the bounding box using the trimming
commands of these packages, and also at least tentatively scale and
position the object. Beware of changing the grid inadvertently
after the labels have been positioned.  For example, correcting the
bounding box of a PostScript graphics object can foul up the labels
by changing the coordinate grid to which the labels are attached.
This is particularly true for the trimming  commands of
BoxedEPSF.tex and BoxedArt.tex; however ,as noted already, change of 
scaling is much less disruptive, and modest adjustments should be
well tolerated.

        Sometimes the labels protrude so far from the bounding box
of a figure that the figure has to be repositioned.  Best do this
by ad hoc spacing, say using \hglue and \vglue; altering the
bounding box would create a vicious circle.

        Remember that you are responsible for preventing labels from
overlapping. You are responsible for all label typography including
size and style. A label is really just about anything that can be put
in a TeX box. Note that spaces at the beginning and end of labels will
normally be suppressed; if you really want them you must protect them
with TeX braces.

        This package temporarily sets the \mathsurround parameter
of TeX to zero  while the labels are being affixed. This is done
because nonzero \mathsurround space would influence the position
of left and right aligned labels; then, when a texpert or printer
modifies mathsurround, diagram labeling might be disastrously
altered. There is a small price to pay involving labels that are
formatted as caption boxes including mathematics: you  may want or
need to specify an explicit mathsurround space within the caption
box; it will not influence anything outside.

        Those hostile to the use of * as separator between
the X and Y coordinates of label insertion points, are free to
impose another using \SetXYSeparator{<the new separator>}.  
Americans may prefer "," to "*" since they never use a 
comma as a decimal point; but * may be readable.


SOME EXOTIC APPLICATIONS

        The grid of LabelFig.tex is analogous to a light-table in
classical page makeup with wax or latex glue.  In principle you
can use it compose any page from its indivisible parts.  This
even has some of the artisanal charm of classical paste-up
provided you have a fast screen preview to make the process
"interactive".

        In practice LabelFig.tex is a tool for nonstandard jobs.
Here are a few going beyond the labelling already discussed.


(I)  GRAPHICS INTEGRATION.

        This is accomplished by treating the imported graphics
objects as labels.  The underlying graphics object is then
typically an empty  \vbox to <dimension>{\vfill} in a TeX
\midinsert...\endinsert construction.  A label line
might be of the form

   (.1*.1) \special{... MyFigure ...}\\

The exact form of the special command varies from driver to
driver.  However, in the case of encapsulated PostScript graphics
(EPSF norn), by relying on \BoxedEPS.tex, one can have the
following standard syntax (independant of driver  (see
\BoxedEPS.doc for details.
  
  (.1.1) \EPSFSpecial{MyFigure}{<scale in mils>}\\

One could of course use standard syntax for \BoxedEPS.tex, namely
  
  (.1.1) \BoxedEPSF{MyFigure scaled <scale in mils>}\\

but that would be slow since it requires TeX to read the
PostScript file and use many complex macros.

        Similarly for graphics of the Macintosh PICT norm ---
using \BoxedArt.tex (same sources) in place of \BoxedEPS.tex.

        This approach to integration is to be recommended when one
is assembling a composite graphics object.


 (II)  COMMUTATIVE DIAGRAM ENHANCEMENT

        Commutative diagrams or arrays of mathematical objects
connected by arrows of various sorts are common in mathematics.
The mathematical objects require the use of TeX.  Recently 
TeX acquired a good collection of arrows of all slopes --- that
of LamSTeX --- plus pwerful macros to build the diagrams.

        However, even the LamSTeX collection is often inadequate;
it lacks for example double shafted arrows, dotted arrows and
curved arrows. Fortunately it is possible to produce such arrows
on an individual basis using sophisticated graphics programs such
as Illustrator and AldusFreehand (both serving the EPSF norm.
Since the creation of each new arrow is a work of love, you
probably want to limit the number of arrows by using LamSTeX for
most arrows.  Incidentally any texpert can quickly adapt the the
modest sized commutative diagram module of LamSTeX to work with
AmSTeX.

        \LabelFig.tex can then be given the role of inserting the
hand-made arrows into the commutative diagram much as it inserts
a "label" into a graphics inclusion.  The grid is normally laid
down on the TeX part of the commutative diagram, or some
convenient subobject therein (remember that one can use
coordinate values outside the grid). The latter choice may offer
greater stability if the diagram is altered.

 (III) NESTING 

Ingenuity pays off in exploiting \LabelFig.tex. One can
mix graphics and typography quite freely.  \LabelFig.tex is good
for freeform or overlapping arrangements, while BoxedEPS.tex (or
BoxedArt.tex) is best for regimented non-overlapping
arrangements --- and the two can be combined.

        The default behavior of LabelFig.tex is not ideal 
for nesting objects because to prevent trouble for beginners
the register for labels is globally cleared when \AffixLabels
concludes.  But there ase switches available

      \LabelsGlobal      \LabelsLocal

which change this.  To understand this, extend the above test 
by something like:

 %%%%%%%%%%%%%%%%%% --- cut
 %%% Test extension

 \LabelsLocal
 %\LabelsGlobal

 \SetLabels
    (.5*.5) AAA\\
 \endSetLabels

 {%%% Watch for influence of braces!!
 \SetLabels
    (.5*.5) ZZZ\\
 \endSetLabels
   \AffixLabels{\FirstQuadrant}
 }

   \AffixLabels{\FirstQuadrant}

 %%%%%%%%%%%%%%%%%% --- cut

        There are however potential pitfalls.  Neither
\LabelFig.tex nor BoxedEPSF.tex has been tested under extreme
conditions. Problems may occur if their procedures are
indiscriminately nested. For BoxedEPSF.tex (not \LabelFig.tex)
there is a precise cause for worry, namely many of its
variables are "global", which means that TeX braces will not
provide the protection one might expect.
 

COMMAND SUMMARY FOR LabelFig.tex

  Here [...] means optional (one or zero)
        [...]* means any number of such constructs

  \SetLabels
    [[<P>](<X><Sep><Y>) <label> \\]*
  \endSetLabels
  \ShowGrid  % this makes the grid visible (once)
  \AffixLabels{<the figure>}

   --- <P> is tack position, one of eight or empty
              order irrelevant

                   \L\T      \T    \R\T

                      \L               \R

                     \L\B      \B    \R\B

   --- (<X><Sep><Y>) insertion point;
  <Sep> is separator = * by default;
  \SetXYSeparator{<Sep>} changes it.
   <X> and <Y> are real numbers

  --- <label> a label to attach 

  --- <the figure> the figure to label 

  \GlobalLabelClearing (default)     
  \LocalLabelClearing  setting for nested constructs.



Address for bugs and other feedback:

        Laurent Siebenmann
        Mathematique, Bat. 425,
        Univ de Paris-Sud,
        91405-Orsay,
        France

    Tel 33-1-6941-7949; 
    Fax number: 33-1-6941-6221
    Email: lcs@matups.matups.fr  
