<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% This is labtex, v 0.9.

% written by:	Alan Hoenig, summer 1991-summer 1992.
%		Bitnet: ajhjj@cunyvm
%		Mail: 17 Bay Avenue, Huntington, NY 11743, USA
%

% You need the file LABTEX.MF in addition to this one.  

% If you've got this far, you have created a special figure font.  Let's 
% pretend it's called figfont.  At the start of your TeX document, 
% include the lines
% 	\input labtex
% 	\font\labtex=figfont
% and wherever you wnat to include a figure enter
% 	\fig$
% 	&lt;label list&gt;
% 	\endfig
% where $ represents the numeric position in the font occupied by your 
% figure.  Each item in the list is one of the pointing commands defined 
% below coupled with the text of the label (eg. \blpoint{$(x,y)$}).
% It's that simple.
% 

\newif\ifdebug
\debugfalse
\newcount\labels 
{\catcode`.=12 \catcode`p=12 \catcode`t=12
 \gdef\\#1.#2pt{\global\labels=#1 
 }}\let\glpf=\\

\def\getx#1{\setbox2=\hbox{\labtex\char0 \char#1}%
 \setbox0=\hbox{\labtex\char0{}\char#1}%
 \dimen0=\wd2 \advance\dimen0 by-\wd0
}
\def\gety#1{\setbox2=\hbox{\labtex\char1 \char#1}%
 \setbox0=\hbox{\labtex\char1{}\char#1}%
 \dimen0=\wd2 \advance\dimen0 by-\wd0
}
\def\getlpf#1{\setbox2=\hbox{\labtex\char2 \char#1}%
 \setbox0=\hbox{\labtex\char2{}\char#1}%
 \dimen0=\wd2 \advance\dimen0 by-\wd0
}

\newbox\figbox % to hold figure for printing
\newcount\coordcount \newcount\figcount
\newdimen\x \newdimen\y 
\newdimen\figwd \newdimen\fight \newdimen\figdp
\def\fig#1{% usage: \fig2, where 2 is the figure number
 \figcount=#1%
 \setbox\figbox=\hbox{\labtex \char\figcount }%
 \global\figwd=\wd\figbox \global\fight=\ht\figbox
 \global\figdp=\dp\figbox \zerobox\figbox%
 \setXYpointers{#1}% ensures \coordcount's value is the char whose kern
  % is \x; same for \y
 \hbox\bgroup\box\figbox % now add \point'ing commands and labels
 \vrule width0pt height\fight depth\figdp
}
\def\endfig{\kern\figwd\egroup}

\def\zerobox#1{\wd#1=0pt \ht#1=0pt \dp#1=0pt}

\newcount\scratch \newcount\totallabs
\def\setXYpointers#1{\scratch=0 \totallabs=0%
 \coordcount=0 % start with fresh slate
 \loop\ifnum\scratch&lt;#1%
  \getlpf\scratch \expandafter\glpf\the\dimen0 
  \advance\totallabs by\labels
  \advance\scratch by 1 \repeat
 \coordcount=\totallabs 
}

\newdimen\extradx \newdimen\extrady \newtoks\everylabel
\newbox\labelbox \newdimen\totalht
\newdimen\labelht \newdimen\labelwd \newdimen\labeldp
\newdimen\vertadjust \newdimen\horadjust% vertical adjustment of labels
\def\getparameters#1{% #1 is text of label
 \global\vertadjust=0pt \global\horadjust=0pt 
 \setbox\labelbox=\hbox{\the\everylabel #1}%
 \labelht=\ht\labelbox \labeldp=\dp\labelbox 
 \advance\labelht by\extrady \advance\labeldp by\extrady
 \totalht=\labelht \advance\totalht by\labeldp
 \setbox\labelbox=\hbox{\the\everylabel 
  \vrule width0pt height\labelht depth\labeldp
  \hskip\extradx #1\hskip\extradx}\labelwd=\wd\labelbox %
 \ifdebug \showthe\coordcount \fi 
 \getx\coordcount \x=\dimen0 \advance\x by\horadjust
 \ifdebug \showthe\dimen0 \fi % \x before \horadjust
 \gety\coordcount \y=\dimen0 \advance\y by\vertadjust
 \ifdebug \showthe\dimen0 \fi % \y before \vertadjust
 \ifdebug \showthe\x \showthe\y \fi % after adjustments
 \advance\coordcount by1 
}
\def\down{\global\vertadjust= -}
\def\up{\global\vertadjust= }
\def\left{\global\horadjust= -}
\def\right{\global\horadjust= }

\def\reset{% puts ref pt of \labelbox at lower left, not at baseline
 \advance\y by \labeldp}

\def\point#1{\getparameters{#1}% point to left end of Baseline
 \rlap{\kern\x \raise\y \box\labelbox}} 
\let\Bpoint=\point \let\Blpoint=\point \let\lBpoint=\point % synonyms

\def\Brpoint#1{\getparameters{#1}%
\advance\x by-\labelwd
 \rlap{\kern\x \raise\y \box\labelbox}}
\let\rBpoint=\Brpoint 

\def\cpoint#1{\getparameters{#1}% OK
 \reset \advance\y by-.5\totalht \advance\x by-.5\labelwd
 \rlap{\kern\x \raise\y \box\labelbox}}

\def\lpoint#1{\getparameters{#1}% OK
 \reset \advance\y by-.5\totalht 
 \rlap{\kern\x \raise\y \box\labelbox}}

\def\lbpoint#1{\getparameters{#1}%
 \reset \rlap{\kern\x \raise\y \box\labelbox}}
\let\blpoint=\lbpoint

\def\bpoint#1{\getparameters{#1}%
 \reset \advance\x by-.5\labelwd 
 \rlap{\kern\x \raise\y \box\labelbox}}

\def\rbpoint#1{\getparameters{#1}%
 \reset \advance\x by-\labelwd 
 \rlap{\kern\x \raise\y \box\labelbox}}
\let\brpoint=\rbpoint

\def\rpoint#1{\getparameters{#1}%
 \reset \advance\y by-.5\totalht \advance\x by-\labelwd
 \rlap{\kern\x \raise\y \box\labelbox}}

\def\trpoint#1{\getparameters{#1}%
 \reset \advance\y by-\totalht \advance\x by-\labelwd
 \rlap{\kern\x \raise\y \box\labelbox}}
\let\rtpoint=\trpoint

\def\tpoint#1{\getparameters{#1}%
 \reset \advance\y by-\totalht 
 \advance\x by-.5\labelwd
 \rlap{\kern\x \raise\y \box\labelbox}}

\def\tlpoint#1{\getparameters{#1}%
 \reset \advance\y by-\totalht 
 \rlap{\kern\x \raise\y \box\labelbox}}
\let\ltpoint=\tlpoint

\endinput


</pre></body></html>