%%
%% This is file `showlabels.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% showlabels.dtx  (with options: `package')
%% Style to display labels in the margin
\def\filename{showlabels}
\def\fileversion{v1.3}
\def\filedate{1999/02/22}
\def\docdate{1999/02/22}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{showlabels}[1999/02/22 v1.3]
\typeout{Package: `showlabels' v1.3\space<1999/02/22>}
\wlog{Documentation}
\newif\ifSL@AMS
\expandafter\ifx\csname maketag@@@\endcsname\relax
  \SL@AMSfalse
\else
  \SL@AMStrue
  \typeout{with AMS-LaTeX equation tags}
\fi
\ifSL@AMS
  \let\@maketag@@@=\maketag@@@
  \def\maketag@@@#1{\@maketag@@@{#1}%
  \ifx\df@label\@empty
  \else
    \SL@eqnlrtext{\df@label}%
  \fi}
\else
  \let\@@eqnnum=\@eqnnum
  \def\@eqnnum{\@@eqnnum
  \ifx\SL@labeln@me\relax
    \SL@eqnlrtext{???}%
  \else
    \SL@eqnlrtext{\SL@labeln@me}%
    \global\def\SL@labeln@me{\relax}%
  \fi}
  \global\def\SL@labeln@me{\relax}
\fi
\def\showlabelfont{\small\tt}
\def\SL@gobblethree#1#2#3{}
\def\prlabelname#1{%
\expandafter\expandafter\expandafter\SL@gobblethree
    \expandafter\string\csname r@#1\endcsname}
\let\@@makecaption\@makecaption
\long\def\@makecaption#1#2{{\def\label##1{{\showlabelfont
\{\prlabelname{##1}\}\space}\SL@label{##1}}%
\@@makecaption{#1}{#2}}}
\let\SL@label\label
\def\label#1{\@bsphack\SL@label{#1}%
  \ifmmode
    \ifSL@AMS\else
      \xdef\SL@labeln@me{\prlabelname{#1}}%
    \fi
  \else
    {\setbox0=\vbox to 0pt{\vss
      \hbox to \columnwidth{\SL@lrtext{#1}}}%
    \dp0=0pt
    \ifvmode
      \nointerlineskip\box0\nobreak
    \else
      \vadjust{\box0\nobreak}%
    \fi}%
  \fi
  \@esphack}
\def\SL@margintext#1{{\showlabelfont\{\prlabelname{#1}\}}}
\def\SL@righttext#1{\hfill\rlap{\quad\SL@margintext{#1}}}
\def\SL@lefttext #1{\llap{\SL@margintext{#1}\quad}\hfill}
\def\SL@alternatetext{%
  \if@outerlabels
    \ifodd\c@page
      \let\SL@next\SL@righttext\else
      \let\SL@next\SL@lefttext\fi
  \else
    \ifodd\c@page
      \let\SL@next\SL@lefttext\else
      \let\SL@next\SL@righttext\fi
  \fi
  \SL@next}
\def\SL@twocoltext{%
  \if@firstcolumn
    \let\SL@next\SL@lefttext
  \else
    \let\SL@next\SL@righttext
  \fi
  \SL@next}
\def\SL@eqnrighttext#1{\rlap{\quad\SL@margintext{#1}}}
\def\SL@eqnlefttext #1{\hbox to 0pt{\kern -\columnwidth
\llap{\SL@margintext{#1}\quad}\hss}}
\def\SL@eqnalternatetext{%
  \if@outerlabels
    \ifodd\c@page
      \let\SL@next\SL@eqnrighttext\else
      \let\SL@next\SL@eqnlefttext\fi
  \else
    \ifodd\c@page
      \let\SL@next\SL@eqnlefttext\else
      \let\SL@next\SL@eqnrighttext\fi
  \fi
  \SL@next}
\def\SL@eqntwocoltext{%
  \if@firstcolumn
    \let\SL@next\SL@eqnlefttext
  \else
    \let\SL@next\SL@eqnrighttext
  \fi
  \SL@next}
\newif\if@outerlabels
\@outerlabelstrue
\DeclareOption{outer}{\@outerlabelstrue}
\DeclareOption{inner}{\@outerlabelsfalse}
\ProcessOptions
\if@twocolumn
  \let\SL@lrtext\SL@twocoltext
  \let\SL@eqnlrtext\SL@eqntwocoltext
\else
  \if@outerlabels
    \if@twoside
  \let\SL@lrtext\SL@alternatetext
  \let\SL@eqnlrtext\SL@eqnalternatetext
    \else
      \let\SL@lrtext\SL@righttext
      \let\SL@eqnlrtext\SL@eqnrighttext
    \fi
  \else
    \if@twoside
  \let\SL@lrtext\SL@alternatetext
  \let\SL@eqnlrtext\SL@eqnalternatetext
    \else
      \let\SL@lrtext\SL@lefttext
      \let\SL@eqnlrtext\SL@eqnlefttext
    \fi
  \fi
\fi
\endinput
%%
%% End of file `showlabels.sty'.
